vibe.web.i18n

Internationalization/translation support for the web interface module.

Types 1

Functions 7

fnTranslationContextAttribute!CONTEXT translationContext(CONTEXT)() @propertyAnnotates an interface method or class with translation information.
fnstring determineLanguageByHeader(T)(string accept_language, T allowed_languages) if (isForwardRange!T && is(ElementType!T : string) || is(T == typeof(only()))) @safe pure @nogcDetermines a language code from the value of a header string. Returns: The best match from the Accept-Language header for a language. `null` if there is no supported language.
fnstring determineLanguageByHeader(Tuple...)(string accept_language, Tuple allowed_languages) if (Tuple.length != 1 || is(Tuple[0] : string)) @safe pure @nogcditto
fnstring determineLanguageByHeader(T)(HTTPServerRequest req, T allowed_languages) if (isForwardRange!T && is(ElementType!T : string) || is(T == typeof(only()))) @safe pureditto
fnstring determineLanguageByHeader(Tuple...)(HTTPServerRequest req, Tuple allowed_languages) if (Tuple.length != 1 || is(Tuple[0] : string)) @safe pureditto
fnstring determineLanguage(alias METHOD)(scope HTTPServerRequest req)
fnLangComponents extractDeclStrings(string text)

Templates 3

tmpllanguageSeq(CTX)
tmpltr(CTX, string LANG)

Performs the string translation for a statically given language.

The second overload takes a plural form and a number to select from a set of translations based on the plural forms of the target language.

Functions
string tr(string key, string context = null)
string tr(string key, string key_plural, int n, string context = null)
tmplGetTranslationContext(alias METHOD)