mirror of https://github.com/1Panel-dev/1Panel
feat: Add pt-BR support for i18n (#7261)
parent
e6a772ebfd
commit
7202de6f4c
|
@ -99,11 +99,15 @@ func Init() {
|
||||||
_, _ = bundle.LoadMessageFileFS(fs, "lang/en.yaml")
|
_, _ = bundle.LoadMessageFileFS(fs, "lang/en.yaml")
|
||||||
_, _ = bundle.LoadMessageFileFS(fs, "lang/zh-Hant.yaml")
|
_, _ = bundle.LoadMessageFileFS(fs, "lang/zh-Hant.yaml")
|
||||||
_, _ = bundle.LoadMessageFileFS(fs, "lang/fa.yaml")
|
_, _ = bundle.LoadMessageFileFS(fs, "lang/fa.yaml")
|
||||||
|
_, _ = bundle.LoadMessageFileFS(fs, "lang/pt.yaml")
|
||||||
}
|
}
|
||||||
|
|
||||||
func UseI18nForCmd(lang string) {
|
func UseI18nForCmd(lang string) {
|
||||||
if lang == "" {
|
if lang == "" {
|
||||||
lang = "zh"
|
lang = "en"
|
||||||
|
}
|
||||||
|
if lang == "pt-BR" {
|
||||||
|
lang = "pt"
|
||||||
}
|
}
|
||||||
if bundle == nil {
|
if bundle == nil {
|
||||||
Init()
|
Init()
|
||||||
|
|
|
@ -16,7 +16,7 @@ import (
|
||||||
var language string
|
var language string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
RootCmd.PersistentFlags().StringVarP(&language, "language", "l", "zh", "Set the language (default is 'zh')")
|
RootCmd.PersistentFlags().StringVarP(&language, "language", "l", "en", "Set the language")
|
||||||
}
|
}
|
||||||
|
|
||||||
var RootCmd = &cobra.Command{
|
var RootCmd = &cobra.Command{
|
||||||
|
|
Loading…
Reference in New Issue