Parse SetDomain methods

This commit is contained in:
Leonel Quinteros
2019-02-18 18:09:32 -03:00
parent 0e382cfe26
commit 6431cb3aea
2 changed files with 34 additions and 26 deletions

View File

@@ -29,7 +29,8 @@ func main() {
l := gotext.NewLocale("/path/to/locales/root/dir", "es_UY")
// Load domain '/path/to/locales/root/dir/es_UY/default.po'
l.AddDomain("default")
l.AddDomain("translations")
l.SetDomain("translations")
// Translate text from domain
fmt.Println(l.GetD("translations", "Translate this"))
@@ -39,7 +40,7 @@ func main() {
num := 17
l.GetN("SingularVar", "PluralVar", num)
l.GetDC("domain", "string", "ctx")
l.GetDC("domain2", "string", "ctx")
l.GetNDC("translations", "ndc", "ndcs", 7, "NDC-CTX")
f := Fake{}