Properly handle singular vs plural defaults for untranslated strings. Fixes #9

This commit is contained in:
Leonel Quinteros
2017-09-01 13:28:51 -03:00
parent 756045ab5e
commit 4b94e83723
5 changed files with 142 additions and 33 deletions

View File

@@ -3,17 +3,20 @@ Package gotext implements GNU gettext utilities.
For quick/simple translations you can use the package level functions directly.
import "github.com/leonelquinteros/gotext"
import (
"fmt"
"github.com/leonelquinteros/gotext"
)
func main() {
// Configure package
gotext.Configure("/path/to/locales/root/dir", "en_UK", "domain-name")
// Translate text from default domain
println(gotext.Get("My text on 'domain-name' domain"))
fmt.Println(gotext.Get("My text on 'domain-name' domain"))
// Translate text from a different domain without reconfigure
println(gotext.GetD("domain2", "Another text on a different domain"))
fmt.Println(gotext.GetD("domain2", "Another text on a different domain"))
}
*/