Skip to content

Commit 61e0c94

Browse files
authored
Merge pull request #1 from KosyanMedia/add-tajik-plural-rule
Add tajik plural rule
2 parents 7c6508d + 851584f commit 61e0c94

18 files changed

+38
-68
lines changed

example/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010

1111
"github.com/BurntSushi/toml"
12-
"github.com/nicksnyder/go-i18n/v2/i18n"
12+
"github.com/KosyanMedia/go-i18n/i18n"
1313
"golang.org/x/text/language"
1414
)
1515

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/nicksnyder/go-i18n/v2
1+
module github.com/KosyanMedia/go-i18n
22

33
go 1.18
44

go.sum

-30
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,7 @@
11
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
22
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
3-
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
4-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
5-
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
6-
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
7-
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
8-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
9-
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
10-
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
11-
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
12-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
13-
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
14-
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
15-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
16-
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
17-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
18-
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
19-
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
20-
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
21-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
22-
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
23-
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
24-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
25-
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
26-
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
27-
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
283
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
294
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
30-
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
31-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
32-
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
33-
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
34-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
355
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
366
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
377
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=

goi18n/extract_command.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strconv"
1212
"strings"
1313

14-
"github.com/nicksnyder/go-i18n/v2/i18n"
14+
"github.com/KosyanMedia/go-i18n/i18n"
1515
)
1616

1717
func usageExtract() {
@@ -283,7 +283,7 @@ func extractStringLiteral(expr ast.Expr) (string, bool) {
283283

284284
func i18nPackageName(file *ast.File) string {
285285
for _, i := range file.Imports {
286-
if i.Path.Kind == token.STRING && i.Path.Value == `"github.com/nicksnyder/go-i18n/v2/i18n"` {
286+
if i.Path.Kind == token.STRING && i.Path.Value == `"github.com/KosyanMedia/go-i18n/i18n"` {
287287
if i.Name == nil {
288288
return "i18n"
289289
}

goi18n/extract_command_test.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func TestExtract(t *testing.T) {
2424
fileName: "file.go",
2525
file: `package main
2626
27-
import "github.com/nicksnyder/go-i18n/v2/i18n"
27+
import "github.com/KosyanMedia/go-i18n/i18n"
2828
2929
var m = &i18n.Message{
3030
ID: "Plural ID",
@@ -36,7 +36,7 @@ func TestExtract(t *testing.T) {
3636
fileName: "file.go",
3737
file: `package main
3838
39-
import "github.com/nicksnyder/go-i18n/v2/i18n"
39+
import "github.com/KosyanMedia/go-i18n/i18n"
4040
4141
var hasnewline = &i18n.Message{
4242
ID: "hasnewline",
@@ -51,7 +51,7 @@ func TestExtract(t *testing.T) {
5151
fileName: "file.go",
5252
file: `package main
5353
54-
import "github.com/nicksnyder/go-i18n/v2/i18n"
54+
import "github.com/KosyanMedia/go-i18n/i18n"
5555
5656
var a = &i18n.Message{
5757
ID: "a",
@@ -71,7 +71,7 @@ b = "a \" b"
7171
fileName: "file.go",
7272
file: `package main
7373
74-
import "github.com/nicksnyder/go-i18n/v2/i18n"
74+
import "github.com/KosyanMedia/go-i18n/i18n"
7575
7676
var a = []*i18n.Message{
7777
{
@@ -93,7 +93,7 @@ b = "b"
9393
fileName: "file.go",
9494
file: `package main
9595
96-
import "github.com/nicksnyder/go-i18n/v2/i18n"
96+
import "github.com/KosyanMedia/go-i18n/i18n"
9797
9898
var a = map[string]*i18n.Message{
9999
"a": {
@@ -115,7 +115,7 @@ b = "b"
115115
fileName: "file_test.go",
116116
file: `package main
117117
118-
import "github.com/nicksnyder/go-i18n/v2/i18n"
118+
import "github.com/KosyanMedia/go-i18n/i18n"
119119
120120
func main() {
121121
bundle := i18n.NewBundle(language.English)
@@ -129,7 +129,7 @@ b = "b"
129129
fileName: "file.go",
130130
file: `package main
131131
132-
import "github.com/nicksnyder/go-i18n/v2/i18n"
132+
import "github.com/KosyanMedia/go-i18n/i18n"
133133
134134
func main() {
135135
bundle := i18n.NewBundle(language.English)
@@ -143,7 +143,7 @@ b = "b"
143143
fileName: "file.go",
144144
file: `package main
145145
146-
import bar "github.com/nicksnyder/go-i18n/v2/i18n"
146+
import bar "github.com/KosyanMedia/go-i18n/i18n"
147147
148148
func main() {
149149
_ := &bar.Message{
@@ -157,7 +157,7 @@ b = "b"
157157
fileName: "file.go",
158158
file: `package main
159159
160-
import "github.com/nicksnyder/go-i18n/v2/i18n"
160+
import "github.com/KosyanMedia/go-i18n/i18n"
161161
162162
func main() {
163163
_ := &i18n.Message{
@@ -187,7 +187,7 @@ zero = "Zero translation"
187187
fileName: "file.go",
188188
file: `package main
189189
190-
import "github.com/nicksnyder/go-i18n/v2/i18n"
190+
import "github.com/KosyanMedia/go-i18n/i18n"
191191
192192
func main() {
193193
_ := &i18n.Message{
@@ -203,7 +203,7 @@ zero = "Zero translation"
203203
fileName: "file.go",
204204
file: `package main
205205
206-
import "github.com/nicksnyder/go-i18n/v2/i18n"
206+
import "github.com/KosyanMedia/go-i18n/i18n"
207207
208208
const constID = "ConstantID"
209209
@@ -220,7 +220,7 @@ zero = "Zero translation"
220220
fileName: "file.go",
221221
file: `package main
222222
223-
import "github.com/nicksnyder/go-i18n/v2/i18n"
223+
import "github.com/KosyanMedia/go-i18n/i18n"
224224
225225
var m = &i18n.LocalizeConfig{
226226
Funcs: Funcs,
@@ -232,7 +232,7 @@ zero = "Zero translation"
232232
fileName: "file.go",
233233
file: `package main
234234
235-
import "github.com/nicksnyder/go-i18n/v2/i18n"
235+
import "github.com/KosyanMedia/go-i18n/i18n"
236236
237237
type ConstType string
238238

goi18n/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Command goi18n manages message files used by the i18n package.
22
//
3-
// go get -u github.com/nicksnyder/go-i18n/v2/goi18n
3+
// go get -u github.com/KosyanMedia/go-i18n/goi18n
44
// goi18n -help
55
//
66
// Use `goi18n extract` to create a message file that contains the messages defined in your Go source files.

goi18n/marshal.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"path/filepath"
88

99
"github.com/BurntSushi/toml"
10-
"github.com/nicksnyder/go-i18n/v2/i18n"
11-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
10+
"github.com/KosyanMedia/go-i18n/i18n"
11+
"github.com/KosyanMedia/go-i18n/internal/plural"
1212
"golang.org/x/text/language"
1313
yaml "gopkg.in/yaml.v2"
1414
)

goi18n/merge_command.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import (
99
"os"
1010

1111
"github.com/BurntSushi/toml"
12-
"github.com/nicksnyder/go-i18n/v2/i18n"
13-
"github.com/nicksnyder/go-i18n/v2/internal"
14-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
12+
"github.com/KosyanMedia/go-i18n/i18n"
13+
"github.com/KosyanMedia/go-i18n/internal"
14+
"github.com/KosyanMedia/go-i18n/internal/plural"
1515
"golang.org/x/text/language"
1616
yaml "gopkg.in/yaml.v2"
1717
)

i18n/bundle.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
7+
"github.com/KosyanMedia/go-i18n/internal/plural"
88

99
"golang.org/x/text/language"
1010
)

i18n/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55

66
"github.com/BurntSushi/toml"
7-
"github.com/nicksnyder/go-i18n/v2/i18n"
7+
"github.com/KosyanMedia/go-i18n/i18n"
88
"golang.org/x/text/language"
99
)
1010

i18n/localizer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
texttemplate "text/template"
66

7-
"github.com/nicksnyder/go-i18n/v2/i18n/template"
8-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
7+
"github.com/KosyanMedia/go-i18n/i18n/template"
8+
"github.com/KosyanMedia/go-i18n/internal/plural"
99
"golang.org/x/text/language"
1010
)
1111

i18n/localizer_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"reflect"
66
"testing"
77

8-
"github.com/nicksnyder/go-i18n/v2/i18n/template"
9-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
8+
"github.com/KosyanMedia/go-i18n/i18n/template"
9+
"github.com/KosyanMedia/go-i18n/internal/plural"
1010
"golang.org/x/text/language"
1111
)
1212

i18n/message_template.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55
texttemplate "text/template"
66

7-
"github.com/nicksnyder/go-i18n/v2/i18n/template"
8-
"github.com/nicksnyder/go-i18n/v2/internal"
9-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
7+
"github.com/KosyanMedia/go-i18n/i18n/template"
8+
"github.com/KosyanMedia/go-i18n/internal"
9+
"github.com/KosyanMedia/go-i18n/internal/plural"
1010
)
1111

1212
// MessageTemplate is an executable template for a message.

i18n/message_template_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"reflect"
55
"testing"
66

7-
"github.com/nicksnyder/go-i18n/v2/internal/plural"
7+
"github.com/KosyanMedia/go-i18n/internal/plural"
88
)
99

1010
func TestMessageTemplate(t *testing.T) {

internal/plural/rule_gen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func DefaultRules() Rules {
7575
return Other
7676
},
7777
})
78-
addPluralRules(rules, []string{"af", "an", "asa", "az", "bal", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "mr", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sd", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}, &Rule{
78+
addPluralRules(rules, []string{"af", "an", "asa", "az", "bal", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "mr", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sd", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tg", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}, &Rule{
7979
PluralForms: newPluralFormSet(One, Other),
8080
PluralFormFunc: func(ops *Operands) Form {
8181
// n = 1

internal/plural/rule_gen_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func TestTzm(t *testing.T) {
105105
}
106106
}
107107

108-
func TestAfAnAsaAzBalBemBezBgBrxCeCggChrCkbDvEeElEoEuFoFurGswHaHawHuJgoJmcKaKajKcgKkKkjKlKsKsbKuKyLbLgMasMgoMlMnMrNahNbNdNeNnNnhNoNrNyNynOmOrOsPapPsRmRofRwkSaqSdSdhSehSnSoSqSsSsyStSyrTaTeTeoTigTkTnTrTsUgUzVeVoVunWaeXhXog(t *testing.T) {
108+
func TestAfAnAsaAzBalBemBezBgBrxCeCggChrCkbDvEeElEoEuFoFurGswHaHawHuJgoJmcKaKajKcgKkKkjKlKsKsbKuKyLbLgMasMgoMlMnMrNahNbNdNeNnNnhNoNrNyNynOmOrOsPapPsRmRofRwkSaqSdSdhSehSnSoSqSsSsyStSyrTaTeTeoTgTigTkTnTrTsUgUzVeVoVunWaeXhXog(t *testing.T) {
109109
var tests []pluralFormTest
110110

111111
tests = appendIntegerTests(tests, One, []string{"1"})
@@ -114,7 +114,7 @@ func TestAfAnAsaAzBalBemBezBgBrxCeCggChrCkbDvEeElEoEuFoFurGswHaHawHuJgoJmcKaKajK
114114
tests = appendIntegerTests(tests, Other, []string{"0", "2~16", "100", "1000", "10000", "100000", "1000000"})
115115
tests = appendDecimalTests(tests, Other, []string{"0.0~0.9", "1.1~1.6", "10.0", "100.0", "1000.0", "10000.0", "100000.0", "1000000.0"})
116116

117-
locales := []string{"af", "an", "asa", "az", "bal", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "mr", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sd", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}
117+
locales := []string{"af", "an", "asa", "az", "bal", "bem", "bez", "bg", "brx", "ce", "cgg", "chr", "ckb", "dv", "ee", "el", "eo", "eu", "fo", "fur", "gsw", "ha", "haw", "hu", "jgo", "jmc", "ka", "kaj", "kcg", "kk", "kkj", "kl", "ks", "ksb", "ku", "ky", "lb", "lg", "mas", "mgo", "ml", "mn", "mr", "nah", "nb", "nd", "ne", "nn", "nnh", "no", "nr", "ny", "nyn", "om", "or", "os", "pap", "ps", "rm", "rof", "rwk", "saq", "sd", "sdh", "seh", "sn", "so", "sq", "ss", "ssy", "st", "syr", "ta", "te", "teo", "tg", "tig", "tk", "tn", "tr", "ts", "ug", "uz", "ve", "vo", "vun", "wae", "xh", "xog"}
118118
for _, locale := range locales {
119119
runTests(t, locale, tests)
120120
}

internal/template.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package internal
33
import (
44
"sync"
55

6-
"github.com/nicksnyder/go-i18n/v2/i18n/template"
6+
"github.com/KosyanMedia/go-i18n/i18n/template"
77
)
88

99
// Template stores the template for a string and a cached version of the parsed template if they are cacheable.

internal/template_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
texttemplate "text/template"
77

8-
"github.com/nicksnyder/go-i18n/v2/i18n/template"
8+
"github.com/KosyanMedia/go-i18n/i18n/template"
99
)
1010

1111
func TestExecute(t *testing.T) {

0 commit comments

Comments
 (0)