Internationalization support and format strings
Bruno Haible
bruno at clisp.org
Mon Mar 24 22:39:11 UTC 2025
Hi,
The GNU gettext package contains tools for internationalization,
enabling a programmer to make their package "speak" to the users
in their specific language.
GNU gettext so far supports a number of programming languages, see
https://www.gnu.org/software/gettext/manual/html_node/List-of-Programming-Languages.html
I thought it would be a good idea to make GNU gettext support
also the D programming language. This is a registered wish list
item since 2017: https://savannah.gnu.org/bugs/?51291 . On the D
side, a rudimentary interface to the gettext() function in the
GNU C library exists as well:
https://code.dlang.org/packages/libintl
I am now trying to implement this support. I am already done with
the xgettext support (parsing D source code and extracting
messages). But from the programming language, this support also
needs format strings with positions (so that translators can
reorder arguments in their translations of format strings).
D has format strings in its standard library (phobos):
https://dlang.org/library/std/format.html
But this format string facility has 4 major bugs:
https://github.com/dlang/phobos/issues/10699
https://github.com/dlang/phobos/issues/10711
https://github.com/dlang/phobos/issues/10712
https://github.com/dlang/phobos/issues/10713
Two questions:
1) How can this be, that a programming language that is more than
20 years old and that is integrated into GCC for 6 years, has a
format string facility that is riddled with bugs? Is D only a
playground for compiler hackers and not used for real
applications, and thus the standard library is "uninteresting"?
2) How should I continue? What advice would you give me? Should I
wait until the format string bugs are fixed (and if so, in which
time frame)? Or should I cancel the GNU gettext support for D ?
Best regards. I don't want to offend anyone. If you feel an
offense, please excuse it with frustration on my side.
More information about the Digitalmars-d
mailing list