Documentation ¶
Overview ¶
- Copyright (c) 2018 DeineAgentur UG https://www.deineagentur.com. All rights reserved.
- Licensed under the MIT License. See LICENSE file in the project root for full license information.
Package gnuGettext implements GNU gettext like utilities.
For quick/simple translations you can use the package level functions directly.
import ( "fmt" "github.com/DeineAgenturUG/gotext/gnuGettext" ) func main() { // Configure package gnuGettext.Configure("/path/to/locales/root/dir", "en_UK", "domain-name") // Translate text from default domain fmt.Println(gnuGettext.Gettext("My text on 'domain-name' domain")) // Translate text from a different domain without reconfigure fmt.Println(gnuGettext.Dgettext("domain2", "Another text on a different domain")) }
Index ¶
- Variables
- func Dgettext(domain, msgid string) string
- func Dngettext(domain, msgid, msgidPlural string, count int) string
- func Dnpgettext(domain, msgctxt, msgid, msgidPlural string, count int) string
- func Dpgettext(domain, msgctxt, msgid string) string
- func GetLibary() string
- func GetLocale() string
- func GetTextDomain() string
- func Gettext(msgid string) string
- func Ngettext(msgid, msgidPlural string, count int) string
- func Npgettext(msgctxt, msgid, msgidPlural string, count int) string
- func Pgettext(msgctxt, msgid string) string
- func SetLibary(libary string)
- func SetLocale(locale string)
- func SetTextDomain(domain string)
Constants ¶
This section is empty.
Variables ¶
View Source
var GetInstance = gotext.GetInstance
GetInstance helper to load multiple languages and domains at once
View Source
var Sprintf = gotext.Sprintf
Sprinf alias from format submodule
Functions ¶
func Dnpgettext ¶
func GetTextDomain ¶
func GetTextDomain() string
func SetTextDomain ¶
func SetTextDomain(domain string)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.