Skip to content

Commit 81841ec

Browse files
committed
feat: Add pt-BR support for i18n
1 parent f320492 commit 81841ec

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

backend/i18n/i18n.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ func Init() {
9999
_, _ = bundle.LoadMessageFileFS(fs, "lang/en.yaml")
100100
_, _ = bundle.LoadMessageFileFS(fs, "lang/zh-Hant.yaml")
101101
_, _ = bundle.LoadMessageFileFS(fs, "lang/fa.yaml")
102+
_, _ = bundle.LoadMessageFileFS(fs, "lang/pt.yaml")
102103
}
103104

104105
func UseI18nForCmd(lang string) {
105106
if lang == "" {
106-
lang = "zh"
107+
lang = "en"
108+
}
109+
if lang == "pt-BR" {
110+
lang = "pt"
107111
}
108112
if bundle == nil {
109113
Init()

cmd/server/cmd/root.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var language string
1717

1818
func init() {
19-
RootCmd.PersistentFlags().StringVarP(&language, "language", "l", "zh", "Set the language (default is 'zh')")
19+
RootCmd.PersistentFlags().StringVarP(&language, "language", "l", "en", "Set the language")
2020
}
2121

2222
var RootCmd = &cobra.Command{

0 commit comments

Comments
 (0)