A simple but hopefully complete Ada wrapper around gettext. It should run on linux and windows. Don't know for other OSes.
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.
You can choose between:
- Standard names used in C language:
gettext,ngettext,pgettext,dgettext… - More readable Ada names:
Get_Text,Get_Plural_Text,Get_Text_With_Context…
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 -- '.
Github is not my main development forge, but only a mirror of a selfhosted forgejo.