[RkWard-devel] Spanish translation
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sun Nov 21 12:41:17 UTC 2004
Hi,
> > - How are you plannign to translate 'plugins'?
>
> Thomas?
good question. I have not really thought much about that, yet. Also it might
not be worth the effort to put much work in it right now, since there are
only very few plugins so far, and there will probably be changes to the
format. Nevertheless, here are a few (pretty common sense) ideas:
- I18n will have to work as usual, i.e. there will be a table of original
strings and their translations. I don't really know how to use gettext, but
that will likely be the tool to use. In principle, what should happen
(obviously) is, that while constructing the plugin, rkward should try to look
up the strings in the table of translations. If there is a translation, that
will be used. Otherwise the default (english) will be used.
- What we need to get there is basically two things: 1) a mechanism to mark up
translatable strings. Something like the i18n ()-macro used in the
C++-sources, so i18n strings can be extracted. 2) The lookup mechanism
itself.
Well, as I said, that's pretty much common sense, and not much of a pratical
solution so far. Maybe the easiest solution is to simply define some
i18n-markup that can easily be spotted by a regular expression. The actual
translation would then basically mean to run a search and replace mechanism
over the plugin-scripts before they get interpreted.
I.e.:
1)
// some script-or xml code
... #i18n#A translatable string#/i18n# ...
2) When invoking the plugin first run a search for #i18n#.*#/i18n#, try to
look up the internal part, and replace with the translated string. Save the
result in a temporary file.
3) Run the temporary file.
This is not very elegant or efficient (though I don't expect performance to be
much of an issue, here), so better suggestions are welcome.
Thomas
More information about the Rkward-devel
mailing list