代强 36836662be fix: update locale de translate 3 anni fa
..
_story 6995204ce4 Test chromatic (#269) 3 anni fa
source 36836662be fix: update locale de translate 3 anni fa
README.md f76bd5879d feat: init 4 anni fa
context.tsx f76bd5879d feat: init 4 anni fa
index-en-US.md f76bd5879d feat: init 4 anni fa
index.md f76bd5879d feat: init 4 anni fa
interface.ts f76bd5879d feat: init 4 anni fa
localeConsumer.tsx 626c4b9f9e Feat/support next (#245) 3 anni fa
localeProvider.tsx f76bd5879d feat: init 4 anni fa

README.md

Name

Semi Design locale package

Description

Component multilingual support

Usage

import en_GB from '@douyinfe/semi-ui/lib/es/locale/source/en_GB';
import { LocaleProvider } from '@douyinfe/semi-ui';

return (
    <LocaleProvider locale={en_GB}>
        <App/>
    </LocaleProvider>
);

How to add a language package

  1. Create a language file, add it to source directory(semi-ui/packages/semi-ui/locale/source)

  1. Translation component built-in text

  1. In order to let users know that there is this language package, you need to:
    • Add it to the LocaleProvider page to let users know that there is this new language package
    • Import this new language file to demo scope so that demo can support it

Notice: Don't replace key in ${} which is a dynamic value.

What the language file should include

  • code: language package code
  • dateFnsLocale: need to pass date-fns locale object when formatting a date (using dateFns.format or dateFns.parse etc)
  • text: components' built-in text

UI


Semi Teams

License

MIT