Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 615 Bytes

i18n.md

File metadata and controls

28 lines (18 loc) · 615 Bytes

Localisation

Keys should be added to translation.json file, in order to be translated to other languages.

Adding translations

A hook expose the function you need to translate content.

import { useTranslation } from '@pancakeswap/localization'

...
const { t } =  useTranslation()
...

t(key, data)
  • key is the crowdin key of the string you want to translate.
  • data dynamic variables

Dynamic variables Example

If a Crowdin translation like this You have %num% left in your wallet - would look something like:

t(`You have %num% left in your wallet`, { num: cakeBalance })