mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-22 19:52:14 -08:00
First step to use Language .json file in ejs
This commit is contained in:
parent
92f2aab2a1
commit
1695b51cf8
@ -19,3 +19,7 @@ exports.query = function(id){
|
||||
exports.queryJS = function(id){
|
||||
return exports.query(`js.${id}`)
|
||||
}
|
||||
|
||||
exports.queryEJS = function(id){
|
||||
return exports.query(`ejs.${id}`)
|
||||
}
|
@ -2,6 +2,11 @@
|
||||
"html": {
|
||||
"avatarOverlay": "Edit"
|
||||
},
|
||||
"ejs": {
|
||||
"landing": {
|
||||
"news": "NEWS"
|
||||
}
|
||||
},
|
||||
"js": {
|
||||
"login": {
|
||||
"error": {
|
||||
|
@ -133,7 +133,7 @@
|
||||
</defs>
|
||||
<polyline class="arrowLine" points="0.71 13.26 12.56 1.41 24.16 13.02"/>
|
||||
</svg>
|
||||
<span id="newsButtonText">NEWS</span>
|
||||
<span id="newsButtonText"><%- lang('landing.news') %></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
6
index.js
6
index.js
@ -12,6 +12,10 @@ const semver = require('semver')
|
||||
const { pathToFileURL } = require('url')
|
||||
const { AZURE_CLIENT_ID, MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR, SHELL_OPCODE } = require('./app/assets/js/ipcconstants')
|
||||
|
||||
// Setup Lang
|
||||
const LangLoader = require('./app/assets/js/langloader')
|
||||
LangLoader.loadLanguage('en_US')
|
||||
|
||||
// Setup auto updater.
|
||||
function initAutoUpdater(event, data) {
|
||||
|
||||
@ -237,6 +241,8 @@ function createWindow() {
|
||||
remoteMain.enable(win.webContents)
|
||||
|
||||
ejse.data('bkid', Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)))
|
||||
ejse.data('Lang', LangLoader)
|
||||
ejse.data('lang', LangLoader.queryEJS)
|
||||
|
||||
win.loadURL(pathToFileURL(path.join(__dirname, 'app', 'app.ejs')).toString())
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user