driebit/elm-ginger/3.0.0

NOTE: the latest version is 5.0.1

Ginger.Translation

Definitions

= EN
| NL
| DE
| ZH

Construct

A Translation containing empty Strings

fromList : List ( Language, String ) -> Translation

Construct a Translation from a list of Language and String value pairs

Convert

Get the translated String value.

Unescapes character entity references, strips Html nodes and defaults to an empty String.

Get the original translated String value as returned by the REST api.

Defaults to an empty String.

Get the translated String value.

The first argument is the fallback Language.

Attempt fallback if translated value is missing, defaults to an empty String.

toIso639 : Language -> String

Convert a Language to an Iso639 String

Checks if translated String is empty.

Render as Html

text : Language -> Translation -> Html msg

Translate and render as Html text

We try to unescape the escaped characters but if that fails we'll render the Translation as is.

Html elements will be filtered out and the text will be joined.

html : Language -> Translation -> List (Html msg)

Translate and render as Html markup

Render in language

textNL : Translation -> Html msg

Translate to Dutch and render as Html text

htmlNL : Translation -> List (Html msg)

Translate to Dutch and render as Html markup

textEN : Translation -> Html msg

Translate to English and render as Html text

htmlEN : Translation -> List (Html msg)

Translate to English and render as Html markup

Decode