Module

Simple.I18n.Translator

Package
purescript-simple-i18n
Repository
oreshinya/purescript-simple-i18n

#Translator Source

newtype Translator :: SList -> Typenewtype Translator (xs :: SList)

A type of translator.

Instances

#createTranslator Source

createTranslator :: forall fallbacklang xs r tail. IsSymbol fallbacklang => Homogeneous r (Translation xs) => Cons fallbacklang (Translation xs) tail r => Proxy fallbacklang -> Record r -> Translator xs

Create a Translator from a proxy as fallback language and a homogeneous record with Translation fields.

#currentLang Source

currentLang :: forall xs. Translator xs -> String

Get current language.

#setLang Source

setLang :: forall xs. String -> Translator xs -> Translator xs

Set language.

#label Source

label :: forall label. Proxy label

A label for translation.

#translate Source

translate :: forall label xs rl r tail. IsSymbol label => ListToRow rl r => SListToRowList xs rl => Homogeneous r String => Cons label String tail r => Proxy label -> Translator xs -> String

Get a translated string of a passed label.