[Top][All Lists]

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

[GNUnet-developers] Make applications localizable

From: Alessio Vanni
Subject: [GNUnet-developers] Make applications localizable
Date: Sun, 01 Sep 2019 12:06:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Currently, gettext doesn't work for out-of-tree applications.  This is
because GNUnet forcibly set the text domain to "GNUnet" (which
apparently is also incorrect), so applications can't be localized unless
their localizations are distributed in-tree by GNUnet itself.

The attached patch tries to fix this by adding two more fields to
GNUNET_OS_ProjectData: one field is the gettext domain of the
application.  As the documentation says, if it's NULL gettext is
disabled so that applications can use their preferred localization
method without having gettext interfering; the other field is
essentially the locale directory, so applications can specify a
different path if they want to, instead of having GNUnet infer it for

Because some GNUnet libraries also use gettext internally (the util lib
is a prominent example), gettext has to be initialized before the
application takes over.  I placed such initialization in
`GNUNET_OS_init' and `GNUNET_OS_project_data_get' because those are two
functions which are very likely to be called (especially the second one,
since it's used in `GNUNET_PROGRAM_run2'.)  If there is a better place
(or some places where this is not enough) I can change it and resubmit
it for review.

I also changed gnunet-ext to keep it consitent with the patch.  In
particular, it adds a header which is required for a successful
compilation, so you might want to at least make that change.

Thank you,

P.S. I'm still not subscribed to the list... yet.

Attachment: 0001-Improve-how-gettext-is-used.patch
Description: Patch for GNUnet

Attachment: 0001-Add-missing-header-and-set-new-gettext-fields-in-pro.patch
Description: Patch for gnunet-ext

reply via email to

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