mirror of
https://github.com/yuzu-emu/liftinstall.git
synced 2024-11-22 11:35:43 +01:00
21 lines
597 B
JavaScript
Executable File
21 lines
597 B
JavaScript
Executable File
#!/bin/env node
|
|
const fs = require('fs')
|
|
const merge = require('deepmerge')
|
|
const glob = require('glob')
|
|
|
|
glob('src/locales/!(messages).json', {}, (e, files) => {
|
|
let messages = []
|
|
for (const file of files) {
|
|
console.log(`Loading ${file}...`)
|
|
const locale_messages = require(`./${file}`)
|
|
messages.push(locale_messages)
|
|
}
|
|
console.log('Merging messages...')
|
|
if (messages && messages.length > 1) {
|
|
messages = merge.all(messages)
|
|
} else {
|
|
messages = messages[0] // single locale mode
|
|
}
|
|
fs.writeFileSync('src/locales/messages.json', JSON.stringify(messages), {})
|
|
})
|