Prefix preferred system locales with l10n_util logic
This commit is contained in:
parent
e51f582bfb
commit
ab7ab91429
2 changed files with 12 additions and 4 deletions
|
@ -55,8 +55,8 @@ export function load({
|
|||
preferredSystemLocales: Array<string>;
|
||||
logger: Pick<LoggerType, 'error' | 'warn' | 'info'>;
|
||||
}): LocaleType {
|
||||
if (preferredSystemLocales.length === 0) {
|
||||
throw new TypeError('`appLocale` is required');
|
||||
if (preferredSystemLocales == null) {
|
||||
throw new TypeError('`preferredSystemLocales` is required');
|
||||
}
|
||||
|
||||
if (!logger || !logger.error) {
|
||||
|
@ -66,6 +66,10 @@ export function load({
|
|||
throw new TypeError('`logger.warn` is required');
|
||||
}
|
||||
|
||||
if (preferredSystemLocales.length === 0) {
|
||||
logger.warn('`preferredSystemLocales` was empty');
|
||||
}
|
||||
|
||||
const english = getLocaleMessages('en');
|
||||
|
||||
for (const locale of preferredSystemLocales) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue