forked from poooi/plugin-Akashic-records
-
Notifications
You must be signed in to change notification settings - Fork 0
/
akashic-records.es
67 lines (58 loc) · 1.28 KB
/
akashic-records.es
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
const { ROOT } = window
import 'views/env'
import 'views/battle-env'
const { $ } = window
import path from 'path-extra'
// i18n configure
const i18n = new (require('i18n-2'))({
locales: ['en-US', 'ja-JP', 'zh-CN', 'zh-TW'],
defaultLocale: 'zh-CN',
directory: path.join(__dirname, 'i18n'),
extension: '.json',
devMode: false,
})
i18n.setLocale(window.language)
window.__ = i18n.__.bind(i18n)
window.translate = i18n.translate.bind(i18n)
if (window.ipc == null) {
try {
const { remote } = window
window.ipc = remote.require('./lib/ipc')
} catch (e) {
if (process.env.DEBUG) {
// eslint-disable-next-line
console.log(e)
}
}
}
window.CONST = require(path.join(__dirname, 'lib', 'constant'))
let requirePass = false
try {
require('iconv-lite')
require('jschardet')
require('react-redux')
require('redux')
require('reselect')
requirePass = true
} catch (e) {
requirePass = false
}
switch (window.language) {
case 'ja-JP':
document.title = 'アカシックレコード'
break
case 'zh-CN':
document.title = '阿克夏记录'
break
case 'zh-TW':
document.title = '阿克夏紀錄'
break
default:
document.title = 'Akashic Records'
}
if (requirePass) {
require('./views')
} else {
require('./views/error')
}
require('./views/modal')