Skip to content

i18n

Constants #

const default_translations_dir = 'translations'

fn load_tr_map #

fn load_tr_map() map[string]map[string]string

load_tr_map loads all .tr files from the default translations directory.

fn load_tr_map_from_dir #

fn load_tr_map_from_dir(dir string) map[string]map[string]string

load_tr_map_from_dir loads all .tr files from dir into a lang -> key -> text map.

fn tr #

fn tr(lang string, key string) string

tr returns the translation for key from the default translations directory.

fn tr_from_map #

fn tr_from_map(translations map[string]map[string]string, lang string, key string) string

tr_from_map returns the translation for key from translations.

fn tr_plural #

fn tr_plural(lang string, key string, amount int) string

tr_plural returns the pluralized translation for key from the default translations directory.

fn tr_plural_from_map #

fn tr_plural_from_map(translations map[string]map[string]string, lang string, key string, amount int) string

tr_plural_from_map returns the pluralized translation for key from translations.