A comprehensive internationalization (i18n) library for Lua with pluralization, interpolation, and locale fallbacks.
i18n.lua is an internationalization library for Lua that enables developers to add multi-language support to their applications. It handles translation management, variable interpolation, and complex pluralization rules based on Unicode CLDR standards. The library simplifies locale switching and provides robust fallback mechanisms for missing translations.
Lua developers building applications that require localization, such as games, desktop tools, or embedded systems needing multi-language interfaces.
Developers choose i18n.lua for its comprehensive feature set, adherence to internationalization standards, and lightweight design. It offers a more complete solution compared to basic Lua i18n approaches, with built-in pluralization, flexible interpolation, and easy file-based translation management.
A very complete i18n lib for Lua
Implements Unicode CLDR rules for locale-aware pluralization, as shown in the Russian example with 'one', 'few', 'many' forms, ensuring standard compliance for complex languages.
Supports three interpolation styles: named variables (%{name}), traditional Lua formatting (%d %s), and combined formats, demonstrated in the interpolation examples for versatile string handling.
Automatically falls back through locale ancestry (e.g., en-US to en) and a configurable default locale, as described in the fallbacks section, reducing missing translation errors.
Allows loading translations from individual or consolidated files via loadFile, facilitating easy organization and updates, as illustrated in the language file examples.
Fallback mechanism only works with hyphen-separated locales; the README explicitly states other separators like underscores or spaces are not supported, limiting compatibility with non-standard formats.
Translations must be loaded from files with no built-in support for dynamic sources like databases or APIs, making real-time updates cumbersome without manual reloading.
Requires manual file creation and loading for each language, lacking automation or GUI tools, which can increase initial setup time for large projects.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.