<markup-trans/> tag and general i18n woes



hi alper,

i'm trying to build translated markup docs for plugins,
and figured due to gettext() limitations, i have to
translate things at runtime. but that means i need exact
message ids in generated .markup files.
for instance, bseautodoc currently generates:

string = query_string_from_bse(); /* "This is a nice description text." */
g_print ("@* @emph{Description:} %s\n", string);

now, to get a translated version, one could use LANG=de_DE for bseautodoc and:

setlocale(LC_ALL,"");
string = query_string_from_bse(); /* "Dies ist eine schvne Beschreibung." */
g_print ("@* @emph{%s} %s\n", _("Description:"), string);

which would be good enough for german in germany, but it will not
work for generating documents for all the other languages listed
in ALL_LINGUAS (in configure.in).
mainly, because ALL_LINGUAS only contains language abbreviations
without country codes (i.e. "de" instead of "de_DE") which aren't
good enough to be accepted by setlocale(), and because all developers
running bseautodoc during the build process would have to have all
locales installed and built on their systems
(i.e. entered in /etc/locale.gen).

what we can do though is translate stuff in the markup browser.
for that, bseautodoc just needs to put out translation information,
and that has to be transferred into the markup files literally, i.e.:

string = query_string_from_bse(); /* "This is a nice description text." */
g_print ("@* @emph{<markup-trans>Description:</markup-trans>} <markup-trans>%s</markup-trans>\n", string);

the resulting markup file then must contain exactly:
[...]<markup-trans>Description:</markup-trans>[...]
[...]<markup-trans>This is a nice description text.</markup-trans>[...]

where "This is a nice description text." also needs proper escaping
(probably by bseautodoc) if it contains characters like "<" or "@".
and it also may contain ordinary punctuation characters like ",",
which pretty much rules out using a texinfo macro ala @trans{Description:}.
additionally, the markup-trans tag might need to provide extr information,
like the translation domain, e.g. <markup-trans domain="plugin-package">...

i'm not sure what guarantees about preserving text portions literally
the various tools in the texitheque .markup generation chain provide
(that is including newlines, tabs and spaces, or the text won't be
usable as msgid to gettext(3) anymore), so i'd apprechiate every input
from you on this issue.

---
ciaoTJ




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]