mirror of
https://github.com/leanote/desktop-app.git
synced 2026-01-13 07:03:04 +08:00
初始跟随系统默认语言
This commit is contained in:
@@ -39,6 +39,7 @@ if(process.platform != 'darwin') {
|
||||
<section id="box">
|
||||
<div class="drag"></div>
|
||||
<div>
|
||||
<div class="faq" onclick="openExternal('https://github.com/leanote/desktop-app/issues/225')"><i class="fa fa-question-circle"></i></div>
|
||||
<h1 id="logo">
|
||||
<a onclick="openExternal('https://leanote.com')" id="loadingLogo" title="leanote">
|
||||
<span class="logo"></span>
|
||||
|
||||
@@ -644,9 +644,9 @@ function log(o) {
|
||||
|
||||
<script src="public/config.js"></script>
|
||||
<script src="public/js/jquery-1.9.0.min.js"></script>
|
||||
<script src="public/js/lang.js"></script>
|
||||
<script src="public/js/jquery.ztree.all-3.5.js"></script>
|
||||
<script src="public/js/app/service.js"></script>
|
||||
<script src="public/js/lang.js"></script>
|
||||
<script src="public/js/common.js"></script>
|
||||
<script>
|
||||
var UrlPrefix = 'app://leanote';
|
||||
|
||||
@@ -854,3 +854,15 @@ body.loading {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
.faq {
|
||||
position: fixed;
|
||||
top: 2px;
|
||||
right: 8px;
|
||||
cursor: pointer;
|
||||
color: #aaa;
|
||||
z-index: 1000;
|
||||
&:hover {
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,20 @@ var lang = {
|
||||
// 读取语言, 修改html
|
||||
init: function() {
|
||||
var me = this;
|
||||
var curLang = Config['lang'] || 'en-us';
|
||||
var defaultLang = 'en-us';
|
||||
|
||||
var sysLang = app.getLocale();
|
||||
if (sysLang) {
|
||||
sysLang = sysLang.toLowerCase();
|
||||
}
|
||||
|
||||
var curLang = Config['lang'] || sysLang || defaultLang;
|
||||
langData = me.readJson('public/langs/' + curLang + '.js');
|
||||
if(!langData) {
|
||||
return;
|
||||
langData = me.readJson('public/langs/' + defaultLang + '.js');
|
||||
if (!langData) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// 设为全局
|
||||
window.curLang = curLang;
|
||||
|
||||
Reference in New Issue
Block a user