Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

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

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Elixir
  3. gettext

gettext

Apache-2.0Elixir

An internationalization (i18n) and localization (l10n) system for Elixir applications, implementing the standard Gettext framework.

Visit WebsiteGitHubGitHub
491 stars91 forks0 contributors

What is gettext?

Gettext is an internationalization (i18n) and localization (l10n) library for Elixir that enables developers to build multilingual applications. It implements the widely-used Gettext standard, providing tools for message extraction, translation file management, and pluralization. The library solves the problem of maintaining readable source code while supporting multiple languages through a standardized workflow.

Target Audience

Elixir developers building applications that need to support multiple languages, particularly those who value established i18n standards and tooling. It is also suitable for translators who work with .po files using tools like Poedit.

Value Proposition

Developers choose Gettext for its macro-based API that keeps source code readable with literal strings, unlike path-based translation systems. It offers a robust ecosystem with automatic message extraction and merge workflows, reducing manual maintenance and leveraging the portable .po file format familiar to translators.

Overview

Internationalization and localization support for Elixir.

Use Cases

Best For

  • Building Elixir web applications that require support for multiple languages and locales.
  • Automating the extraction and merging of translation strings from source code into .pot and .po files via mix tasks.
  • Managing pluralization and domain-based message organization in multilingual Elixir projects.
  • Integrating with existing translator workflows using standard .po files and tools like Poedit or poeditor.com.
  • Maintaining readable source code with string-based translations instead of path-based keys.
  • Implementing the Gettext standard in Elixir to leverage its established tooling and community practices.

Not Ideal For

  • Projects requiring real-time translation updates without server restarts, as Gettext relies on compiled .po files that need regeneration.
  • Teams preferring key-based translation systems for better code organization and static analysis, as Gettext uses string literals.
  • Applications with highly dynamic content where translations are sourced from external APIs or databases, due to its file-based storage.
  • Simple prototypes or microservices where the overhead of backend setup and mix tasks is disproportionate to i18n needs.

Pros & Cons

Pros

Readable String Literals

The macro-based API uses `gettext("literal string")` instead of path keys, keeping source code clear and readable, as emphasized in the README for maintaining developer experience.

Standardized Translator Workflow

Leverages portable .po files, a well-established format compatible with tools like Poedit, simplifying collaboration with translators and reducing workflow friction.

Automated Extraction and Merge

Provides mix tasks like `mix gettext.extract` and `mix gettext.merge` to automatically sync messages from code to .pot and .po files, reducing manual maintenance errors.

Pluralization and Domain Support

Handles plural forms with `ngettext` and organizes messages into domains via `dgettext`, offering structured translation management for complex applications.

Cons

File-Based Storage Limitations

Translations are stored in .po files, which can be cumbersome for applications needing dynamic updates or database integration without additional tooling or workarounds.

Setup and Workflow Complexity

Requires defining a backend module and managing multiple mix commands for extraction and merging, which adds overhead compared to simpler, inline i18n solutions.

Limited Runtime Flexibility

Since translations are compiled from files, changing languages on the fly without reloading or recompiling can be challenging, unlike in-memory or API-driven systems.

Frequently Asked Questions

Quick Stats

Stars491
Forks91
Contributors0
Open Issues6
Last commit1 month ago
CreatedSince 2015

Tags

#elixir-lang#elixir#gettext#l10n#internationalization#multilingual#mix-tasks#i18n#elixir-library#localization#translation

Built With

E
Elixir
M
Mix

Links & Resources

Website

Included in

Elixir13.1k
Auto-fetched 1 day 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