mirror of
https://github.com/dscalzi/HeliosLauncher.git
synced 2024-12-23 04:02: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){
|
exports.queryJS = function(id){
|
||||||
return exports.query(`js.${id}`)
|
return exports.query(`js.${id}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exports.queryEJS = function(id){
|
||||||
|
return exports.query(`ejs.${id}`)
|
||||||
|
}
|
@ -2,6 +2,11 @@
|
|||||||
"html": {
|
"html": {
|
||||||
"avatarOverlay": "Edit"
|
"avatarOverlay": "Edit"
|
||||||
},
|
},
|
||||||
|
"ejs": {
|
||||||
|
"landing": {
|
||||||
|
"news": "NEWS"
|
||||||
|
}
|
||||||
|
},
|
||||||
"js": {
|
"js": {
|
||||||
"login": {
|
"login": {
|
||||||
"error": {
|
"error": {
|
||||||
|
@ -133,7 +133,7 @@
|
|||||||
</defs>
|
</defs>
|
||||||
<polyline class="arrowLine" points="0.71 13.26 12.56 1.41 24.16 13.02"/>
|
<polyline class="arrowLine" points="0.71 13.26 12.56 1.41 24.16 13.02"/>
|
||||||
</svg>
|
</svg>
|
||||||
<span id="newsButtonText">NEWS</span>
|
<span id="newsButtonText"><%- lang('landing.news') %></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
6
index.js
6
index.js
@ -12,6 +12,10 @@ const semver = require('semver')
|
|||||||
const { pathToFileURL } = require('url')
|
const { pathToFileURL } = require('url')
|
||||||
const { AZURE_CLIENT_ID, MSFT_OPCODE, MSFT_REPLY_TYPE, MSFT_ERROR, SHELL_OPCODE } = require('./app/assets/js/ipcconstants')
|
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.
|
// Setup auto updater.
|
||||||
function initAutoUpdater(event, data) {
|
function initAutoUpdater(event, data) {
|
||||||
|
|
||||||
@ -237,6 +241,8 @@ function createWindow() {
|
|||||||
remoteMain.enable(win.webContents)
|
remoteMain.enable(win.webContents)
|
||||||
|
|
||||||
ejse.data('bkid', Math.floor((Math.random() * fs.readdirSync(path.join(__dirname, 'app', 'assets', 'images', 'backgrounds')).length)))
|
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())
|
win.loadURL(pathToFileURL(path.join(__dirname, 'app', 'app.ejs')).toString())
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user