source
gettext
25.9.3A wrapper library for gettext
25.9.3
A simple but hopefully complete Ada wrapper around gettext. It should run on linux and windows. Don't know for other OSes.
How to use
Before calling the gettext family translation functions:
- You must set the locale using
Gettexts.Locale.Set_Locale(even a call with no arguments is enough but required). - You should set the directory and the domain name with
Gettexts.Set_Domain_DirectoryandGettexts.Set_Domain_Name. - You should set the codeset with
Gettexts.Set_Domain_Codeset.
Function names
You can choose between:
- Standard names used in C language:
gettext,ngettext,pgettext,dgettext, etc. - More readable Ada names:
Get_Text,Get_Plural_Text,Get_Text_With_Context, etc.
Limits
There's no support for Ada in
xgettext.
But if your code doesn't have unbalanced tick marks (like in 'Class), you
can still use it to produce and update .po files (see update.sh in example
directory). As a workaround, you can balance tick marks with comments -- '.