From 35e1dbcd4e0b648bd13fbd972719ecb6489822d3 Mon Sep 17 00:00:00 2001 From: mikasackermn Date: Mon, 4 Nov 2024 07:30:57 +0000 Subject: [PATCH] feat: add more languages to widget --- lingui.config.ts | 40 +++++++++- scripts/crowdin/command.mjs | 2 + scripts/crowdin/utils.mjs | 1 + widget/embedded/src/constants/languages.ts | 74 ++++++++++++++++--- widget/playground/src/constants/languages.ts | 57 +++++++++++--- .../storybook/src/components/Flags/index.ts | 28 +++++++ widget/ui/src/components/Flags/Catalonia.tsx | 31 ++++++++ widget/ui/src/components/Flags/Cyprus.tsx | 32 ++++++++ widget/ui/src/components/Flags/Denmark.tsx | 31 ++++++++ widget/ui/src/components/Flags/Hungary.tsx | 29 ++++++++ widget/ui/src/components/Flags/India.tsx | 29 ++++++++ widget/ui/src/components/Flags/Korea.tsx | 32 ++++++++ widget/ui/src/components/Flags/Lithuania.tsx | 29 ++++++++ widget/ui/src/components/Flags/Pakistan.tsx | 29 ++++++++ .../ui/src/components/Flags/Philippines.tsx | 30 ++++++++ .../ui/src/components/Flags/SaudiArabia.tsx | 29 ++++++++ widget/ui/src/components/Flags/Serbia.tsx | 41 ++++++++++ widget/ui/src/components/Flags/Slovakia.tsx | 42 +++++++++++ .../ui/src/components/Flags/SouthAfrica.tsx | 35 +++++++++ widget/ui/src/components/Flags/Swahili.tsx | 46 ++++++++++++ widget/ui/src/components/Flags/index.ts | 28 +++++++ .../components/I18nManager/I18nManager.tsx | 60 ++++++++++++--- 22 files changed, 724 insertions(+), 31 deletions(-) create mode 100644 widget/ui/src/components/Flags/Catalonia.tsx create mode 100644 widget/ui/src/components/Flags/Cyprus.tsx create mode 100644 widget/ui/src/components/Flags/Denmark.tsx create mode 100644 widget/ui/src/components/Flags/Hungary.tsx create mode 100644 widget/ui/src/components/Flags/India.tsx create mode 100644 widget/ui/src/components/Flags/Korea.tsx create mode 100644 widget/ui/src/components/Flags/Lithuania.tsx create mode 100644 widget/ui/src/components/Flags/Pakistan.tsx create mode 100644 widget/ui/src/components/Flags/Philippines.tsx create mode 100644 widget/ui/src/components/Flags/SaudiArabia.tsx create mode 100644 widget/ui/src/components/Flags/Serbia.tsx create mode 100644 widget/ui/src/components/Flags/Slovakia.tsx create mode 100644 widget/ui/src/components/Flags/SouthAfrica.tsx create mode 100644 widget/ui/src/components/Flags/Swahili.tsx diff --git a/lingui.config.ts b/lingui.config.ts index 09c092af4b..37c3246a92 100644 --- a/lingui.config.ts +++ b/lingui.config.ts @@ -1,6 +1,42 @@ /** @type {import('@lingui/conf').LinguiConfig} */ module.exports = { - locales: ['en', 'es', 'ja', 'fr', 'pt', 'zh', 'ru', 'de', 'uk', 'sv', 'fi', 'nl', 'el', 'it', 'pl'], + locales: [ + 'af', + 'ar', + 'bn', + 'ca', + 'da', + 'de', + 'el', + 'en', + 'es', + 'fi', + 'fil', + 'fr', + 'hi', + 'hu', + 'id', + 'it', + 'ja', + 'ko', + 'lt', + 'ms', + 'nl', + 'pl', + 'pt', + 'ru', + 'sk', + 'sr', + 'sv', + 'sw', + 'th', + 'tr', + 'uk', + 'ur', + 'vi', + 'zh-CN', + 'zh-TW', + ], sourceLocale: 'en', format: 'po', catalogs: [ @@ -8,7 +44,7 @@ module.exports = { path: '/translations/{locale}', include: ['/widget/embedded/src', '/widget/ui/src'], exclude: ['**/node_modules/**'], - } + }, ], rootDir: '.', }; diff --git a/scripts/crowdin/command.mjs b/scripts/crowdin/command.mjs index 38259de78a..1e939194d8 100644 --- a/scripts/crowdin/command.mjs +++ b/scripts/crowdin/command.mjs @@ -1,4 +1,5 @@ import { PROJECT_ID, TOKEN } from "./constants.mjs"; +import { CrowdinError } from "../common/errors.mjs"; import { checkPreTranslateStatus, getLanguageIds, @@ -7,6 +8,7 @@ import { sendPreTranslateRequest } from "./pretranslate.mjs"; + const preTranslationOption = { method: 'mt', autoApproveOption: 'all', diff --git a/scripts/crowdin/utils.mjs b/scripts/crowdin/utils.mjs index f4c72058c8..07121e8d67 100644 --- a/scripts/crowdin/utils.mjs +++ b/scripts/crowdin/utils.mjs @@ -1,4 +1,5 @@ import {TOKEN } from "./constants.mjs"; +import { CrowdinError } from "../common/errors.mjs"; // Reusable function to handle fetch requests with authorization headers export const fetchDataWithAuthorization = async (url, method = 'GET', body = null) => { diff --git a/widget/embedded/src/constants/languages.ts b/widget/embedded/src/constants/languages.ts index 410dfac854..1be1ab5a0a 100644 --- a/widget/embedded/src/constants/languages.ts +++ b/widget/embedded/src/constants/languages.ts @@ -1,21 +1,40 @@ import type { FlagPropTypes, Language } from '@rango-dev/ui'; import { + Bengali, + Catalonia, Chinese, + Denmark, English, Finland, French, German, Greece, + Hungary, + India, + Indonesian, Italian, Japanese, + Korea, + Lithuania, + Malay, Netherlands, + Pakistan, + Philippines, Poland, Portuguese, Russian, + SaudiArabia, + Serbia, + Slovakia, + SouthAfrica, Spanish, + Swahili, Swedish, + Thai, + Turkish, Ukrainian, + Vietnamese, } from '@rango-dev/ui'; export type LanguageItem = { @@ -26,21 +45,56 @@ export type LanguageItem = { }; export const LANGUAGES: LanguageItem[] = [ + { title: 'Afrikaans', label: 'Afrikaans', local: 'af', SVGFlag: SouthAfrica }, + { title: 'Arabic', label: 'عربي', local: 'ar', SVGFlag: SaudiArabia }, + { title: 'Bengali', label: 'বাংলা', local: 'bn', SVGFlag: Bengali }, + { title: 'Catalan', label: 'Català', local: 'ca', SVGFlag: Catalonia }, + { + title: 'Chinese (Simplified)', + label: '简体中文', + local: 'zh-CN', + SVGFlag: Chinese, + }, + { + title: 'Chinese (Traditional)', + label: '中文(繁體)', + local: 'zh-TW', + SVGFlag: Chinese, + }, + { title: 'Danish', label: 'Dansk', local: 'da', SVGFlag: Denmark }, + { title: 'Dutch', label: 'Nederlands', local: 'nl', SVGFlag: Netherlands }, { title: 'English', label: 'English', local: 'en', SVGFlag: English }, - { title: 'Spanish', label: 'Español', local: 'es', SVGFlag: Spanish }, + { title: 'Filipino', label: 'Filipino', local: 'fil', SVGFlag: Philippines }, + { title: 'Finnish', label: 'Suomalainen', local: 'fi', SVGFlag: Finland }, { title: 'French', label: 'Français', local: 'fr', SVGFlag: French }, - { title: 'Japanese', label: '日本語', local: 'ja', SVGFlag: Japanese }, - { title: 'Portuguese', label: 'Português', local: 'pt', SVGFlag: Portuguese }, - { title: 'Chinese', label: '中国人', local: 'zh', SVGFlag: Chinese }, - { title: 'Russian', label: 'Русский', local: 'ru', SVGFlag: Russian }, { title: 'German', label: 'Deutsch', local: 'de', SVGFlag: German }, - { title: 'Ukrainian', label: 'Україні', local: 'uk', SVGFlag: Ukrainian }, - { title: 'Swedish', label: 'svenska', local: 'sv', SVGFlag: Swedish }, - { title: 'Finnish', label: 'Suomalainen', local: 'fi', SVGFlag: Finland }, - { title: 'Dutch', label: 'Nederlands', local: 'nl', SVGFlag: Netherlands }, - { title: 'Greek', label: 'Grieks', local: 'el', SVGFlag: Greece }, + { title: 'Greek', label: 'ελληνικά', local: 'el', SVGFlag: Greece }, + { title: 'Hindi', label: 'हिंदी', local: 'hi', SVGFlag: India }, + { title: 'Hungarian', label: 'Magyar', local: 'hu', SVGFlag: Hungary }, + { title: 'Indonesian', label: 'Indonesia', local: 'id', SVGFlag: Indonesian }, { title: 'Italian', label: 'Italiana', local: 'it', SVGFlag: Italian }, + { title: 'Japanese', label: '日本語', local: 'ja', SVGFlag: Japanese }, + { title: 'Korean', label: '한국인', local: 'ko', SVGFlag: Korea }, + { title: 'Lithuanian', label: 'Lietuvių', local: 'lt', SVGFlag: Lithuania }, + { title: 'Malay', label: 'Melayu', local: 'ms', SVGFlag: Malay }, { title: 'Polish', label: 'Polski', local: 'pl', SVGFlag: Poland }, + { title: 'Portuguese', label: 'Português', local: 'pt', SVGFlag: Portuguese }, + { title: 'Russian', label: 'Русский', local: 'ru', SVGFlag: Russian }, + { title: 'Serbian', label: 'Cрпски', local: 'sr', SVGFlag: Serbia }, + { title: 'Slovak', label: 'Slovenský', local: 'sk', SVGFlag: Slovakia }, + { title: 'Spanish', label: 'Español', local: 'es', SVGFlag: Spanish }, + { title: 'Swahili', label: 'Kiswahili', local: 'sw', SVGFlag: Swahili }, + { title: 'Swedish', label: 'Svenska', local: 'sv', SVGFlag: Swedish }, + { title: 'Thai', label: 'แบบไทย', local: 'th', SVGFlag: Thai }, + { title: 'Turkish', label: 'Türkçe', local: 'tr', SVGFlag: Turkish }, + { title: 'Ukrainian', label: 'Yкраїні', local: 'uk', SVGFlag: Ukrainian }, + { title: 'Urdu', label: 'اردو', local: 'ur', SVGFlag: Pakistan }, + { + title: 'Vietnamese', + label: 'Tiếng Việt', + local: 'vi', + SVGFlag: Vietnamese, + }, ]; export const DEFAULT_LANGUAGE = 'en'; diff --git a/widget/playground/src/constants/languages.ts b/widget/playground/src/constants/languages.ts index c0b71e591b..330534792d 100644 --- a/widget/playground/src/constants/languages.ts +++ b/widget/playground/src/constants/languages.ts @@ -1,35 +1,74 @@ import { + Bengali, + Catalonia, Chinese, + Denmark, English, Finland, French, German, Greece, + Hungary, + India, + Indonesian, Italian, Japanese, + Korea, + Lithuania, + Malay, Netherlands, + Pakistan, + Philippines, Poland, Portuguese, Russian, + SaudiArabia, + Serbia, + Slovakia, + SouthAfrica, Spanish, + Swahili, Swedish, + Thai, + Turkish, Ukrainian, + Vietnamese, } from '@rango-dev/ui'; export const LANGUAGES = [ + { name: 'Afrikaans', value: 'af', Icon: SouthAfrica }, + { name: 'Arabic', value: 'ar', Icon: SaudiArabia }, + { name: 'Bengali', value: 'bn', Icon: Bengali }, + { name: 'Catalan', value: 'ca', Icon: Catalonia }, + { name: 'Chinese (Simplified)', value: 'zh-CN', Icon: Chinese }, + { name: 'Chinese (Traditional)', value: 'zh-TW', Icon: Chinese }, + { name: 'Danish', value: 'da', Icon: Denmark }, + { name: 'Dutch', value: 'nl', Icon: Netherlands }, { name: 'English', value: 'en', Icon: English }, - { name: 'Spanish', value: 'es', Icon: Spanish }, + { name: 'Filipino', value: 'fil', Icon: Philippines }, + { name: 'Finnish', value: 'fi', Icon: Finland }, { name: 'French', value: 'fr', Icon: French }, - { name: 'Japanese', value: 'ja', Icon: Japanese }, - { name: 'Portuguese', value: 'pt', Icon: Portuguese }, - { name: 'Chinese', value: 'zh', Icon: Chinese }, - { name: 'Russian', value: 'ru', Icon: Russian }, { name: 'German', value: 'de', Icon: German }, - { name: 'Ukrainian', value: 'uk', Icon: Ukrainian }, - { name: 'Swedish', value: 'sv', Icon: Swedish }, - { name: 'Finnish', value: 'fi', Icon: Finland }, - { name: 'Dutch', value: 'nl', Icon: Netherlands }, { name: 'Greek', value: 'el', Icon: Greece }, + { name: 'Hindi', value: 'hi', Icon: India }, + { name: 'Hungarian', value: 'hu', Icon: Hungary }, + { name: 'Indonesian', value: 'id', Icon: Indonesian }, { name: 'Italian', value: 'it', Icon: Italian }, + { name: 'Japanese', value: 'ja', Icon: Japanese }, + { name: 'Korean', value: 'ko', Icon: Korea }, + { name: 'Lithuanian', value: 'lt', Icon: Lithuania }, + { name: 'Malay', value: 'ms', Icon: Malay }, { name: 'Polish', value: 'pl', Icon: Poland }, + { name: 'Portuguese', value: 'pt', Icon: Portuguese }, + { name: 'Russian', value: 'ru', Icon: Russian }, + { name: 'Serbian', value: 'sr', Icon: Serbia }, + { name: 'Slovak', value: 'sk', Icon: Slovakia }, + { name: 'Spanish', value: 'es', Icon: Spanish }, + { name: 'Swahili', value: 'sw', Icon: Swahili }, + { name: 'Swedish', value: 'sv', Icon: Swedish }, + { name: 'Thai', value: 'th', Icon: Thai }, + { name: 'Turkish', value: 'tr', Icon: Turkish }, + { name: 'Ukrainian', value: 'uk', Icon: Ukrainian }, + { name: 'Urdu', value: 'ur', Icon: Pakistan }, + { name: 'Vietnamese', value: 'vi', Icon: Vietnamese }, ]; diff --git a/widget/storybook/src/components/Flags/index.ts b/widget/storybook/src/components/Flags/index.ts index b03a8d9183..f718ed2bdb 100644 --- a/widget/storybook/src/components/Flags/index.ts +++ b/widget/storybook/src/components/Flags/index.ts @@ -1,21 +1,35 @@ import { Bengali, + Catalonia, Chinese, + Cyprus, + Denmark, English, Finland, French, German, Greece, Hindi, + Hungary, + India, Indonesian, Italian, Japanese, + Korea, + Lithuania, Malay, Netherlands, + Pakistan, + Philippines, Poland, Portuguese, Russian, + SaudiArabia, + Serbia, + Slovakia, + SouthAfrica, Spanish, + Swahili, Swedish, Thai, Turkish, @@ -46,4 +60,18 @@ export const Flags = { Greece, Italian, Poland, + Catalonia, + Cyprus, + Denmark, + Hungary, + India, + Korea, + Lithuania, + Pakistan, + Philippines, + SaudiArabia, + Serbia, + Slovakia, + SouthAfrica, + Swahili, }; diff --git a/widget/ui/src/components/Flags/Catalonia.tsx b/widget/ui/src/components/Flags/Catalonia.tsx new file mode 100644 index 0000000000..78e63ce519 --- /dev/null +++ b/widget/ui/src/components/Flags/Catalonia.tsx @@ -0,0 +1,31 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Catalonia(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Cyprus.tsx b/widget/ui/src/components/Flags/Cyprus.tsx new file mode 100644 index 0000000000..bf04e51922 --- /dev/null +++ b/widget/ui/src/components/Flags/Cyprus.tsx @@ -0,0 +1,32 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Cyprus(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Denmark.tsx b/widget/ui/src/components/Flags/Denmark.tsx new file mode 100644 index 0000000000..32412d6827 --- /dev/null +++ b/widget/ui/src/components/Flags/Denmark.tsx @@ -0,0 +1,31 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Denmark(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Hungary.tsx b/widget/ui/src/components/Flags/Hungary.tsx new file mode 100644 index 0000000000..1a7eb127b0 --- /dev/null +++ b/widget/ui/src/components/Flags/Hungary.tsx @@ -0,0 +1,29 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Hungary(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/India.tsx b/widget/ui/src/components/Flags/India.tsx new file mode 100644 index 0000000000..db5db5d9d9 --- /dev/null +++ b/widget/ui/src/components/Flags/India.tsx @@ -0,0 +1,29 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function India(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Korea.tsx b/widget/ui/src/components/Flags/Korea.tsx new file mode 100644 index 0000000000..ca18c88f81 --- /dev/null +++ b/widget/ui/src/components/Flags/Korea.tsx @@ -0,0 +1,32 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Korea(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Lithuania.tsx b/widget/ui/src/components/Flags/Lithuania.tsx new file mode 100644 index 0000000000..612fd11767 --- /dev/null +++ b/widget/ui/src/components/Flags/Lithuania.tsx @@ -0,0 +1,29 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Lithuania(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Pakistan.tsx b/widget/ui/src/components/Flags/Pakistan.tsx new file mode 100644 index 0000000000..60f39cb2d1 --- /dev/null +++ b/widget/ui/src/components/Flags/Pakistan.tsx @@ -0,0 +1,29 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Pakistan(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Philippines.tsx b/widget/ui/src/components/Flags/Philippines.tsx new file mode 100644 index 0000000000..1b4927eb65 --- /dev/null +++ b/widget/ui/src/components/Flags/Philippines.tsx @@ -0,0 +1,30 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Philippines(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/SaudiArabia.tsx b/widget/ui/src/components/Flags/SaudiArabia.tsx new file mode 100644 index 0000000000..2f728ca17c --- /dev/null +++ b/widget/ui/src/components/Flags/SaudiArabia.tsx @@ -0,0 +1,29 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function SaudiArabia(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Serbia.tsx b/widget/ui/src/components/Flags/Serbia.tsx new file mode 100644 index 0000000000..3e9bc68f60 --- /dev/null +++ b/widget/ui/src/components/Flags/Serbia.tsx @@ -0,0 +1,41 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Serbia(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Slovakia.tsx b/widget/ui/src/components/Flags/Slovakia.tsx new file mode 100644 index 0000000000..a8048596a6 --- /dev/null +++ b/widget/ui/src/components/Flags/Slovakia.tsx @@ -0,0 +1,42 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Slovakia(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/SouthAfrica.tsx b/widget/ui/src/components/Flags/SouthAfrica.tsx new file mode 100644 index 0000000000..ac52bc283b --- /dev/null +++ b/widget/ui/src/components/Flags/SouthAfrica.tsx @@ -0,0 +1,35 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function SouthAfrica(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/Swahili.tsx b/widget/ui/src/components/Flags/Swahili.tsx new file mode 100644 index 0000000000..4fafcc52c9 --- /dev/null +++ b/widget/ui/src/components/Flags/Swahili.tsx @@ -0,0 +1,46 @@ +import type { FlagPropTypes } from './Flags.types.js'; + +import React from 'react'; + +import { DEFAULT_SIZE } from './Flags.constants.js'; + +export default function Swahili(props: FlagPropTypes) { + const { size = DEFAULT_SIZE } = props; + + return ( + + + + + + + + + + + + + + + + ); +} diff --git a/widget/ui/src/components/Flags/index.ts b/widget/ui/src/components/Flags/index.ts index e8037c4ce2..49cc3a3f59 100644 --- a/widget/ui/src/components/Flags/index.ts +++ b/widget/ui/src/components/Flags/index.ts @@ -1,20 +1,34 @@ import Bengali from './Bengali.js'; +import Catalonia from './Catalonia.js'; import Chinese from './Chinese.js'; +import Cyprus from './Cyprus.js'; +import Denmark from './Denmark.js'; import English from './English.js'; import Finland from './Finland.js'; import French from './French.js'; import German from './German.js'; import Greece from './Greece.js'; import Hindi from './Hindi.js'; +import Hungary from './Hungary.js'; +import India from './India.js'; import Indonesian from './Indonesian.js'; import Italian from './Italian.js'; import Japanese from './Japanese.js'; +import Korea from './Korea.js'; +import Lithuania from './Lithuania.js'; import Malay from './Malay.js'; import Netherlands from './Netherlands.js'; +import Pakistan from './Pakistan.js'; +import Philippines from './Philippines.js'; import Poland from './Poland.js'; import Portuguese from './Portuguese.js'; import Russian from './Russian.js'; +import SaudiArabia from './SaudiArabia.js'; +import Serbia from './Serbia.js'; +import Slovakia from './Slovakia.js'; +import SouthAfrica from './SouthAfrica.js'; import Spanish from './Spanish.js'; +import Swahili from './Swahili.js'; import Swedish from './Swedish.js'; import Thai from './Thai.js'; import Turkish from './Turkish.js'; @@ -46,4 +60,18 @@ export { Greece, Italian, Poland, + Catalonia, + Cyprus, + Denmark, + Hungary, + India, + Korea, + Lithuania, + Pakistan, + Philippines, + SaudiArabia, + Serbia, + Slovakia, + SouthAfrica, + Swahili, }; diff --git a/widget/ui/src/components/I18nManager/I18nManager.tsx b/widget/ui/src/components/I18nManager/I18nManager.tsx index fa3374c638..9202d545ab 100644 --- a/widget/ui/src/components/I18nManager/I18nManager.tsx +++ b/widget/ui/src/components/I18nManager/I18nManager.tsx @@ -11,38 +11,78 @@ import React, { useEffect, useReducer } from 'react'; * "translations/*": ["../../translations/*"] *} */ +import { messages as afMessages } from '../../../../../translations/af.js'; +import { messages as arMessages } from '../../../../../translations/ar.js'; +import { messages as bnMessages } from '../../../../../translations/bn.js'; +import { messages as caMessages } from '../../../../../translations/ca.js'; +import { messages as daMessages } from '../../../../../translations/da.js'; import { messages as deMessages } from '../../../../../translations/de.js'; import { messages as elMessages } from '../../../../../translations/el.js'; import { messages as enMessages } from '../../../../../translations/en.js'; import { messages as esMessages } from '../../../../../translations/es.js'; import { messages as fiMessages } from '../../../../../translations/fi.js'; +import { messages as filMessages } from '../../../../../translations/fil.js'; import { messages as frMessages } from '../../../../../translations/fr.js'; +import { messages as hiMessages } from '../../../../../translations/hi.js'; +import { messages as huMessages } from '../../../../../translations/hu.js'; +import { messages as idMessages } from '../../../../../translations/id.js'; import { messages as itMessages } from '../../../../../translations/it.js'; import { messages as jaMessages } from '../../../../../translations/ja.js'; +import { messages as koMessages } from '../../../../../translations/ko.js'; +import { messages as ltMessages } from '../../../../../translations/lt.js'; +import { messages as msMessages } from '../../../../../translations/ms.js'; import { messages as nlMessages } from '../../../../../translations/nl.js'; import { messages as plMessages } from '../../../../../translations/pl.js'; import { messages as ptMessages } from '../../../../../translations/pt.js'; import { messages as ruMessages } from '../../../../../translations/ru.js'; +import { messages as skMessages } from '../../../../../translations/sk.js'; +import { messages as srMessages } from '../../../../../translations/sr.js'; import { messages as svMessages } from '../../../../../translations/sv.js'; +import { messages as swMessages } from '../../../../../translations/sw.js'; +import { messages as thMessages } from '../../../../../translations/th.js'; +import { messages as trMessages } from '../../../../../translations/tr.js'; import { messages as ukMessages } from '../../../../../translations/uk.js'; -import { messages as zhMessages } from '../../../../../translations/zh.js'; +import { messages as urMessages } from '../../../../../translations/ur.js'; +import { messages as viMessages } from '../../../../../translations/vi.js'; +import { messages as zh_CNMessages } from '../../../../../translations/zh-CN.js'; +import { messages as zh_TWMessages } from '../../../../../translations/zh-TW.js'; const messages = { + af: afMessages, + ar: arMessages, + bn: bnMessages, + ca: caMessages, + da: daMessages, + de: deMessages, + el: elMessages, en: enMessages, es: esMessages, - ja: jaMessages, + fi: fiMessages, + fil: filMessages, fr: frMessages, + hi: hiMessages, + hu: huMessages, + id: idMessages, + it: itMessages, + ja: jaMessages, + ko: koMessages, + lt: ltMessages, + ms: msMessages, + nl: nlMessages, + pl: plMessages, pt: ptMessages, - zh: zhMessages, ru: ruMessages, - de: deMessages, - uk: ukMessages, + sk: skMessages, + sr: srMessages, sv: svMessages, - fi: fiMessages, - nl: nlMessages, - el: elMessages, - it: itMessages, - pl: plMessages, + sw: swMessages, + th: thMessages, + tr: trMessages, + uk: ukMessages, + ur: urMessages, + vi: viMessages, + 'zh-CN': zh_CNMessages, + 'zh-TW': zh_TWMessages, }; i18n.load(messages);