adamduncan / eleventy-plugin-i18n

Eleventy plugin to assist with internationalization and dictionary translations
MIT License
103 stars 10 forks source link

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

Open b3rimbau opened 7 months ago

b3rimbau commented 7 months ago

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.