Skip to content

Commit

Permalink
fix: used root package from proj when using i18n4go in source
Browse files Browse the repository at this point in the history
  • Loading branch information
Aerex committed Jul 12, 2024
1 parent 178d19b commit 05c7a75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion i18n4go/i18n/i18n_init.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package i18n

import "path/filepath"

var T TranslateFunc

func init() {
T = Init("", GetResourcesPath(), func(asset string) ([]byte, error) {
T = Init("", filepath.Join("i18n4go", GetResourcesPath()), func(asset string) ([]byte, error) {
return Asset(asset)
})
}
2 changes: 1 addition & 1 deletion i18n4go/i18n/i18n_init.go.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package __PACKAGE__NAME__
import (
"path/filepath"

i18n "github.com/maximilien/i18n4go/i18n4go/i18n"
"github.com/maximilien/i18n4go/i18n4go/i18n"
)

var T goi18n.TranslateFunc
Expand Down
2 changes: 1 addition & 1 deletion i18n4go/i18n/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var SUPPORTED_LOCALES = map[string]string{
"zh": "zh_CN",
}
var (
RESOURCES_PATH = filepath.Join("i18n4go", "i18n", "resources")
RESOURCES_PATH = filepath.Join("i18n", "resources")
bundle *go_i18n.Bundle
)

Expand Down

0 comments on commit 05c7a75

Please sign in to comment.