bug-gettext
[Top][All Lists]
Advanced

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

Re: Using gettext for GUI


From: Дмитрий Зотов
Subject: Re: Using gettext for GUI
Date: Sun, 1 Dec 2024 07:42:40 +0200

Yes, I understand.

I can also add that in the case of sections, it is already possible to add a universal function, rather than using a wrapper on the user side.

Something similar is already used (I think, I don't remember exactly) in php.ini libraries and Java Properties files, and maybe even in Java MessageBundles.

It is also unclear what works faster in the case where the translation string is present (one would expect this to be the case most often).

Thank you for your attention and for noticing the natural, but not noticed by me, properties of using sections in files! Bye.

Sat, 30 Nov 2024 12:57 Bruno Haible <bruno@clisp.org>:
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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]