Skip to content

Artshell-company/tolgee-format-icu-jsx-param

Repository files navigation

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

About

Tolgee format ICU plugin that supports jsx params

Resources

Stars

Watchers

Forks

Packages

No packages published