Bonjour, good evening, Guten Tag and こんにちは,
a few weeks ago I asked on the FOSSology mailinglist if FOSSology already
supported any kind of translation efforts to include interfaces in several
languages.
Project leader Mr Gobeille replied that no such thing was in place yet, but
he invited me to contribute.
I wrote a few lines of PHP-code to enable FO to become internationalized.
My contribution was not yet committed, but Robert was kind enough to put
i18n on the roadmap for release 1.5.
Making FO able to speak several language involves changes on the codebase,
though. And the translations must be contributed, too.
Therefore FO is searching for* developers or users* who are willing to
translate the English user interface into the language of their choice. I
proposed to have any supported language disabled, until the translation is
complete. Since I want to manage the German translation myself, I expect to
have German as first supported language.
I guess it's a smart move to disable the automatic translation for the time
being and have the individual developers activate their particular language
one by one (instead of activating any language the system might find
translation-files for).
The i18n-efforts are based on the venerable gettext-engine, which also
supports PHP. Adding gettext to FO requires the following change:
All strings to be translated must be marked like this: _("String").
Then a parser is used to extract the strings for translation. A special file
is used to store the translations in text-form (po-file) and binary-form
(mo-file; for performance reason).
I assume, no single developer can convert the UI in a reasonable amount of
time. Therefore I like to encourage all developers to add the translation
markers for the code/plug-ins they currently maintain. For English speaking
users, there should be no functional change.
As soon as I can submit my prototype (perhaps after FO 1.2 is released), I
will send an update about the procedures. Then you will be able to use my
code as a model for converting the code.
It is really simple. I like to give an example:
var $example = "say hello";
becomes
var $example = _("say hello");
Easy, isn't it?
Mutliline strings should be broken up into tokens that need translation, and
tokens that need no translation, esp. markup. Thus, the i18n task can be
used to improve separation of content and layout.
BTW. of course the PHP-environment must be gettext-enabled, which I simply
did by:
apt-get install php-gettext
but YMMV.
Yours
sincerly
Stefan Schröder, Germany
To learn more about this, search for "gettext i18n PHP" in your favorite
search engine.
_______________________________________________
fossology mailing list
[email protected]
http://fossology.org/mailman/listinfo/fossology