internationalization
Dumas Patrice <[email protected]> Mon, 8 Sep 2003 16:44:13 +0200
| Newsgroups | gmane.comp.tex.texi2html.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi, I changed a bit the handling of internationalization. 3 changes which (I believe) are not very questionnable: * a function is used instead of a hash. Allows for encapsulation. * the keys are strings (like 'About this page') and not identifiers (like 'About_title'). This is how gettext does and I think it helps translaters. * I am starting using sprintf with %d and %s instead of string concatenations such that it is easier to exchange the order of the words. I have also added code which, in my opinion would help the maintainers in maintaining the translations up to date, and would help translators by hiding underlying code. But you might find these changes bad, thus I ask here before finishing the transition. In the new scheme, there is a hash in the main translations file (T2h_i18n.pm), each entry corresponding with an english string. This hash should be updated whenever there are new strings to be translated. I call this hash the reference hash. There is also one file per language, in the i18n directory, and each of these files only contains one (or 2) hash, which keys are the english strings, and values are the corresponding translated strings. One of the hash holds the strings appearing in the reference hash. The other contains all the obsolete strings which are not in the reference hash anymore. These hashes are automatically updated with $./texi2html -i18n update The idea behind that is that translators should only have to look at the file for their language and just write down the translations. And the maintainers/coders should only have to update the reference hash, then rerun $./texi2html -i18n update When the translators have done their jobs, $./texi2html -i18n merge merge the files in a file, translations.pl, which is included by ./configure into the texi2html script. Does this seems right ? Pat