From b4ab6497b5f008affff6378aaedad804562cc0cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20Fr=C3=B6hle?= Date: Mon, 27 Jul 2020 18:17:50 +0200 Subject: [PATCH] update module to own version --- .github/workflows/build.yml | 2 +- README.md | 32 ++++++++++++------------- cli/xgotext/README.md | 2 +- cli/xgotext/fixtures/main.go | 6 ++--- cli/xgotext/fixtures/pkg/pkg.go | 2 +- cli/xgotext/main.go | 2 +- cli/xgotext/parser/golang.go | 4 ++-- gotext.go | 42 ++++++++++++++++----------------- locale.go | 14 +++++------ mo.go | 6 ++--- po.go | 4 ++-- 11 files changed, 58 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ad6b84..d8e4e94 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: run: go build -v . - name: Install xgotext CLI - run: go install -v github.com/leonelquinteros/gotext/cli/xgotext + run: go install -v git.deineagentur.com/DeineAgenturUG/gotext/cli/xgotext - name: Test run: go test -v -race ./... diff --git a/README.md b/README.md index f3914f4..1b7c8b3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -[![GitHub release](https://img.shields.io/github/release/leonelquinteros/gotext.svg)](https://github.com/leonelquinteros/gotext) +[![GitHub release](https://img.shields.io/github/release/leonelquinteros/gotext.svg)](https://git.deineagentur.com/DeineAgenturUG/gotext) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) -[![GoDoc](https://godoc.org/github.com/leonelquinteros/gotext?status.svg)](https://godoc.org/github.com/leonelquinteros/gotext) -![Gotext build](https://github.com/leonelquinteros/gotext/workflows/Gotext%20build/badge.svg?branch=master) +[![GoDoc](https://godoc.org/git.deineagentur.com/DeineAgenturUG/gotext?status.svg)](https://godoc.org/git.deineagentur.com/DeineAgenturUG/gotext) +![Gotext build](https://git.deineagentur.com/DeineAgenturUG/gotext/workflows/Gotext%20build/badge.svg?branch=master) [![Build Status](https://travis-ci.org/leonelquinteros/gotext.svg?branch=master)](https://travis-ci.org/leonelquinteros/gotext) -[![Go Report Card](https://goreportcard.com/badge/github.com/leonelquinteros/gotext)](https://goreportcard.com/report/github.com/leonelquinteros/gotext) +[![Go Report Card](https://goreportcard.com/badge/git.deineagentur.com/DeineAgenturUG/gotext)](https://goreportcard.com/report/git.deineagentur.com/DeineAgenturUG/gotext) # Gotext @@ -35,13 +35,13 @@ # Documentation -Refer to the Godoc package documentation at (https://godoc.org/github.com/leonelquinteros/gotext) +Refer to the Godoc package documentation at (https://godoc.org/git.deineagentur.com/DeineAgenturUG/gotext) # Installation ``` -go get github.com/leonelquinteros/gotext +go get git.deineagentur.com/DeineAgenturUG/gotext ``` - There are no requirements or dependencies to use this package. @@ -58,28 +58,28 @@ You can rely on this to use your preferred vendoring tool or to manually retriev ### Vendoring with [Go Modules](https://github.com/golang/go/wiki/Modules) (Recommended) -Add `github.com/leonelquinteros/gotext` inside the `require` section in your `go.mod` file. +Add `git.deineagentur.com/DeineAgenturUG/gotext` inside the `require` section in your `go.mod` file. i.e. ``` require ( - github.com/leonelquinteros/gotext v1.4.0 + git.deineagentur.com/DeineAgenturUG/gotext v1.5.0 ) ``` ### Vendoring with [dep](https://golang.github.io/dep/) -To use last stable version (v1.4.0 at the moment of writing) +To use last stable version (v1.5.0 at the moment of writing) ``` -dep ensure -add github.com/leonelquinteros/gotext@v1.4.0 +dep ensure -add git.deineagentur.com/DeineAgenturUG/gotext@v1.5.0 ``` Import as ```go -import "github.com/leonelquinteros/gotext" +import "git.deineagentur.com/DeineAgenturUG/gotext" ``` @@ -155,7 +155,7 @@ For quick/simple translations you can use the package level functions directly. ```go import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -179,7 +179,7 @@ Use the fmt.Printf syntax (from Go's "fmt" package) to specify how to print the ```go import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -204,7 +204,7 @@ so you can handle each settings on their own. ```go import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -241,7 +241,7 @@ you can directly use the Po object to parse it and access the translations in th ```go import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -277,7 +277,7 @@ Plural formulas are parsed and evaluated using [Kinako](https://github.com/mattn ```go import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { diff --git a/cli/xgotext/README.md b/cli/xgotext/README.md index e488c39..6517d67 100644 --- a/cli/xgotext/README.md +++ b/cli/xgotext/README.md @@ -5,7 +5,7 @@ CLI tool to extract translation strings from Go packages into .POT files. ## Installation ``` -go install github.com/leonelquinteros/gotext/cli/xgotext +go install git.deineagentur.com/DeineAgenturUG/gotext/cli/xgotext ``` ## Usage diff --git a/cli/xgotext/fixtures/main.go b/cli/xgotext/fixtures/main.go index 29944d1..e1eb380 100644 --- a/cli/xgotext/fixtures/main.go +++ b/cli/xgotext/fixtures/main.go @@ -4,9 +4,9 @@ import ( "errors" "fmt" - "github.com/leonelquinteros/gotext" - alias "github.com/leonelquinteros/gotext" - "github.com/leonelquinteros/gotext/cli/xgotext/fixtures/pkg" + "git.deineagentur.com/DeineAgenturUG/gotext" + alias "git.deineagentur.com/DeineAgenturUG/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext/cli/xgotext/fixtures/pkg" ) // Fake object with methods similar to gotext diff --git a/cli/xgotext/fixtures/pkg/pkg.go b/cli/xgotext/fixtures/pkg/pkg.go index 320fb32..7dc30a6 100644 --- a/cli/xgotext/fixtures/pkg/pkg.go +++ b/cli/xgotext/fixtures/pkg/pkg.go @@ -1,6 +1,6 @@ package pkg -import "github.com/leonelquinteros/gotext" +import "git.deineagentur.com/DeineAgenturUG/gotext" type SubTranslate struct { L gotext.Locale diff --git a/cli/xgotext/main.go b/cli/xgotext/main.go index cfce092..19e1c83 100644 --- a/cli/xgotext/main.go +++ b/cli/xgotext/main.go @@ -5,7 +5,7 @@ import ( "log" "strings" - "github.com/leonelquinteros/gotext/cli/xgotext/parser" + "git.deineagentur.com/DeineAgenturUG/gotext/cli/xgotext/parser" ) var ( diff --git a/cli/xgotext/parser/golang.go b/cli/xgotext/parser/golang.go index 2693503..fea94c7 100644 --- a/cli/xgotext/parser/golang.go +++ b/cli/xgotext/parser/golang.go @@ -165,7 +165,7 @@ func (g *GoFile) checkType(rawType types.Type) bool { return g.checkType(t.Elem()) case *types.Named: - if t.Obj().Pkg() == nil || t.Obj().Pkg().Path() != "github.com/leonelquinteros/gotext" { + if t.Obj().Pkg() == nil || t.Obj().Pkg().Path() != "git.deineagentur.com/DeineAgenturUG/gotext" { return false } default: @@ -187,7 +187,7 @@ func (g *GoFile) inspectCallExpr(n *ast.CallExpr) { // object is a package if the Obj is not set if e.Obj == nil { pkg, ok := g.importedPackages[e.Name] - if !ok || pkg.PkgPath != "github.com/leonelquinteros/gotext" { + if !ok || pkg.PkgPath != "git.deineagentur.com/DeineAgenturUG/gotext" { return } diff --git a/gotext.go b/gotext.go index fbfc17d..8d8fd37 100644 --- a/gotext.go +++ b/gotext.go @@ -1,25 +1,25 @@ /* -Package gotext implements GNU gettext utilities. - -For quick/simple translations you can use the package level functions directly. - - 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 - fmt.Println(gotext.Get("My text on 'domain-name' domain")) - - // Translate text from a different domain without reconfigure - fmt.Println(gotext.GetD("domain2", "Another text on a different domain")) - } - -*/ +* Package gotext implements GNU gettext utilities. +* +* For quick/simple translations you can use the package level functions directly. +* +* import ( +* "fmt" +* "git.deineagentur.com/DeineAgenturUG/gotext" +* ) +* +* func main() { +* // Configure package +* gotext.Configure("/path/to/locales/root/dir", "en_UK", "domain-name") +* +* // Translate text from default domain +* fmt.Println(gotext.Get("My text on 'domain-name' domain")) +* +* // Translate text from a different domain without reconfigure +* fmt.Println(gotext.GetD("domain2", "Another text on a different domain")) +* } +* + */ package gotext import ( diff --git a/locale.go b/locale.go index 557e146..30f3434 100644 --- a/locale.go +++ b/locale.go @@ -13,7 +13,7 @@ import ( "sync" ) -/* +/** Locale wraps the entire i18n collection for a single language (locale) It's used by the package functions, but it can also be used independently to handle multiple languages at the same time by working with this object. @@ -24,7 +24,7 @@ Example: "encoding/gob" "bytes" "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -41,10 +41,10 @@ Example: l.AddDomain("extras") // Translate text from domain - fmt.Println(l.GetD("extras", "Translate this")) + fmt.Println(l.GetD("extras", "Translate this")) } - */ + type Locale struct { // Path to locale files. path string @@ -271,7 +271,7 @@ func (l *Locale) GetNDC(dom, str, plural string, n int, ctx string, vars ...inte return Printf(plural, vars...) } -// Get Euses a domain "default" to return the corresponding Translation of a given string. +// GetE uses a domain "default" to return the corresponding Translation of a given string. // Supports optional parameters (vars... interface{}) to be inserted on the formatted string using the fmt.Printf syntax. // The second return value is true iff the string was found. func (l *Locale) GetE(str string, vars ...interface{}) (string, bool) { @@ -324,14 +324,14 @@ func (l *Locale) GetNDE(dom, str, plural string, n int, vars ...interface{}) (st return "", false } -// GetC uses a domain "default" to return the corresponding Translation of the given string in the given context. +// GetCE uses a domain "default" to return the corresponding Translation of the given string in the given context. // Supports optional parameters (vars... interface{}) to be inserted on the formatted string using the fmt.Printf syntax. // The second return value is true iff the string was found. func (l *Locale) GetCE(str, ctx string, vars ...interface{}) (string, bool) { return l.GetDCE(l.GetDomain(), str, ctx, vars...) } -// GetNC retrieves the (N)th plural form of Translation for the given string in the given context in the "default" domain. +// GetNCE retrieves the (N)th plural form of Translation for the given string in the given context in the "default" domain. // Supports optional parameters (vars... interface{}) to be inserted on the formatted string using the fmt.Printf syntax. // The second return value is true iff the string was found. func (l *Locale) GetNCE(str, plural string, n int, ctx string, vars ...interface{}) (string, bool) { diff --git a/mo.go b/mo.go index a81901e..1695af3 100644 --- a/mo.go +++ b/mo.go @@ -17,7 +17,7 @@ import ( "strings" "sync" - "github.com/leonelquinteros/gotext/plurals" + "git.deineagentur.com/DeineAgenturUG/gotext/plurals" ) const ( @@ -41,7 +41,7 @@ Example: import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() { @@ -502,7 +502,7 @@ func (mo *Mo) GetNCE(str, plural string, n int, ctx string, vars ...interface{}) if _, ok := mo.contexts[ctx][str]; ok { if fmt, ok := mo.contexts[ctx][str].GetNE(mo.pluralForm(n)); ok { return Printf(fmt, vars...), true - } + } } } } diff --git a/po.go b/po.go index ff15f52..aaa4f73 100644 --- a/po.go +++ b/po.go @@ -16,7 +16,7 @@ import ( "strings" "sync" - "github.com/leonelquinteros/gotext/plurals" + "git.deineagentur.com/DeineAgenturUG/gotext/plurals" ) /* @@ -28,7 +28,7 @@ Example: import ( "fmt" - "github.com/leonelquinteros/gotext" + "git.deineagentur.com/DeineAgenturUG/gotext" ) func main() {