gnuGettext

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2019 License: MIT Imports: 1 Imported by: 0

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

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 Dgettext

func Dgettext(domain, msgid string) string

func Dngettext

func Dngettext(domain, msgid, msgidPlural string, count int) string

func Dnpgettext

func Dnpgettext(domain, msgctxt, msgid, msgidPlural string, count int) string

func Dpgettext

func Dpgettext(domain, msgctxt, msgid string) string

func GetLibary

func GetLibary() string

func GetLocale

func GetLocale() string

func GetTextDomain

func GetTextDomain() string

func Gettext

func Gettext(msgid string) string

func Ngettext

func Ngettext(msgid, msgidPlural string, count int) string

func Npgettext

func Npgettext(msgctxt, msgid, msgidPlural string, count int) string

func Pgettext

func Pgettext(msgctxt, msgid string) string

func SetLibary

func SetLibary(libary string)

func SetLocale

func SetLocale(locale string)

func SetTextDomain

func SetTextDomain(domain string)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL