Re: [Translation-i18n] Re: Proposal for declinations in gettext



Yann Dirson wrote:
> it is difficult in some cases to
> find unique english strings that will be possible map one to one in
> all languages.

A common technique is to use a context marker in the msgid string,
like this:

    my_gettext ("[menu item]Open")
    my_gettext ("[combobox item]Open")

which translators can translate like this:

    msgid "[menu item]Open"
    msgstr "Ouvrir"

    msgid "[combobox item]Open"
    msgstr "Ouvert"

The my_gettext function calls gettext and, if it is returns the
untranslated string, strips the "[...]" prefix.

See also the gettext documentation, section "GUI program problems".

The only problem (quite small, IMO) with this approach is that translators
must be made aware where the context marker ends.

Bruno




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