Module
I18Next
- Package
- purescript-i18next
- Repository
- philippedev101/purescript-i18next
#InitOptions Source
type InitOptions = { defaultNS :: String, fallbackLng :: String, interpolation :: { escapeValue :: Boolean }, lng :: String, resources :: Object (Object (Object String)) }Options for initializing i18next.
resources is keyed by language code, then namespace, then translation key.
e.g. { en: { translation: { greeting: "Hello {{name}}" } } }
#defaultOptions Source
defaultOptions :: InitOptionsSensible defaults for init options.
#init Source
init :: I18n -> InitOptions -> Aff UnitInitialize i18next with the given options. Returns when ready.
#tWithOpts Source
tWithOpts :: I18n -> String -> Foreign -> Effect StringTranslate a key with interpolation/pluralization options.
Pass any JS-compatible value (record, Foreign.Object, etc.) via unsafeToForeign.
e.g. tWithOpts i18n "greeting" (unsafeToForeign { name: "World" })
e.g. tWithOpts i18n "items" (unsafeToForeign { count: 3 })