This document describes the modernized internationalization (i18n) system for the Missing Maps website, which uses Jekyll Polyglot to support multiple languages efficiently.
Last Updated: October 2025
Current Status: All languages fully translated and operational
- 65+ duplicate HTML files across 4 language directories (
/en/,/fr/,/es/,/cs/) - Manual URL parsing for locale detection
- Maintenance nightmare with code duplication
- 13 centralized templates in
/app/root directory - Automatic language generation by Jekyll Polyglot plugin
- Single source of truth for page structure
- Data-driven translations via
_data/{lang}.ymlfiles
| Language | Code | URL Pattern | Data File | Status | Translation Keys |
|---|---|---|---|---|---|
| English | en |
/ (root) |
_data/en.yml |
✅ Complete | 560+ |
| French | fr |
/fr/ |
_data/fr.yml |
✅ Complete | 560+ |
| Spanish | es |
/es/ |
_data/es.yml |
✅ Complete | 560+ |
| Czech | cs |
/cs/ |
_data/cs.yml |
✅ Complete | 560+ |
# Jekyll Polyglot Configuration
languages: ["en", "fr", "cs", "es"]
default_lang: "en"
exclude_from_localization: ["assets", "scripts", "styles", "images", "favicon.ico", "robots.txt", "humans.txt", "CNAME", "Process-1.svg"]
parallel_localization: true
plugins:
- jekyll-polyglotAll page templates are located in /app/ root:
index.html- Homepageabout.html- About pageadvanced.html- Advanced tutorialsbeginner.html- Beginner tutorialsblog.html- Blog listingcategories.html- Category viewevents.html- Events pagefield.html- Field mappinghost.html- Host pagemapswipe.html- MapSwipestatistics.html- Statisticstags.html- Tag viewvalidate.html- Validation
Jekyll Polyglot automatically sets the locale variable:
<!-- Polyglot automatically provides site.active_lang -->
{% assign locale = site.active_lang %}Translations are stored in YAML files under _data/:
Structure Example (_data/en.yml):
about:
title: "About"
who_we_are:
title: "Who we are"
text1: "Missing Maps is a project..."
objectives:
title: "Objectives"
text1: "To map areas where people live..."Usage in Templates:
<!-- Polyglot automatically provides locale -->
{% assign locale = site.active_lang %}
<h1>{{site.data[locale].about.title}}</h1>
<p>{{site.data[locale].about.who_we_are.text1}}</p>Updated to work with Jekyll Polyglot in _includes/header.html:
{% for lang in site.languages %}
{% if lang == site.default_lang %}
<a href="{{site.baseurl}}{{page.url | remove_first: '/' | remove_first: locale | prepend: '/'}}">
<div class="nav-item item-centered">{{lang}}</div>
</a>
{% else %}
<a href="{{site.baseurl}}/{{lang}}{{page.url | remove_first: '/' | remove_first: locale | prepend: '/'}}">
<div class="nav-item item-centered">{{lang}}</div>
</a>
{% endif %}
{% endfor %}npm run serve
# Builds site with Jekyll Polyglot and starts development servernpm run build
# Optimized build with SASS compression and asset optimization./test-multilingual.sh
# Runs comprehensive multilingual functionality testsJekyll Polyglot automatically generates:
_site/
├── index.html # English homepage
├── about/ # English about page
├── assets/ # Shared assets
├── fr/
│ ├── index.html # French homepage
│ ├── about/ # French about page
│ └── feed.xml # French RSS feed
├── es/
│ ├── index.html # Spanish homepage
│ ├── about/ # Spanish about page
│ └── feed.xml # Spanish RSS feed
└── cs/
├── index.html # Czech homepage
├── about/ # Czech about page
└── feed.xml # Czech RSS feed
- Incremental builds:
incremental: true - SASS compression:
style: compressed - Parallel localization:
parallel_localization: true - Liquid optimization:
strict_filters: true
node_modules/package.jsongulpfile.cjs.sass-cache/.jekyll-cache/
-
Add language code to
_config.yml:languages: ["en", "fr", "cs", "es", "de"] # Added German
-
Create translation file
_data/de.yml:about: title: "Über uns" # ... translations
-
Rebuild site: Jekyll Polyglot will automatically generate
/de/routes
-
Create template in
/app/:--- layout: default permalink: /newpage/ id: newpage --- {% assign locale = site.active_lang %} {% include header.html %} <h1>{{site.data[locale].newpage.title}}</h1> -
Add translations to all
_data/{lang}.ymlfiles:newpage: title: "New Page Title"
Language pages not generating:
- Check
languagesarray in_config.yml - Ensure page templates are in
/app/root, not subdirectories - Verify
jekyll-polyglotplugin is installed and listed
Translations not showing:
- Check that
localeis set via{% assign locale = site.active_lang %} - Verify translation keys exist in
_data/{lang}.yml - Ensure correct Liquid syntax:
{{site.data[locale].key}}
Build errors:
- Run
bundle exec jekyll build --tracefor detailed error info - Check for YAML syntax errors in
_data/files - Verify all required translations exist for each language
# Full build with error details
bundle exec jekyll build --trace
# Test translations
./test-multilingual.sh
# Check generated structure
ls -la _site/*/
# Verify specific language content
grep "feature-header" _site/fr/about/index.htmlThe Czech (cs) translation has been fully completed with comprehensive coverage:
- 560+ translation keys fully translated
- Professional quality translations for humanitarian mapping context
- Complete GDPR compliance in Czech language
- Validation guides with detailed FAQ and instructions
- Mapathon materials with hosting checklists and procedures
- Technical accuracy for mapping terminology
- All translations maintain consistency with humanitarian mapping terminology
- Czech translations include proper diacritics and grammar
- Technical terms (OSM, JOSM, MapSwipe) appropriately localized
- Cultural adaptation for Czech-speaking communities
Each language file (_data/{lang}.yml) contains 560+ organized sections:
# Image accessibility
img-alt: { ... } # 45+ image descriptions
# Navigation and core content
nav: { ... } # Menu structure
banner: { ... } # Homepage content
how_we_work: { ... } # Process explanations
# Educational content
beginner: { ... } # Step-by-step tutorials
advanced: { ... } # JOSM and advanced mapping
field: { ... } # Field mapping guidance
checker: { ... } # Validation comprehensive FAQ
# Event management
host: { ... } # Mapathon hosting guides
events: { ... } # Event management
# GDPR compliance
gdpr: { ... } # Privacy policy, cookie consent
# Blog and metadata
blog: { ... } # Blog navigation, pagination
months: [ ... ] # Date localizationFor issues or questions:
- Check this documentation
- Run test suite:
./test-multilingual.sh - Review Jekyll Polyglot docs: https://github.com/untra/polyglot
- Check build logs for specific errors
Last updated: October 2025 System version: Jekyll Polyglot v1.11.0