gatsby-plugin-i18n
gatsby-plugin-i18n copied to clipboard
getValidLangKey erroneously assumes some paths to be specific languages
Take for example a configuration, were the languages en and de are defined and for pages with the en language there should be no lang code in the url:
{ resolve: 'gatsby-plugin-i18n', options: { prefixDefault: false, langKeyDefault: 'en', useLangKeyLayout: false, } }
In this case getValidLangKey
wouldn't correctly work with urls like /destinations
because those are assumed to be languages (the language de in this case). Setting prefixDefault
to true
would fix this, but makes it impossible to use a default language without the lang code url path.