Skip to content

Commit 0bb017d

Browse files
authored
Merge pull request #299 from gz-c/add-zh
Add simplified chinese translation
2 parents dc81d10 + 40d36dd commit 0bb017d

File tree

5 files changed

+240
-11
lines changed

5 files changed

+240
-11
lines changed

src/app/app.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ export const languageConfig = {
4545
code: 'es',
4646
name: 'Español',
4747
iconName: 'es.png'
48+
},
49+
{
50+
code: 'zh',
51+
name: '中文',
52+
iconName: 'zh.png'
4853
}
4954
],
5055
defaultLanguage: 'en'

src/assets/i18n/check.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@ const fs = require('fs');
66
// Initial configuration
77
/////////////////////////////////////////////
88

9-
console.log('Starting to check the languaje files.', '\n');
9+
console.log('Starting to check the language files.', '\n');
1010

1111
// Load the current English file.
1212
if (!fs.existsSync('en.json')) {
13-
exitWithError('Unable to find the English languaje file.');
13+
exitWithError('Unable to find the English language file.');
1414
}
1515
let currentData = JSON.parse(fs.readFileSync('en.json', 'utf8'));
1616

17-
// 2 charaters code of the languajes that will be checked.
17+
// 2 charaters code of the languages that will be checked.
1818
const langs = [];
1919
// If false, the code will only verify the differences in the elements (ignoring its contents) of the
2020
// base files and the files with the translations. If not, the code will also verify the differences
2121
// in the elements and contents of the base files and the current English file.
2222
let checkFull = false;
2323

24-
// If a param was send, it must be "all" or the 2 charaters code of the languaje that must be checked.
24+
// If a param was send, it must be "all" or the 2 charaters code of the language that must be checked.
2525
// If a param is provided, checkFull is set to true.
2626
if (process.argv.length > 2) {
2727
if (process.argv.length > 3) {
@@ -38,7 +38,7 @@ if (process.argv.length > 2) {
3838
checkFull = true;
3939
}
4040

41-
// If no languaje code was send as param, the code will check all languajes.
41+
// If no language code was send as param, the code will check all languages.
4242
if (langs.length === 0) {
4343
let localFiles = fs.readdirSync('./');
4444

@@ -69,11 +69,11 @@ if (langs.length === 0) {
6969
});
7070

7171
if (langs.length === 0) {
72-
exitWithError('No languaje files to check.');
72+
exitWithError('No language files to check.');
7373
}
7474
}
7575

76-
console.log('Checking the following languajes:');
76+
console.log('Checking the following languages:');
7777
langs.forEach(lang => {
7878
console.log(lang);
7979
});
@@ -119,7 +119,7 @@ langs.forEach(lang => {
119119
let translationData = JSON.parse(fs.readFileSync(lang + '.json', 'utf8'));
120120

121121
if (!fs.existsSync(lang + '_base.json')) {
122-
exitWithError('Unable to find the ' + lang + '_base.json languaje file.');
122+
exitWithError('Unable to find the ' + lang + '_base.json language file.');
123123
}
124124
let baseTranslationData = JSON.parse(fs.readFileSync(lang + '_base.json', 'utf8'));
125125

@@ -189,15 +189,15 @@ function updateErrorSumary() {
189189
}
190190
}
191191

192-
// Checks all arrays for errors. This loop is for the languajes.
192+
// Checks all arrays for errors. This loop is for the languages.
193193
for (let i = 0; i < baseFileOnly.length; i++) {
194194

195195
// This loop if for checking all the arrays.
196196
[baseFileOnly, translatedFileOnly, enOnly, translatedOnly, different].forEach((array, idx) => {
197197
// If the array has elements, it means that errors were found.
198198
if (array[i].elements.length > 0) {
199199
updateErrorSumary();
200-
200+
201201
// Show the appropriate error text according to the current array.
202202
if (idx === 0) {
203203
console.log('The \"' + baseFileOnly[i].lang + '_base.json\" base file has elements that are not present in \"' + baseFileOnly[i].lang + '.json\":');
@@ -227,4 +227,4 @@ if (!failedValidation) {
227227
function exitWithError(errorMessage) {
228228
console.log('Error: ' + errorMessage)
229229
process.exit(1);
230-
}
230+
}

src/assets/i18n/zh.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"general": {
3+
"coinIdentifier": "SKY",
4+
"address": "地址",
5+
"coins": "",
6+
"iniialHours": "原始币时",
7+
"calculatedHours": "最终币时",
8+
"currentHours": "当前币时",
9+
"hours": "币时",
10+
"pending": "待处理",
11+
"loadingMsg": "加载...",
12+
"shortLoadingErrorMsg": "加载错误",
13+
"longLoadingErrorMsg": "加载数据时出错,请稍后重试...",
14+
"waitingData": "等待数据...",
15+
"noData": "没有可显示的数据"
16+
},
17+
"txBoxes": {
18+
"transactionID": "交易ID",
19+
"inputs": "输入",
20+
"outputs": "输出",
21+
"date": "日期",
22+
"balance": "更多信息",
23+
"fee": "交易费用 (以币时计算)",
24+
"initialBalance": "原始币时余额",
25+
"finalBalance": "最终币余额",
26+
"firstSeen": "首先看到",
27+
"loadAll": "展示 {{total}} 元素",
28+
"loading": "加载中, 请稍后..."
29+
},
30+
"blocks": {
31+
"blocksTitle": "区块",
32+
"statsTitle": "统计",
33+
"blockHeight": "区块高度",
34+
"currentSupply": "目前供应量",
35+
"totalSupply": "总供应量",
36+
"currentCoinhourSupply": "目前币时供应",
37+
"totalCoinhourSupply": "总币时供应",
38+
"explorerApi": "Explorer API",
39+
"unconfirmedTransactions": "未确认交易",
40+
"richList": "富豪榜",
41+
"time": "时间",
42+
"blockNumber": "区块数量",
43+
"blockNumberSmall": "区块 #",
44+
"transactions": "交易",
45+
"blockhash": "区块哈希"
46+
},
47+
"blockDetails": {
48+
"title": "区块详情",
49+
"next": "下一个区块",
50+
"previous": "上一个区块",
51+
"height": "高度",
52+
"timestamp": "时间戳",
53+
"size": "大小",
54+
"hash": "哈希",
55+
"parentHash": "初始哈希",
56+
"totalAmount": "总数值",
57+
"withoutParent": "无初始哈希",
58+
"doesNotExist": "区块 \"{{number}}\" 不存在"
59+
},
60+
"addressDetail": {
61+
"title": "地址",
62+
"txsNumber": "# 的交易",
63+
"totalReceived": "总共收取",
64+
"totalSent": "总共发出",
65+
"currentBalance": "当前币额",
66+
"hoursBalance": "当前币时数",
67+
"tools": "工具",
68+
"unspentOutputs": "未花费输出",
69+
"withoutTransactions": "没有交易"
70+
},
71+
"unspentOutputs": {
72+
"title": "未花费输出",
73+
"address": "地址",
74+
"outputsNumber": "# 的输出",
75+
"totalCoins": "总币额",
76+
"totalHours": "总币时",
77+
"origin": "初始值",
78+
"date": "日期",
79+
"withoutOutputs": "没有输出"
80+
},
81+
"transactionDetail": {
82+
"title": "交易",
83+
"status": "状态",
84+
"timestamp": "时间戳",
85+
"size": "大小",
86+
"block": "区块",
87+
"confirmed": "已确认",
88+
"unconfirmed": "未确认",
89+
"canNotFind": "没有找到交易"
90+
},
91+
"unconfirmedTx": {
92+
"title": "未确认交易",
93+
"quantity": "数量",
94+
"size": "总大小",
95+
"newest": "最新的",
96+
"oldest": "最旧的",
97+
"withoutTransactions": "目前没有未确认交易"
98+
},
99+
"richlist": {
100+
"title": "富豪榜"
101+
},
102+
"copy": {
103+
"copied": "已复制"
104+
},
105+
"searchBar": {
106+
"hint": "地址,区块哈希或数量,或交易ID"
107+
},
108+
"search": {
109+
"title": "搜索",
110+
"unableToFind": "未能找到 \"{{ term }}\""
111+
}
112+
}

src/assets/i18n/zh_base.json

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
{
2+
"general": {
3+
"coinIdentifier": "SKY",
4+
"address": "Address",
5+
"coins": "Coins",
6+
"iniialHours": "Initial Hours",
7+
"calculatedHours": "Final Hours",
8+
"currentHours": "Current Hours",
9+
"hours": "Hours",
10+
"pending": "pending",
11+
"loadingMsg": "Loading...",
12+
"shortLoadingErrorMsg": "Loading error",
13+
"longLoadingErrorMsg": "Error loading data, try again later...",
14+
"waitingData": "Waiting for data...",
15+
"noData": "No data to show"
16+
},
17+
"txBoxes": {
18+
"transactionID": "Transaction ID",
19+
"inputs": "Inputs",
20+
"outputs": "Outputs",
21+
"date": "Date",
22+
"balance": "More info",
23+
"fee": "Transaction fee (in hours)",
24+
"initialBalance": "Initial coins balance",
25+
"finalBalance": "Final coins balance",
26+
"firstSeen": "First seen at",
27+
"loadAll": "Show all {{total}} elements",
28+
"loading": "Loading, please wait..."
29+
},
30+
"blocks": {
31+
"blocksTitle": "Blocks",
32+
"statsTitle": "Stats",
33+
"blockHeight": "Block Height",
34+
"currentSupply": "Current Supply",
35+
"totalSupply": "Total Supply",
36+
"currentCoinhourSupply": "Current Coinhour Supply",
37+
"totalCoinhourSupply": "Total Coinhour Supply",
38+
"explorerApi": "Explorer API",
39+
"unconfirmedTransactions": "Unconfirmed Transactions",
40+
"richList": "Rich List",
41+
"time": "Time",
42+
"blockNumber": "Block Number",
43+
"blockNumberSmall": "Block #",
44+
"transactions": "Transactions",
45+
"blockhash": "Blockhash"
46+
},
47+
"blockDetails": {
48+
"title": "Block Details",
49+
"next": "Next block",
50+
"previous": "Previous block",
51+
"height": "Height",
52+
"timestamp": "Timestamp",
53+
"size": "Size",
54+
"hash": "Hash",
55+
"parentHash": "Parent Hash",
56+
"totalAmount": "Total Amount",
57+
"withoutParent": "Without parent block",
58+
"doesNotExist": "The block \"{{number}}\" does not exist"
59+
},
60+
"addressDetail": {
61+
"title": "Address",
62+
"txsNumber": "# of Transactions",
63+
"totalReceived": "Total Received",
64+
"totalSent": "Total Sent",
65+
"currentBalance": "Current Coins",
66+
"hoursBalance": "Current Hours",
67+
"tools": "Tools",
68+
"unspentOutputs": "Unspent outputs",
69+
"withoutTransactions": "Without transactions"
70+
},
71+
"unspentOutputs": {
72+
"title": "Unspent Outputs",
73+
"address": "Address",
74+
"outputsNumber": "# of outputs",
75+
"totalCoins": "Total Coins",
76+
"totalHours": "Total Hours",
77+
"origin": "Origin",
78+
"date": "Date",
79+
"withoutOutputs": "Without outputs"
80+
},
81+
"transactionDetail": {
82+
"title": "Transaction",
83+
"status": "Status",
84+
"timestamp": "Timestamp",
85+
"size": "Size",
86+
"block": "Block",
87+
"confirmed": "Confirmed",
88+
"unconfirmed": "Unconfirmed",
89+
"canNotFind": "Unable to find the transaction"
90+
},
91+
"unconfirmedTx": {
92+
"title": "Unconfirmed Transactions",
93+
"quantity": "Quantity",
94+
"size": "Total Size",
95+
"newest": "Newest",
96+
"oldest": "Oldest",
97+
"withoutTransactions": "Currently there are no unconfirmed transactions"
98+
},
99+
"richlist": {
100+
"title": "Rich List"
101+
},
102+
"copy": {
103+
"copied": "Copied"
104+
},
105+
"searchBar": {
106+
"hint": "Address, block hash or number, or transaction ID"
107+
},
108+
"search": {
109+
"title": "Search",
110+
"unableToFind": "Unable to find \"{{ term }}\""
111+
}
112+
}

src/assets/img/lang/zh.png

1.03 KB
Loading

0 commit comments

Comments
 (0)