A virion for localization.
Features:
- Translations of the same locale can be split into different files to favour user-side editing
- Flexible message grouping
- Argument substitution by name No more confusing
{$1}
! - Argument validation
- Argument defaults and cross-fallbacks
- Advanced argument types, including:
list
: argument accepts an array and implodes according to the delimiter defined by the translationquantity
: argument accepts a number, and it affects the following words according to the locale's custom plural rules- The developer can define custom argument types
- Message substitution (include a message in another message)
- Color stacking (after message substitution, the original color can be restored if changed)
- Human-readable color/format codes, e.g.
%{error}
,%{hl1}
,%{b}
, actual color can be changed
- Human-readable color/format codes, e.g.
- Optional versioning to ignore outdated translations
- Message ID constant class generator (CLI tool that automatically creates a PHP class/interface declaring constants for message IDs, so you can reference them from PHP code with your IDE checking for typos)
- A PhpStorm plugin for editing libglocal lang files: https://github.com/SOF3/libglocal-idea-plugin
See en_US.lang for example syntax.
lang
/locale
: human languagelanguage
: programming languagemessage
: something that can be translatedtranslation
: the translation of a message in a specific locale
Libglocal is a virion. The Official Poggit Virion Documentation contains instructions for including a virion into your plugin.
See this document: Guide for developers, translators and server owners