gatsby-plugin-i18n icon indicating copy to clipboard operation
gatsby-plugin-i18n copied to clipboard

getValidLangKey erroneously assumes some paths to be specific languages

Open alexej-d opened this issue 4 years ago • 0 comments

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.

alexej-d avatar Jun 30 '20 10:06 alexej-d