This is package to provide type safe internationalisation, where translations can be loaded at runtime. Default translations, substitutions and pluralization are supported.
Substitutions are implemented by surrounding the literal in braces:
{
"MyNameIs": "Je m'appelle {name}"
}Pluralization is implemented by having the singular case on the left of the pipe symbol, and all
other cases on the right. The number can be substituted using {count}.
{
"MyAge": "I am only one year old|I'm {count} years old"
}Given the id of the literal in the translations, make a Literal that can be used for doing a translation.
Given the id of the literal in the translations, make a Literal that can be used for doing a translation. This also allows you to specify a default translation, substitutions and a count for pluralisation.
An empty translator. The only translations this will be able to do are the defaults
specified in the literals (hence why it is called defaultTranslator).
Add a translation dictionary to a translator.
Update the translation dictionary at the head of the stack. If there are none then set this as the only translation dictionary.
Given a Literal, translate to a String. This can never fail, and in the event of being unable to match in either the loaded or default literals this will fall back to "...". This supports substitutions and pluralization.
A translated version of Html.text for use directly in an Elm view
A translated version of Html.Attributes.placeholder for use directly in an Elm view
This represents a literal that can be translated.