Class mc
Simple translation class in the style of gettext.
You can actually use gettext tools to process these files. For example, to create/update a message catalogue use:
xgettext --no-wrap [-j] [-o file]
Where -j is used to join an existing catalague. -o file is the output file.
Basic usage:
- mc::load("messages.po|messages.ini");
- mc::plugin_init($plugin,$plugin->getFile());
- mc::_("string to translate\n")
- mc::_("string to translate %1% %2%\n",$arg1,$arg2)
- mc::n(mc::_("singular form"),mc::_("Plural form"),$count)
public static
str
|
|
public static
str
|
|
public static
integer|false
|
#
plugin_init( Plugin $plugin, str $path )
Load a message file for a PocketMine plugin. Only uses .ini files. |
public static
integer|false
|
public static
str[]
|
$txt
$txt Message translations |
#
[]
|