@artshell/tolgee-format-icu-jsx-param
v1.0.0
Published
Tolgee format ICU plugin that supports jsx params
Downloads
833
Readme
Tolgee format ICU plugin with JSX param support
this is an alternative of Tolgee ICU formatter if you are using React and want to pass JSX in params when using the "argument" notation (ex: "Hello {thing}").
Installation
npm install @artshell/tolgee-format-icu-jsx-param
Usage
First, create a Tolgee instance and run it.
import { FormatIcu } from "@artshell/tolgee-format-icu-jsx-param";
const tolgee = Tolgee()
.use(FormatIcu())
.init(...)
...
Now you can use ICU format in your translations. Example:
tolgee.t("test", "Hello {thing}", { thing: <strong>world</strong> });
// 'Hello <strong>world</strong>'
for more information refer to Tolgee ICU formatter