Unverified Commit 421db984 authored by Eric_Lee's avatar Eric_Lee Committed by GitHub

修复语言设置无效的问题 (#84)

parent 8c252932
......@@ -51,7 +51,7 @@ func (c *Config) EnsureConfigValid() {
if c.LanguageCode != "" && c.Language == "" {
c.Language = c.LanguageCode
}
if c.Language == ""{
if c.Language == "" {
c.Language = "zh"
}
// 确保至少有一个认证
......
......@@ -41,7 +41,7 @@ func (mi *MenuItem) Text() string {
type Menu []MenuItem
func init() {
func Initial() {
defaultTitle = utils.WrapperTitle(i18n.T("Welcome to use Jumpserver open source fortress system"))
menu = Menu{
{id: 1, instruct: "ID", helpText: i18n.T("directly login")},
......
......@@ -9,7 +9,7 @@ import (
"github.com/jumpserver/koko/pkg/config"
)
func init() {
func Initial()() {
cf := config.GetConf()
localePath := path.Join(cf.RootPath, "locale")
if strings.HasPrefix(cf.Language, "zh") {
......
......@@ -9,6 +9,7 @@ import (
"github.com/jumpserver/koko/pkg/config"
"github.com/jumpserver/koko/pkg/httpd"
"github.com/jumpserver/koko/pkg/i18n"
"github.com/jumpserver/koko/pkg/logger"
"github.com/jumpserver/koko/pkg/service"
"github.com/jumpserver/koko/pkg/sshd"
......@@ -45,6 +46,7 @@ func RunForever() {
func bootstrap() {
config.Initial()
i18n.Initial()
logger.Initial()
service.Initial()
Initial()
......
......@@ -15,6 +15,7 @@ import (
var sshServer *ssh.Server
func StartServer() {
handler.Initial()
conf := config.GetConf()
hostKey := HostKey{Value: conf.HostKey, Path: conf.HostKeyFile}
logger.Debug("Loading host key")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment