Translations of Plugins

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Translations of Plugins

Post by cmb » Fri Sep 30, 2011 4:53 pm

Hello developers, hello translators,

are there any standards or common practices for the internationalization of plugins, i.e. $plugin_tx, with regard to words, which should not be translated, but instead be kept literally?

In Pagemanger for example there is:

Code: Select all

<p>Sould the toolbar be shown? <em>YES</em> or <em>NO</em></p>
which should be translated to e.g. de as:

Code: Select all

<p>Soll die Werkzeugleiste angezeigt werden? <em>YES</em> (ja) oder <em>NO</em> (nein)</p>
but not as:

Code: Select all

<p>Soll die Werkzeugleiste angezeigt werden? <em>JA</em> oder <em>NEIN</em></p>
I wanted to avoid the use of quotes, so an unexperienced end-user won't type the quotes in the fields too. But probably this was a bad idea, because several translators now translated even the literal words YES and NO.

So, is it better to put those literal words in quotes, or could somebody point out another practise, that makes it easier for translators and end-users as well? Please note that changing YES/NO to 1/0 will not solve the problem completely, as there are other cases with the same problems.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

oldnema
Posts: 265
Joined: Wed Jan 21, 2009 5:15 pm
Location: Czech Republic
Contact:

Re: Translations of Plugins

Post by oldnema » Fri Sep 30, 2011 6:31 pm

Simplest solution is probably really only use 1/0 ?
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Translations of Plugins

Post by cmb » Sat Oct 01, 2011 12:40 am

Hello oldnema,

thanks for your feedback. :)
oldnema wrote:Simplest solution is probably really only use 1/0 ?
This will definitely be the simplest solution for the plugin author and the translators, as well as advanced users. But what about computer newbies – are they able to grasp that rather technical "language"? I'm really not sure.

And the general problem remains: what to do with other literal words that should not be translated, e.g. noindex,nofollow? And there are many more of them.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Translations of Plugins

Post by cmb » Fri Oct 28, 2011 10:50 pm

Hello Community,

I've thought about this translation problem again, and I guess, it might be best to give an example. So please consider a configuration option "font_size". This could take the values "small", "medium" and "large". The English help text could be:
The size of the font: small, medium or large
The german translation
Die Größe der Schrift: klein, mittel oder groß
won't work.(*) But what about:
Die Größe der Schrift: small (klein), medium (mittel) oder large (groß)
resp. in Russian
Размер шрифта:small (маленький), medium (средний) или large (большой).
IMO this should be clear enough for the users. Well, the italic font might be replaced by a bold one, but that's a matter of styling only. It might be even better to write "small" instead of small. But currently I prefer the <i>, because it could be read as "idiom" by translators. But -- however the string given to the translator might be dubious. So, what if the string is:
The size of the font: small (small), medium (medium) or large (large)
Now it should be much clearer for the translator, what is to translate and which terms should not be translated. But for the English reader this is rather strange. A solution could be default.php, available since CMSimple_XH 1.5 anyway. While in en.php it could be
The size of the font: small, medium or large
in default.php it could be
The size of the font: small (small), medium (medium) or large (large)
So the translation should be done from default.php instead of en.php.

What do you think about it?

Christoph

(*) It's possible to check against localized words ($cf['font_size'] == $tx['small'] etc.), but that won't work for multi language sites. And so, as it's not possible to internationalize these words, it's questionable to internationalize the configuration variables in the display IMO.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Translations of Plugins

Post by cmb » Sun Oct 30, 2011 12:50 pm

Hello Community,

oldnema had the idea, that the plugin developer should give hints to the translators by displaying them in the plugin administration. I'm somewhat convinced, that such hints are indeed necessary or at least very helpful for translators. But IMO it might be better, to have those hints available directly where they belong: to every single language string that needs them. It is possible for the plugin developer to add those hints the same way hints could be given for configuration options. But then those hints will be shown as own language strings, despite the fact, that they don't need to be translated.

IMO changing the core and the plugin loader to enable those hints for translators is not reasonable. But they could be integrated into a translation plugin, as Tata suggested already in http://www.cmsimpleforum.com/viewtopic. ... 10&start=1. Meanwhile I think such a plugin could really be useful for translators. So I've developed Translator_XH. Its features:
  • all plugins that are internationalized are displayed as a list in Translator_XH's plugin administration, so even plugins can be easily translated which do not offer a plugin administration
  • all language strings of both languages (the one to translate from, and the one to translate to) are displayed side by side, so it's possible to see, if any changes of the wording should be done
  • currently the "from" language defaults to "en", to "to" language will be the current language of the installation. You can change that by modifying the URL manually
  • language strings that are not available in the "from" language any more, are not shown, and will be removed from the "to" language file on save
  • language string that are missing in the "to" language are tagged as CSS class .new, so they can be highlighted easily
  • currently only plugins can be translated with Translator_XH, but I can add support for translation of the core language strings, if the plugin proves to be useful
  • If a plugin developer provides a file translation-hints.php in his plugin's language folder, these hints are available when hovering over the "?" icon. In the zip file I've put such a file for Pagemanager.
  • As most templates will be to small for the display of the whole information, you should have a look at the stylesheet, and make the necessary adjustments.
The current version of Translator_XH has considered to be a development preview. So (a) quite some parts are missing (e.g. no help file available) and (b) it has to be considered to have bugs. So if you want to test it, make a backup of your website (particularly the language files) first.

What do you think about it? Any comments appreciated.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

oldnema
Posts: 265
Joined: Wed Jan 21, 2009 5:15 pm
Location: Czech Republic
Contact:

Re: Translations of Plugins

Post by oldnema » Sun Oct 30, 2011 1:31 pm

Perfect, brilliant, clever and very well arranged for translators.
Christoph is King!!
Nobody knows how much time he has left ...
http://oldnema.compsys.cz/en/?Demo_templates

Tata
Posts: 3588
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Translations of Plugins

Post by Tata » Sun Oct 30, 2011 7:30 pm

Excellent, indeed!
Now, it's developers' turn to keep their language files and their internal order as much stabil as possible. Or maybe sort the variables alphabetically?
How will this work, if an/ new variable will be added e.g. between present lines #15-#16. How will this affect another - already available translations?
In the translator-addon I had got from some apps authors - if there were added some new items - I found them also in SK language on their proper positions with their original values.
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Translations of Plugins

Post by cmb » Sun Oct 30, 2011 8:25 pm

Hello oldnema, hello Tata,

thanks for your compliments. :) But don't forget: I've just implemented Tata's good suggestion.
Tata wrote:Now, it's developers' turn to keep their language files and their internal order as much stabil as possible. Or maybe sort the variables alphabetically?
That shouldn't be a problem. The language strings are sorted alphabetically for plugins (as this is done by the pluginloader too; but the core language strings are not sorted). But however, the handling is the very simple: just show all string of the "from" language and display their counterparts of the "to" language. If the latter does not exists, just display an empty field with CSS class "new" (so they could be highlighted).
Tata wrote:In the translator-addon I had got from some apps authors - if there were added some new items - I found them also in SK language on their proper positions with their original values.
It is quite simple to display the "from" language string, if the corresponding "to" language string does not exist, but after saving, the highlighting will be gone. So I guess I make that configurable.

BTW: I've already added the possibility to translate the language strings of the core, and another nice feature: download of a properly arranged language pack of selected plugins as zip.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

svasti
Posts: 1659
Joined: Wed Dec 17, 2008 5:08 pm

Re: Translations of Plugins

Post by svasti » Mon Oct 31, 2011 9:32 am

Hi Christoph,
very welcome plugin! I suggest that it be placed in the official CMSimple websites next to the language pacs, so users are aware of this nice facility. Now translation becomes much easier.
svasti

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Translations of Plugins

Post by cmb » Mon Oct 31, 2011 11:24 am

Hi Frank,
svasti wrote:I suggest that it be placed in the official CMSimple websites next to the language pacs, so users are aware of this nice facility.
The plugin is mainly thought to be used by translators and perhaps webmasters and "installers". But however, it might be nice to include a link near the language packs. But let's wait a while, until the plugin becomes stable.

Christoph
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply