Skip to content

Commit 7f33f82

Browse files
uubulbnaiba
andauthored
fix(i18n): replace hyphen with underscore (#524)
* fix(i18n): repleace hyphen with underscore * chore: upgrade user frontend --------- Co-authored-by: naiba <hi@nai.ba>
1 parent 6846c89 commit 7f33f82

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- uses: robinraju/release-downloader@v1
4646
with:
4747
repository: nezhahq/user-frontend
48-
tag: v1.0.6
48+
tag: v1.0.7
4949
fileName: dist.zip
5050
latest: true
5151
extract: true

service/singleton/i18n.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"bytes"
66
"fmt"
77
"log"
8+
"strings"
89

910
"github.com/nezhahq/nezha/pkg/i18n"
1011
)
@@ -25,6 +26,7 @@ func loadTranslation() error {
2526
lang = "zh_CN"
2627
}
2728

29+
lang = strings.Replace(lang, "-", "_", 1)
2830
data, err := getTranslationArchive(lang)
2931
if err != nil {
3032
return err
@@ -35,6 +37,7 @@ func loadTranslation() error {
3537
}
3638

3739
func OnUpdateLang(lang string) error {
40+
lang = strings.Replace(lang, "-", "_", 1)
3841
if Localizer.Exists(lang) {
3942
Localizer.SetLanguage(lang)
4043
return nil

0 commit comments

Comments
 (0)