On Thu, Jul 24, 2003 at 09:17:05PM +0300, Tuomo Valkonen wrote:
> On Thu, Jul 24, 2003 at 06:38:16PM +0100, Keith Willoughby wrote:
> > but the
> > gettext/msgformat infrasructure isn't in place.
>
> Why don't you do so? Quite a few of the strings are in the Lua code;
> does xgettext work on generic code or is it language-dependant?
OK, I've gotten to the point where I have an ion running (partly) in
Welsh. The gettext() parts were pretty easy, it was making a
Makefile to generate the pofiles and install the mofiles that was a
pain. (I butchered the autoconf'ed version from xchat in the end, and it
would still need tidying up to use the symbols from system.mk)
However.
xgettext doesn't understand lua. I was hopeful that it wouldn't matter,
and it does get a lot of it right by treating it as C, but it doesn't
appear to get lua's concatenated text. The text
warn("The binding group(s) ") .. table.concat(groups, ", " ..
were undefined so the\nfollowing emergency mappings have " ..
"been made:\n " .. table.concat(mappings,"\n ") ..
"\nPlease fix your configuration files!")
translated to this
warn(translate("The binding group(s) ") .. table.concat(groups, ", ") ..
translate(" were undefined so the\nfollowing emergency mappings have ") ..
translate("been made:\n ") .. table.concat(mappings, "\n ") ..
translate("\nPlease fix your configuration files!"))
produced a pofile like this
#: share/ioncore-startup.lua:83
msgid "The binding group(s) "
msgstr ""
#: share/ioncore-startup.lua:84
msgid ""
" were undefined so the\n"
"following emergency mappings have "
msgstr ""
#: share/ioncore-startup.lua:85
msgid ""
"been made"
" "
msgstr ""
In addition (and actually linked to the entry above) several of the
strings in ion aren't suitable for translating (or at least, aren't
"best practice"). When it comes to translatable strings, each string
should be a whole sentence, with relocatable parameters.
For example, in ioncore.lua we have
warn("Warning: " ..file.. " is obsolete")
I know such concatenation is a huge convenience, but it makes it hard to
translate because it fixes the position of the filename in the sentence,
and doesn't explain *what* is obsolete.
It's better to have something like "Warning: file %s is obsolete" and
format it later (as like printf - I assume there's something similar
available in lua)
So, it's possible that it's either impossible to i18n/l10n ion (because
of xgettext) or at the very least inconvenient and would require a
different coding style. I guess it depends if there's any demand for
translated versions of ion to make it worth while, beyond my
idiosyncratic desire to use ion in Welsh :)
--
Keith Willoughby http://flat222.org/keith/
"Living in a jungle, living in a tent. Better than a prefab - no rent."