mirror of https://github.com/apache/nifi.git
[NIFI-9623] - Attempt to look up messages locale file without country designation if it fails to find it with the country designation
Signed-off-by: Nathan Gough <thenatog@gmail.com> This closes #5707.
This commit is contained in:
parent
ce66cf41e2
commit
8d143e8367
|
@ -60,7 +60,27 @@ if (!locale || locale === 'en-us') {
|
|||
}
|
||||
bootstrapModule();
|
||||
}).fail(function () {
|
||||
bootstrapModule();
|
||||
// was this a country specific locale? if so, try to get the generic version of the language
|
||||
const localeTokens = locale.split('-');
|
||||
if (localeTokens.length === 2) {
|
||||
translationFile = 'locale/messages.' + localeTokens[0] + '.xlf';
|
||||
$.ajax({
|
||||
url: translationFile,
|
||||
dataType: 'text'
|
||||
}).done(function (translations) {
|
||||
// add providers if translation file for locale is loaded
|
||||
if (translations) {
|
||||
providers.push({provide: TRANSLATIONS, useValue: translations});
|
||||
providers.push({provide: TRANSLATIONS_FORMAT, useValue: 'xlf'});
|
||||
providers.push({provide: LOCALE_ID, useValue: localeTokens[0]});
|
||||
}
|
||||
bootstrapModule();
|
||||
}).fail(function () {
|
||||
bootstrapModule();
|
||||
});
|
||||
} else {
|
||||
bootstrapModule();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue