summaryrefslogtreecommitdiff
path: root/documentation
diff options
context:
space:
mode:
authorMatthias Melcher <git@matthiasm.com>2021-12-19 01:09:13 +0100
committerMatthias Melcher <github@matthiasm.com>2021-12-19 02:03:05 +0100
commit29531873ea4395a2dc65cefcc28db09569c38c18 (patch)
tree97ae97c7b7f798c11fd291a0e2cc6bfb27e32b8a /documentation
parent5438954d8c6213f1b0cc9d23b70ffaae388e1d60 (diff)
STR 3289: Fluid i18n, gettext, catguts improvements
Removed some unneeded code.
Diffstat (limited to 'documentation')
-rw-r--r--documentation/src/fluid-gettext.pngbin4369 -> 32267 bytes
-rw-r--r--documentation/src/fluid.dox26
2 files changed, 21 insertions, 5 deletions
diff --git a/documentation/src/fluid-gettext.png b/documentation/src/fluid-gettext.png
index 83030626b..f961c6929 100644
--- a/documentation/src/fluid-gettext.png
+++ b/documentation/src/fluid-gettext.png
Binary files differ
diff --git a/documentation/src/fluid.dox b/documentation/src/fluid.dox
index fd4cf4a38..b0682be9b 100644
--- a/documentation/src/fluid.dox
+++ b/documentation/src/fluid.dox
@@ -1503,8 +1503,10 @@ existing template, and click "Delete Template".
\section fluid_i18n Internationalization with FLUID
FLUID supports internationalization (I18N for short) of label
-strings used by widgets. The preferences window
-(<tt>Ctrl+p</tt>) provides access to the I18N options.
+strings and tooltips used by widgets. The GNU gettext option also
+supports deferred translation of statically initialised menu item
+labels. The preferences window (<tt>Ctrl+p</tt>) provides access
+to the I18N options.
\subsection fluid_i18n_methods I18N Methods
@@ -1530,10 +1532,10 @@ need to call \p setlocale() and \p textdomain() or
message file.
To use GNU gettext for I18N, open the preferences window and
-choose "GNU gettext" from the \b Use: chooser. Two new input
+choose "GNU gettext" from the \b Use: chooser. Four new input
fields will then appear to control the include file and
-function/macro name to use when retrieving the localized label
-strings.
+function/macro names to use when retrieving localized label
+strings in dynamic allocation and static initialisation.
\image html fluid-gettext.png "Internationalization using GNU gettext"
\image latex fluid-gettext.png "Internationalization using GNU gettext" width=10cm
@@ -1543,10 +1545,24 @@ field controls the header file to include for
I18N; by default this is \b <libintl.h>, the
standard I18N file for GNU gettext.
+If the \b Conditional: field contains a macro name, i18n will only be compiled
+into the product if this macro is defined. The build system should define the
+macro only if all required headers and libraries are available. If the macro
+is not defined, no headers are included and `gettext` passes text through
+untranslated.
+
The \b Function: field controls the function (or macro) that
will retrieve the localized message; by default the
\p gettext function will be called.
+The **Static Function:** field names a macro that will mark static text
+fields for extraction with the `xgettext` tool. The default macro name is
+\p gettext_noop and will be defined as `#define gettext_noop(text) text`
+right after the `#include` statement. Fluid will do its best to call
+`gettext` on static texts after the textdomain was set by the user.
+
+\see [GNU gettext special cases](https://www.gnu.org/software/gettext/manual/html_node/Special-cases.html)
+
\subsection fluid_catgets_i18n Using POSIX catgets for I18N
FLUID's code support for POSIX catgets allows you to use a