Module z_trans

Translate english sentences into other languages, following the GNU gettext principle.

Copyright 2009 Marc Worrell

Authors: Marc Worrell (marc@worrell.nl).

Description

Translate english sentences into other languages, following the GNU gettext principle.

Function Index

default_language/1Return the configured default language for this server.
is_language/1check if the two letter code is a valid language.
lc2descr/1Return a descriptive (english) string for the language.
lookup/2Strict translation lookup of a language version.
lookup/3
lookup_fallback/2Non strict translation lookup of a language version.
lookup_fallback/3
lookup_fallback_language/2
lookup_fallback_language/3
parse_translations/1Prepare a translations table based on all .po files in the active modules.
to_language_atom/1Translate a language-code to an atom.
trans/2translate a string or trans record into another language.
translations/2Fetch all translations for the given string.

Function Details

default_language/1

default_language(Context::#context{}) -> atom()

Return the configured default language for this server

is_language/1

is_language(Language::term()) -> boolean()

check if the two letter code is a valid language

lc2descr/1

lc2descr(Language) -> Descr

Return a descriptive (english) string for the language

lookup/2

lookup(Trans, Context) -> any()

Strict translation lookup of a language version

lookup/3

lookup(Text, Lang, Context) -> any()

lookup_fallback/2

lookup_fallback(Trans, Context) -> any()

Non strict translation lookup of a language version. In order check: requested language, default configured language, english, any

lookup_fallback/3

lookup_fallback(Text, Lang, Context) -> any()

lookup_fallback_language/2

lookup_fallback_language(Langs, Context) -> any()

lookup_fallback_language/3

lookup_fallback_language(Langs, Lang, Context) -> any()

parse_translations/1

parse_translations(Context) -> any()

Prepare a translations table based on all .po files in the active modules.

to_language_atom/1

to_language_atom(IsoCode::list() | binary()) -> {ok, atom()} | {error, not_a_language}

Translate a language-code to an atom.

trans/2

trans(Text::From, Lang::Language) -> String

translate a string or trans record into another language

translations/2

translations(Trans0::From, Context) -> #trans{} | binary()

Fetch all translations for the given string.


Generated by EDoc, Jul 29 2014, 17:16:14.