mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Handle scenario when the user preferred language header is not passed
The UI when loading asks i18n plugin which language translation to use depending on the user preferred language header 'accept-language'. This commit is to handle scenario where header is not passed. The algorithm then chooses the default language.
This commit is contained in:
parent
5f61475ad5
commit
9fbe6d5fcd
1 changed files with 5 additions and 0 deletions
|
@ -145,6 +145,11 @@ function translate(key) {
|
|||
async function getTranslationLanguage(acceptLanguages) {
|
||||
let langStr = '';
|
||||
let foundLang = false;
|
||||
|
||||
if (acceptLanguages === null || acceptLanguages.length <= 0) {
|
||||
return DEFAULT_LANGUAGE;
|
||||
}
|
||||
|
||||
const acceptLangsLen = acceptLanguages.length;
|
||||
const registeredLanguages = await i18nPlugin.getRegisteredTranslationLanguages();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue