Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Lua
  3. i18n.lua

i18n.lua

MITLua

A comprehensive internationalization (i18n) library for Lua with pluralization, interpolation, and locale fallbacks.

GitHubGitHub
271 stars33 forks0 contributors

What is i18n.lua?

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.

Target Audience

Lua developers building applications that require localization, such as games, desktop tools, or embedded systems needing multi-language interfaces.

Value Proposition

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.

Overview

A very complete i18n lib for Lua

Use Cases

Best For

  • Adding multi-language support to Lua-based games or applications
  • Managing translations with complex pluralization rules (e.g., Slavic languages)
  • Implementing locale fallback chains for missing translations
  • Loading translations from external files for easier maintenance
  • Handling variable interpolation in localized strings
  • Building Lua projects that require Unicode CLDR-compliant i18n

Not Ideal For

  • Applications requiring dynamic, database-driven translation updates without file reloading
  • Projects using locale formats with separators other than hyphens (e.g., underscores or spaces) for fallback ancestry
  • Teams seeking integrated GUI tools or automated translation management within the library
  • Simple Lua scripts with single-language support that don't need pluralization or complex fallbacks

Pros & Cons

Pros

CLDR Pluralization Support

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.

Flexible Interpolation Methods

Supports three interpolation styles: named variables (%{name}), traditional Lua formatting (%d %s), and combined formats, demonstrated in the interpolation examples for versatile string handling.

Robust Locale Fallbacks

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.

File-Based Translation Management

Allows loading translations from individual or consolidated files via loadFile, facilitating easy organization and updates, as illustrated in the language file examples.

Cons

Hyphen-Only Locale Support

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.

Static File Dependency

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.

Manual Setup Overhead

Requires manual file creation and loading for each language, lacking automation or GUI tools, which can increase initial setup time for large projects.

Frequently Asked Questions

Quick Stats

Stars271
Forks33
Contributors0
Open Issues5
Last commit3 years ago
CreatedSince 2012

Tags

#internationalization#locale#pluralization#i18n#unicode-cldr#localization#lua-library#lua#translation

Built With

b
busted
L
Lua

Included in

Lua4.5k
Auto-fetched 1 day ago

Related Projects

inspect.luainspect.lua

Human-readable representation of Lua tables

Stars1,528
Forks200
Last commit4 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub