Skip to content

Commit 9b4b001

Browse files
committed
chore(i18n): fix lint issues
1 parent bc1e314 commit 9b4b001

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

packages/i18n/src/constants/TranslationBundleConstants.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,22 @@ import {en_US} from '../translations';
3030
* const locales = TranslationBundleConstants.DEFAULT_LOCALES;
3131
* ```
3232
*/
33-
const TranslationBundleConstants = {
34-
/**
35-
* Default locale code used as fallback when no specific locale is provided.
36-
*/
37-
FALLBACK_LOCALE: en_US.metadata.localeCode,
38-
33+
const TranslationBundleConstants: {
34+
DEFAULT_LOCALES: string[];
35+
FALLBACK_LOCALE: string;
36+
} = {
3937
/**
4038
* List of default locales bundles with the SDKs.
4139
*
4240
* Current default locales:
4341
* - `en-US` - English (United States)
4442
*/
4543
DEFAULT_LOCALES: [en_US.metadata.localeCode],
44+
45+
/**
46+
* Default locale code used as fallback when no specific locale is provided.
47+
*/
48+
FALLBACK_LOCALE: en_US.metadata.localeCode,
4649
} as const;
4750

4851
export default TranslationBundleConstants;

packages/i18n/src/translations/en-US.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
/* eslint-disable sort-keys */
20+
/* eslint-disable @typescript-eslint/naming-convention */
2021

2122
import {I18nTranslations, I18nMetadata, I18nBundle} from '../models/i18n';
2223

packages/i18n/src/utils/getDefaultI18nBundles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ const getDefaultI18nBundles = (): Record<string, I18nBundle> => {
3131
const bundles: Record<string, I18nBundle> = {};
3232

3333
// Iterate through supported locales and build bundles dynamically
34-
TranslationBundleConstants.DEFAULT_LOCALES.forEach(localeCode => {
34+
TranslationBundleConstants.DEFAULT_LOCALES.forEach((localeCode: string) => {
3535
// Convert locale code to translation module key (e.g., 'en-US' -> 'en_US')
36-
const moduleKey = localeCode.replace('-', '_') as keyof typeof translations;
36+
const moduleKey: string = localeCode.replace('-', '_') as keyof typeof translations;
3737

3838
// Get the translation bundle from the translations module
39-
const bundle = translations[moduleKey] as I18nBundle;
39+
const bundle: I18nBundle | undefined = translations[moduleKey] as I18nBundle;
4040

4141
if (bundle && bundle.metadata?.localeCode) {
4242
bundles[bundle.metadata.localeCode] = bundle;

0 commit comments

Comments
 (0)