2023-03-14 15:55:31 +00:00
|
|
|
// Copyright 2023 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { config } from './config';
|
2023-04-20 21:23:19 +00:00
|
|
|
import { localeMessages } from './localeMessages';
|
2023-03-14 15:55:31 +00:00
|
|
|
import { setupI18n } from '../util/setupI18n';
|
|
|
|
import { strictAssert } from '../util/assert';
|
|
|
|
|
|
|
|
const { resolvedTranslationsLocale } = config;
|
|
|
|
strictAssert(
|
|
|
|
resolvedTranslationsLocale,
|
|
|
|
'locale could not be parsed from config'
|
|
|
|
);
|
|
|
|
strictAssert(
|
|
|
|
typeof resolvedTranslationsLocale === 'string',
|
|
|
|
'locale is not a string'
|
|
|
|
);
|
|
|
|
|
|
|
|
const i18n = setupI18n(resolvedTranslationsLocale, localeMessages);
|
|
|
|
|
|
|
|
export { i18n };
|