diff --git a/src/components/ConfigProvider/ConfigProvider.stories.tsx b/src/components/ConfigProvider/ConfigProvider.stories.tsx index 8281569b6..92d05b7ca 100644 --- a/src/components/ConfigProvider/ConfigProvider.stories.tsx +++ b/src/components/ConfigProvider/ConfigProvider.stories.tsx @@ -46,6 +46,7 @@ import Upload, { UploadProps } from '../Upload'; import dayjs, { Dayjs } from 'dayjs'; // locales +import type { Locale as OcLocale } from '../LocaleProvider'; // Need to alias because story name declaration conflicts with the type import csCZ from '../Locale/cs_CZ'; // čeština import daDK from '../Locale/da_DK'; // Dansk import deDE from '../Locale/de_DE'; // Deutsch @@ -787,10 +788,10 @@ const snackArgs: Object = { const Locale_Story: ComponentStory = (args) => { const [_, updateArgs] = useArgs(); - const [locale, setLocale] = useState(enUS); + const [locale, setLocale] = useState(enUS); const [localeValue, setLocaleValue] = useState('en_US'); - const locales: Record = { + const locales: Record = { cs_CZ: csCZ, da_DK: daDK, de_DE: deDE, diff --git a/src/locale.ts b/src/locale.ts new file mode 100644 index 000000000..53ddb6d29 --- /dev/null +++ b/src/locale.ts @@ -0,0 +1,77 @@ +import type { Locale } from './components/LocaleProvider'; + +// Supported locales +import csCZ from './components/Locale/cs_CZ'; // čeština +import daDK from './components/Locale/da_DK'; // Dansk +import deDE from './components/Locale/de_DE'; // Deutsch +import elGR from './components/Locale/el_GR'; // Ελληνικά +import enGB from './components/Locale/en_GB'; // English (United Kingdom) +import enUS from './components/Locale/en_US'; // English (United States) +import esES from './components/Locale/es_ES'; // Español +import esDO from './components/Locale/es_DO'; // Español (Dominican Republic) +import esMX from './components/Locale/es_MX'; // Español (Mexico) +import fiFI from './components/Locale/fi_FI'; // Suomi +import frBE from './components/Locale/fr_BE'; // Français (Belgium) TODO: dayjs has no fr_BE locale, use fr +import frCA from './components/Locale/fr_CA'; // Français (Canada) +import frFR from './components/Locale/fr_FR'; // Français +import heIL from './components/Locale/he_IL'; // עברית +import hiIN from './components/Locale/hi_IN'; // हिंदी +import hrHR from './components/Locale/hr_HR'; // Hrvatski +import htHT from './components/Locale/ht_HT'; // Haitian +import huHU from './components/Locale/hu_HU'; // Magyar +import itIT from './components/Locale/it_IT'; // Italiano +import jaJP from './components/Locale/ja_JP'; // 日本語 +import koKR from './components/Locale/ko_KR'; // 한국어 +import msMY from './components/Locale/ms_MY'; // Bahasa melayu +import nbNO from './components/Locale/nb_NO'; // Norsk +import nlBE from './components/Locale/nl_BE'; // Nederlands (Belgium) +import nlNL from './components/Locale/nl_NL'; // Nederlands +import plPL from './components/Locale/pl_PL'; // Polski +import ptBR from './components/Locale/pt_BR'; // Português (Brazil) +import ptPT from './components/Locale/pt_PT'; // Português +import ruRU from './components/Locale/ru_RU'; // Pусский +import svSE from './components/Locale/sv_SE'; // Svenska +import thTH from './components/Locale/th_TH'; // ภาษาไทย +import trTR from './components/Locale/tr_TR'; // Türkçe +import ukUA from './components/Locale/uk_UA'; // Yкраїнська +import zhCN from './components/Locale/zh_CN'; // 中文 (简体) +import zhTW from './components/Locale/zh_TW'; // 中文 (繁體) + +export { + Locale, + csCZ, + daDK, + deDE, + elGR, + enGB, + enUS, + esES, + esDO, + esMX, + fiFI, + frBE, + frCA, + frFR, + heIL, + hiIN, + hrHR, + htHT, + huHU, + itIT, + jaJP, + koKR, + msMY, + nbNO, + nlBE, + nlNL, + plPL, + ptBR, + ptPT, + ruRU, + svSE, + thTH, + trTR, + ukUA, + zhCN, + zhTW, +}; diff --git a/webpack.common.js b/webpack.common.js index dbf6a0a97..5f9f37b88 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -5,6 +5,7 @@ const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); module.exports = (_, { mode }) => ({ entry: { octuple: [path.resolve(__dirname, 'src/octuple.ts')], + locale: [path.resolve(__dirname, 'src/locale.ts')], }, module: { rules: [