Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language names in other languages #264

Closed
benique opened this Issue Sep 17, 2015 · 35 comments

Comments

Projects
None yet
3 participants
@benique
Copy link
Contributor

benique commented Sep 17, 2015

The language in the following string should be translated to the currently selected language.
Sorry, this entry is only available in %LANG:, : and %.

Currently it looks like that for example.
Sorry, this entry is only available in Deutsch.

It should however read.
Sorry, this entry is only available in German.

That means we need all available languages translated into all available languages.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 17, 2015

This is listed in Desirable page under "Language names in other languages" and at WP: https://wordpress.org/support/topic/language-name-question.

Let us keep this issue here too, as a reminder. Some day ...

@johnclause johnclause changed the title Translate the language in the language warning string. Language names in other languages Sep 17, 2015

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 17, 2015

Thanks. I will look into this.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 20, 2015

@johnclause I have had a look at the code. I think the best solution would be to have an additional field in the language settings for adding the English name of the language. (see screenshot)
language_settings

Then we can just translate from English to the target language. That would however imply that we have to add translations of all language names to all translation files (.po files). What do you think about this suggestion?

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 20, 2015

Yes, something like this, but they have to be multiple lines for each other language enabled. It is easy enough to add such fields, but to collect the actual information from translators does not seem like an easy task. It may simply be provided in .po files by translators, then we do not have to have a special line in configuration file. Or maybe both. Yes, actually both is probably better. Then we can use the information from .po file, if it is there, and have an option to provide it manually?

After all, this is not a huge issue, since if people know some language they will recognize its native name and will click on it, otherwise they will ignore unrecognized words. In fact, the way it is now is not grammatically strictly correct, but makes sense in computerized world.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 20, 2015

The easiest option would be to have the translations in the .po files. Lists like that are available online (http://cldr.unicode.org). This particular list should be complete as it is used by big companies as well (see https://en.wikipedia.org/wiki/Common_Locale_Data_Repository).

Therefore I think we don't need add fields for every possible translations. That would only make the UI cumbersome and we could just provide a link to where people can submit their own translations. We could however use the native name as a fallback. This should be a very solid solution.

You can find the newest list here:

  1. go there: http://unicode.org/Public/cldr/latest
  2. Download core.zip
  3. You can find the files in core/common/main
@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 21, 2015

I uploaded lang/language-names.pot file with English names of languages from function qtranxf_default_windows_locale, which I plan to concatenate with each update of qtranslate.pot.

Would you have time to work on this? To extract from cldr all the names needed into files lang/language-names-xx_XX.po? I will concatenate them with all .po files, once they are ready.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 21, 2015

It's a bit complicated to extract all translations in the right way. Here is what I have at the moment.
http://test.myisp.ch/po.zip

I only translated the languages from the file language-names.pot but I there are more .po files than we need at the moment files. Could you check the files?

@pedro-mendonca

This comment has been minimized.

Copy link
Contributor

pedro-mendonca commented Sep 21, 2015

I've checked those on my language (pt_PT) and seems great. They even show up without capital first letter, perfect as string to include in the main sentence.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 22, 2015

@pedro-mendonca Great. Thanks for checking.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 23, 2015

@johnclause I just updated qtranslate_core.php here:
https://github.com/benique/qtranslate-x

Now we only need the updated gettext files for it to work. My current implementation uses the English name as a fallback. It uses the English names which are stored in qtranxf_default_windows_locale and translates them with the normal translation function: __($english_names[$language],'qtranslate');

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 24, 2015

Not all po have translations, is that because the data not available or those did not get processed?

I think we will work on this issue later after the next release. The latest version on GitHub already have a lot of fixes that people wait for. It would be great if you could test all the features that you use on your sites, to make sure that there are no new bugs? There is still a few old bugs, which we will fix later.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 24, 2015

Yeah, some languages don't have all translations in the original files. It might be possible to get a few more translations with using more linked files. I'm not sure though if there are more links.

The most common languages should however be fully or nearly fully translated. We won't have many missing translations in the end I think because qTranslate X doesn't come with all the languages that the source files support.

I updated the files again because there was an problem with the character set.

When is the next release due to be released?

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 24, 2015

Any day now, I am waiting for people to test it.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 24, 2015

I've been checking the files. The .po files that we need have on average about 85% translated. They are in fact much more complete than the other translation files. The missing translations are usually the very exotic ones.

The system for specifying the languages seams to be a different ones. I found the following differences for example.

qTranslate-X unicode.org description
Gaelic (Scots) Scottish Gaelic
Bihari Bhojpuri Bhojpuri is a sub language of Bihari
Faeroese Faroese Faeroese is misspelled, i think (see wikipedia)
Frisian * Frisian there are many different Frisian languages
Gallegan Galician Gallegan much less preferable and correct than " Galician" (see wikipedia)
Panjabi Punjabi Panjabi is misspelled, i think (see wikipedia)
Kirghiz Kyrgyz Kirghiz is an alternative spelling
Uighur Uyghur Uighur is an alternative spelling
Sami * Sami there are many different Sami languages
Volapuk Volapük Volapuk is misspelled, i think (see wikipedia)
Letzeburgesch Luxembourgish Letzeburgesch is an alternative spelling
Norwegian Bokmal Norwegian Bokmål Norwegian Bokmal is misspelled, i think (see wikipedia)

The following languages would be affected as well:
Marshall
Ndebele, North
Ndebele, South
Chichewa; Nyanja
Occitan (post 1500)
Ossetian; Ossetic
Pushto
Rhaeto-Romance
Sinhalese
Sotho
Tonga

Those differences are the reason for most of the missing translations. I'm wondering how many if anyone at all are actually using those languages with qTranslate-X. It must be a very small number.

I think It would be best to change to the system of the Unicode Consortium.

@johnclause What do you think about that suggestion?

I updated the zip file I linked to before. All the translations that we need are in the directory qTranslate-X. They now have the right file names.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 24, 2015

Maybe, instead of English Name as the keywords, we should use locale, like en_US, en_GB, etc., the same one as whatever WordPress uses. That would define the language more accurately and uniquely. We use locale in file name anyway, so it may make better sense to use locale as a key for translation too?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 24, 2015

Yeah, I was thinking about that too. I forgot to mention it.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Sep 25, 2015

Where do we store English names then? Will file -en.po work, for example? Could you find time to test it?

It is probably also a good idea to keep all those files separate from qtranslate-*.po, since they will be mostly generated with a script, which you apparently wrote. We will ask translators to check those files for completeness, and most of them will not have to do any additional translation.

BTW, could you please, PR that script somewhere under subfolder "dev"? That folder is not included in WP releases.

Thanks a lot for all your help!

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Sep 25, 2015

I recompiled the files. You can find the new files here:
http://test.myisp.ch/wp_po.zip

Wordpress uses a different system than the Unicode Consortium. However the translations should be pretty good for the commonly used languages, i think. By tweaking the script (by matching different language codes) you might be able to get a few more translations of exotic languages.

I uploaded the script as well as you suggested.

We only need the English names as a fallback. I would use -en.po as the fallback. We could link that to -en_US.po. since Wordpress uses US English as base as well.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 3, 2015

I committed your files and modified the code to read them. There is no en_US.po though, which is indeed most needed. Also other po files do not have entry for en_US either. Is there a way to fix it?

Where did you uploaded the script, I did not see a PR with it?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 5, 2015

I added en_US and en to the converter script. I converted the files again and uploaded them here:
https://github.com/benique/qtranslate-x/tree/master/dev

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Thank you very much, @benique ! I am not sure how to get files from there. Maybe it is easier to send me zip, like before? Please, include the script into that zip. Thanks a lot.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 6, 2015

Here you go:
http://test.myisp.ch/xml2po.zip

It includes everything you need.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Thank you very much, @benique. I checked in them all. I guess we are done for now!

Your fork https://github.com/benique/qtranslate-x has too many changes by now which are already in the qtx master. You may consider deleting it and making new fork, from which you could submit meaningful pull requests, when needed.

Are we ready to close this issue?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 6, 2015

@johnclause Thx. I'm still struggling a little with github. I created another pull request.
master...benique:master

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Yeah, such pull request is unmanageable, 275 files are changed - impossible to understand what is really changed. Could you tell me which file and function are you trying to pull, I may take it manually and then you may clean up the fork for the future use.

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 6, 2015

I compressed the PNG files with ImageOptim which does lossless compression.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Ah, now it makes more sense. I never look at it this way before. Yeah, that is a good idea, thank you. Do you wish to press button "Create pull request" on master...benique:master so that it would be recorded under your name?

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

BTW, how sure are you that all browsers support this format?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 6, 2015

I have been using this for years. PNGs can be compressed using various technics. Google recently released a new algorithm which works for PNG compression as well. It's called brotli.
http://google-opensource.blogspot.com/2015/09/introducing-brotli-new-compression.html

You can find more information here:
https://en.wikipedia.org/wiki/Portable_Network_Graphics#File_size_and_optimization_software

This is the software that I used.
https://imageoptim.com

PNG compression is mainly used for web page load time optimization.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Yes, this seems to be safe. Do you wish to press button "Create pull request" on master...benique:master so that it would be recorded under your name?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 6, 2015

I don't care that much about being mentioned.

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 6, 2015

Ok, merged, I guess we are done here. We should not have discussed PNG compression under this "translation" topic. Let us open a new issue if you have something else to merge.

Thank you very much, @benique, for all your help!

I am closing this issue for now, we can still write into a closed issue, or we can re-open it, if needed.

@johnclause johnclause closed this Oct 6, 2015

@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 13, 2015

Just another thought, which occurred to me.

In fact, the whole business about translation of names is fuzzy. Consider situation like this. You are reading English, because your native language is not available, and English is the best other language you know. You are not very fluent in English and have no idea how other languages are named in English. Suddenly you hit a page without translation. Then you would not know which link to click. When names are listed in native language, then you would recognize your own language for sure, or possibly some other languages that you tried to learn.

The translated names only work, when one read in native language. That is why in all applications when they need to list languages, they mostly use native names.

Well, you never can make everyone happy. Do you know, by any chance how WPML or Polylang deal with it?

@benique

This comment has been minimized.

Copy link
Contributor Author

benique commented Oct 13, 2015

@johnclause I understand your concern. A few days ago I read about this topic.

However I think the translation of the language names is not an issue, because people most probably know the names of the languages they know in the languages that they can read.

Additionally the names of languages are usually easy to recognize when they're written in other languages that you might not know.

Furthermore websites usually provide a language menu as well where one could switch the language in case the reader doesn't understand the translated languages.

Two solutions came to mind to offset the problem.

  1. We could provide a title tag for the link with the language name in its own language.
  2. We could offer an option to change the translation bevaiour.
@johnclause

This comment has been minimized.

Copy link
Member

johnclause commented Oct 14, 2015

I added display of native language name on mouse hover in NA message, as you suggested. I guess this may indeed help. Let us see if anyone complains before getting busy with a new option ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.