Formatting
By default, Tolgee doesn't format translations. Use formatters if you want to use variable parameters in your translations.
Simple formatter
FormatSimple
plugin if you just need to include variables in your translations. It is very minimalistic, only intended to interpolate your parameters and save your bundle size.
import { FormatSimple } from '@tolgee/web';
...
tolgee.use(FormatSimple());
Icu formatter
For advanced formatting functionality install FormatIcu
plugin, which is shipped in separate package.
- npm
- yarn
- pnpm
npm install @tolgee/format-icu
yarn add @tolgee/format-icu
pnpm install @tolgee/format-icu
Use it like this:
import { FormatIcu } from '@tolgee/format-icu';
tolgee.use(FormatIcu());
Read more about ICU message format