jekyll-l10n

jekyll-l10n is a Jekyll plugin that streamlines the localization of static websites using industry-standard GNU Gettext PO files. It extracts translatable strings from your site's HTML, organizes them into PO files for professional translation, and automatically applies translations to generate fully localized pages with locale-prefixed URLs.

Jekyll site localization

Installation

Add to your Jekyll site's Gemfile:

gem "jekyll-l10n", "~> 1.1"

Run bundle install, then enable in _config.yml:

plugins:
  - jekyll-l10n

defaults:
  - scope:
      type: "pages"
    values:
      with_locales: true
      with_locales_data:
        locales: ["es", "fr", "de"]
        locales_dir: "_locales"
        extract_on_build: true

Quick Example

Edit PO files in _locales/ with translations. On rebuild, your site will generate:

  • /es/ - Spanish pages
  • /fr/ - French pages
  • /de/ - German pages

Documentation

Complete documentation is available in the docs/ directory:

Key Features

  • Automatic extraction - Extract translatable strings during Jekyll builds
  • Professional workflows - Edit translations using standard Gettext tools (Poedit, Weblate, etc.)
  • Fallback modes - Display English, mark untranslated strings, or leave blank
  • Incremental builds - Skip regenerating unchanged localized pages for faster builds
  • Machine translation - Optional LibreTranslate integration for initial translations
  • Compendium files - Share common translations across your entire site

Requirements

  • Ruby: >= 2.7.0
  • Jekyll: >= 4.0, < 5.0

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request