driebit/elm-ginger/5.0.0

NOTE: the latest version is 5.0.1

Ginger.Translation

Definitions

= AR
| DE
| EN
| ES
| ET
| FR
| ID
| NL
| PL
| RU
| SR
| TR
| ZH
| Custom String

Construct

An empty 'Translation'

fromList : List ( Language, String ) -> Translation

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

Empty Strings will be ignored

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.

toNodes : Language -> Translation -> List Node

Get translated String as hecrj/html-parser Nodes

Defaults to an empty List if parsing fails.

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 concatenated.

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