dtext 1.0.0
Tool for text internationalization inspired from GNU gettext.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
Library provides functions to handle localization. Translated string is searched in special files with .lang extention by exact matching with original string.
Lang files are loaded in memory at program start up from current directory. Additional localizations can be loaded with loadLocaleFile function.
Example:
import std.stdio, std.opt;
void main(string[] args)
{
string locale;
getopt(args,
"l|lang", &locale);
defaultLocale = locale;
writeln(dtext("Hello, world!"));
}
If text for translation cannot be found in specified locale name, the text will be saved and written down to a special fuzzy texts file at program shutdown. That should help to add new localization fast and without program recompilation.
TODO:
- Load localization files on demand;
- Add ability to unload unused locales;
- Add ability to bind texts for arbitrary values (оbjects names, descriptions).
- Registered by Anton Gushcha
- 1.0.0 released 11 years ago
- NCrashed/dtext
- github.com/NCrashed/dtext
- Boost Software License - Version 1.0
- Copyright © 2013, Gushcha Anton
- Authors:
- Dependencies:
- none
- Versions:
-
1.0.1 2013-Oct-12 1.0.0 2013-Oct-10 ~master 2013-Oct-12 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
244 downloads total
-
- Score:
- 1.0
- Short URL:
- dtext.dub.pm