rakutentech/r10/6.0.0

NOTE: the latest version is 7.0.0

R10.I18n

Internationalization stuff

t : Language -> Translations -> String

Translate some text

replace : List ( String, String ) -> String -> String

Utility for variable replacement in translation.

raw : String
raw =
    "Hello my name is '{firstName}, {lastName}'"


result =
    raw
        |> R10.I18n.replace [ ( "{firstName}", "foo" ), ( "{lastName}", "bar" ) ]


-- result == "Hello my name is 'foo, bar'"
text : Translations -> Element (ContextInternal z) msg

Shorthand to transform a translation into an Element.text

List (Attribute (ContextInternal z) msg)
-> { renderingMode : RenderingMode
, tagReplacer : ContextInternal z -> String -> String
, translation : Translations
}
-> Element (ContextInternal z) msg
= Normal
| Error
List (Attribute (ContextInternal z) msg)
-> { renderingMode : RenderingMode
, tagReplacer : ContextInternal z -> String -> String
, string : String
, msgNoOp : Maybe msg
}
-> Element (ContextInternal z) msg