Skip to content

Commit 23be1e5

Browse files
committed
Implement new API for gotext
1 parent cbfd799 commit 23be1e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Diff for: internal/i18n/i18n_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
)
2626

2727
func setPo(poFile string) {
28-
po = new(gotext.Po)
28+
po = gotext.NewPo()
2929
po.Parse([]byte(poFile))
3030
}
3131

@@ -39,7 +39,7 @@ func TestPoTranslation(t *testing.T) {
3939
}
4040

4141
func TestNoLocaleSet(t *testing.T) {
42-
po = new(gotext.Po)
42+
po = gotext.NewPo()
4343
require.Equal(t, "test-key", Tr("test-key"))
4444
}
4545

Diff for: internal/i18n/locale.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var po *gotext.Po
2828
var contents embed.FS
2929

3030
func init() {
31-
po = new(gotext.Po)
31+
po = gotext.NewPo()
3232
}
3333

3434
func supportedLocales() []string {
@@ -75,6 +75,6 @@ func setLocale(locale string) {
7575
if err != nil {
7676
panic("Error reading embedded i18n data: " + err.Error())
7777
}
78-
po = new(gotext.Po)
78+
po = gotext.NewPo()
7979
po.Parse(poFile)
8080
}

0 commit comments

Comments
 (0)