adamduncan / eleventy-plugin-i18n

Eleventy plugin to assist with internationalization and dictionary translations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

contextLocale from url fails to match key in translations due to case sensitivity

b3rimbau opened this issue · comments

The translation dictionary src/_data/i18n/index.js uses mixed case lookup keys like 'es-ES', but the lookup is being made on the contextLocale that is based on the (lowercase) path value 'es-es' and is consequently failing.

The result is that the i18n filter is falling back to fallbackLocale 'en-GB' which means that nothing using the filter is getting translated - see your own demo at https://eleventy-plugin-i18n-demo.netlify.app/ar-ae/ where both the header navigation ("Homepage", "Posts") and footer language selector labels ("Select language") are all in English.