vg4->mlang->add()
Add multilanguage entries from files beneath a directory.
SYNTAX
VG_BOOL
vg4->mlang->add(const char *pdir)
FUNCTION PARAMETERS
pdir | Directory containing multilanguage files |
RETURN VALUE
Returns boolean:
- VG_TRUE: Added
- VG_FALSE: Not added
DESCRIPTION
Add multilanguage entries from files beneath a directory.
The directory pdir must contain
- subdirectories with name of locales (lowercase), e.g. en, de
- these subdirectories must contain
- subdirectories with name of a scope
- these subdirectories must contain
- files with multilanguage text for this locale and scope
E.g. for pdir = mlangdir and scope = intro
the pathes for all supported languages are:
- mlangdir/en/intro/
- mlangdir/de/intro/
- [...]
A multilanguage file must contain for each multilanguage text
- a line with a key, enclosed in double brackets: [[ <key> ]]
- one or more lines with text (may contain text-control-commands)
Example:
- mlangdir/en/intro/file1.mlang:
[[cat_kick]]
Don't kick the cat, you dude!
[[my_home]]
Where is my home?
I have lost the way to %{txt[bold=yes]: nowhere%}.
In this example the call for vg4->mlang->get("intro", "cat_kick")
would return for the english locale: "Don't kick the cat, you dude!"
SEE ALSO