Language specific content defined in your site.data directory will now be recursively merged together, so that active_lang content gets precedence over default_lang content, gets precedence over language non-specific content. (#59)
Still build unassigned files to the default_lang site root
If the default_lang is not defined in the languages, this ensures that language unassigned files (such as those excluded from localization) are still written out to the site root. (#65)
Performance improvements and fixes for i18n_headers tag
Document processing is now faster, and fixes were made to the i18n_headers for when the site.url is defined. (#67)
Custom keys for active_lang site payload
This allows custom keys to be defined with the active_lang, giving interoperability between polyglot and other plugins and themes. (#68)
A new version of Polyglot has been released! Give it a try!
gem install jekyll-polyglot
and list jekyll-polyglot among your listed gems in your _config.yml
It involves mostly groundwork to prepare for new features and better multilingual content management. It does have a new feature:
{% I18n_Headers %}
Put this tag with the url of your website in your head.html includes file to get the maximum SEO provided by having a multilingual website. It’s the same as the following liquid code:
<metahttp-equiv="Content-Language"content="{{site.active_lang}}"><linkrel="alternate"hreflang="{{site.default_lang}}"href="http://yoursite.com{{page.permalink}}"/>
{% for lang in site.languages %}
{% if lang == site.default_lang %}
{% continue %}
{% endif %}
<linkrel="alternate"hreflang="{{lang}}"href="http://yoursite.com/{{lang}}{{page.permalink}}"/>
{% endfor %}
In your header, but faster and cleaner! For more information, see the SEO page
After months of work and refinement, I am proud to present Polyglot: a i18n plugin for Jekyll sites that need to cater their content to multiple languages and audiences.
Features
While there are other multi-language plugins for Jekyll, Polyglot is special. Polyglot takes care of the typical cruftwork normally left to developers to manage (such as wrangling urls and ensuring consistent sitemaps) while providing efficient and simple tools Jekyll developers can utilize into SEO and fast-tracked content aggregation.
Relativized Links
In the past, a multi-language static site or blog had to keep delicate track of what language each relative link the site was serving. It was all too easy for a developer to stumble, and foreign language visitors would quickly get lost in untranslated content.
Polyglot automatically relativizes the urls for each language you want your site to build for. This allows website visitors to stay isolated on one language while browsing your website.
Fallback Support
When you don’t have translated or multilingual content, Jekyll will still build with the content you do have. When you do have translated or multilingual content, Jekyll will build using that content. Simple as that.
Sitemaps stay consistent across all languages, and translated stays in the site it was built for.
Rich Content Translation
Rich language content is normally hard to implement. Short strings or language dependent banners are typically hard for a Jekyll website to keep consistent.
Except when it’s this easy. In your config.yml, just store your strings as:
hello:en:Hello!es:¡hola!fr:Bonjour!de:Guten Tag!
and in your liquid, just call:
{{ site.hello[site.active_lang]}}
produces:
Fast, Asynchronous, Zero-Overhead Builds
Polyglot will build your multi-language website just as fast as it will build your default language website. Polyglot runs with a minimal overhead by simultaneously building all languages of your website as separate process. This means your website build time won’t be a function of how many languages you need to support.
Download
Polyglot is available as a gem, or as a Jekyll plugin. It can be installed with: