From 86f92208bf594ee98345910794e9e61237481da9 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Sat, 13 Apr 2024 11:15:24 +0800 Subject: [PATCH] :art: Improve mobile app appearance language https://github.com/siyuan-note/siyuan/issues/11009 --- kernel/model/conf.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/kernel/model/conf.go b/kernel/model/conf.go index d5b27a56f..eac91b466 100644 --- a/kernel/model/conf.go +++ b/kernel/model/conf.go @@ -132,8 +132,20 @@ func InitConf() { } if "" != util.Lang { - Conf.Lang = util.Lang - logging.LogInfof("initialized the specified language [%s]", util.Lang) + initialized := false + if util.ContainerAndroid == util.Container || util.ContainerIOS == util.Container { + // 移动端以上次设置的外观语言为准 + if "" != Conf.Lang && util.Lang != Conf.Lang { + util.Lang = Conf.Lang + logging.LogInfof("use the last specified language [%s]", util.Lang) + initialized = true + } + } + + if !initialized { + Conf.Lang = util.Lang + logging.LogInfof("initialized the specified language [%s]", util.Lang) + } } else { if "" == Conf.Lang { // 未指定外观语言时使用系统语言