Module

Simple.I18n.Translator

#Translator

newtype Translator (xs :: SList)

A type of translator.

Instances

#createTranslator

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

currentLang :: forall xs. Translator xs -> String

Get current language.

#setLang

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

Set language.

#label

label :: forall label. Proxy label

A label for translation.

#translate

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.

Modules