[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using gettext for GUI
From: |
Bruno Haible |
Subject: |
Re: Using gettext for GUI |
Date: |
Sat, 30 Nov 2024 11:57:44 +0100 |
Dmitrij Zotov wrote:
> This page raises the question and the solution (
> https://ftp.gnu.org/old-gnu/Manuals/glibc-2.2.3/html_chapter/libc_8.html#SEC136
> ).
>
> But, you can also use the concept of sections. To get a message with
> multiple context translations, you can call the function with an additional
> argument - the name of the section, which can play the role of context. A
> translation file with messages may contain several versions of the
> translation under section names. The translation in the main section can be
> obtained in the usual way, without any additional argument. This means not
> all messages, but only the necessary messages. In one section there is
> usually one, or several messages.
>
> For example,
>
> #volume=menu|file
> Open...=
> Close=
>
> #volume=
> Open...=
> Close=
>
> . The untitled section is the main (here is the second one) one.
The solution that you propose is nearly identical to the solution presented
in the glibc documentation.
The only relevant difference is the notion of "sections". Which makes your
proposal worse than the one from the glibc documentation: It relies on the
order of the messages, that is, breaks down when the messages are reordered,
merged from several files or similar.
Bruno