Module z_trans

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

Copyright © 2009-2020 Marc Worrell

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

Description

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

Function Index

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.
trans/2translate a string or trans record into another language.
trans/3
translations/2Fetch all translations for the given string.

Function Details

lookup/2

lookup(Trans::z:trans() | binary() | string(), Context::#context{}) -> binary() | string() | undefined

Strict translation lookup of a language version

lookup/3

lookup(Trans::z:trans() | binary() | string(), Lang::atom(), Context::#context{}) -> binary() | string() | undefined

lookup_fallback/2

lookup_fallback(Trans::z:trans() | binary() | string() | undefined, Context::z:context() | undefined) -> binary() | string() | undefined

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

lookup_fallback/3

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

lookup_fallback_language/2

lookup_fallback_language(Langs::[atom()], Context::z:context()) -> atom()

lookup_fallback_language/3

lookup_fallback_language(Langs::[atom()], Lang::atom(), Context::z:context()) -> atom()

parse_translations/1

parse_translations(Context::z:context()) -> map()

Prepare a translations table based on all .po files in the active modules. Returns a map of english sentences with all their translations

trans/2

trans(Trans::z:trans() | binary() | string(), Lang::z:context() | atom()) -> binary() | undefined

translate a string or trans record into another language

trans/3

trans(Trans, Language, Context) -> any()

translations/2

translations(Trans::z:trans() | binary() | string(), Context::z:context()) -> z:trans() | binary()

Fetch all translations for the given string.


Generated by EDoc