Localization Support in Core

:wave: Hello Jekyllers!!

The Jekyll Team is actively considering Core support for Localization of sites from Jekyll 4.0. To that end, I’m developing a jekyll-plugin called jekyll-locale.

Currently, my plan is to:

  • carve out an acceptable implementation
  • Create a Pull Request to Jekyll Core to accomplish (either of) the following:
    • Have the plugin bundled with Core like jekyll-watch and jekyll-sass-converter
    • Have the Core provide the required API to use the plugin without patching existing Core classes

jekyll-locale-0.2.0 currently provides a basic set of functionality:

  • A global Liquid object {{ locale }} to aid translating strings based on client-side definitions.
  • Every {{ page }} Liquid Object is aware of “its locale” via the {{ page.locale }} attribute.
  • A generator instance that duplicates every page or document set to write and renders them for every locale listed as an available_locale in the config file.

@Frank from the Core Team has suggested the following:

  • Instead of duplicating every page or document in the site and hamper performance, consider the use of a “special directory” labelled as _i18n to determine what page / document needs to be re-rendered into multiple supported locales
    (I personally like this suggestion albeit considering the use of _locales directory instead)


Now, I’m turning to the community to provide some additional inputs on how best to achieve our goal:

  • As an end-user of the feature, what are your expectations from the feature…?
  • As a provider of the feature (via theme-development) what are your expectations from the feature…?

You’re welcome to either leave your comments here or as an issue at the repository.
Thank you for your time and inputs

Cheers,
@ashmaroli

4 Likes

Shipped a v0.3.0 with some API changes and enhancements

1 Like