Commit 66fd1cd1 authored by mercury233's avatar mercury233

Merge branch 'i18n-temp'

parents 2396832c d2cb3f5b
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
"welcome": "MyCard YGOPro Server", "welcome": "MyCard YGOPro Server",
"update": "请更新游戏版本", "update": "请更新游戏版本",
"stop": false, "stop": false,
"lang": "zh-cn",
"tips": { "tips": {
"enabled": true, "enabled": true,
"get": false "get": false
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -4,6 +4,8 @@ _.mixin(_.str.exports()) ...@@ -4,6 +4,8 @@ _.mixin(_.str.exports())
Struct = require('./struct.js').Struct Struct = require('./struct.js').Struct
i18ns = require './i18n.json'
#常量/类型声明 #常量/类型声明
structs_declaration = require './structs.json' #结构体声明 structs_declaration = require './structs.json' #结构体声明
typedefs = require './typedefs.json' #类型声明 typedefs = require './typedefs.json' #类型声明
...@@ -116,6 +118,9 @@ for name, declaration of structs_declaration ...@@ -116,6 +118,9 @@ for name, declaration of structs_declaration
for line in _.lines(msg) for line in _.lines(msg)
if player>=10 if player>=10
line="[System]: "+line line="[System]: "+line
for o,r of i18ns[client.lang]
re=new RegExp("\\$\\{"+o+"\\}",'g')
line=line.replace(re,r)
@stoc_send client, 'CHAT', { @stoc_send client, 'CHAT', {
player: player player: player
msg: line msg: line
......
// Generated by CoffeeScript 1.12.1 // Generated by CoffeeScript 1.12.1
(function() { (function() {
var Struct, _, declaration, field, i, len, name, result, structs_declaration, type, typedefs; var Struct, _, declaration, field, i, i18ns, len, name, result, structs_declaration, type, typedefs;
_ = require('underscore'); _ = require('underscore');
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
Struct = require('./struct.js').Struct; Struct = require('./struct.js').Struct;
i18ns = require('./i18n.json');
structs_declaration = require('./structs.json'); structs_declaration = require('./structs.json');
typedefs = require('./typedefs.json'); typedefs = require('./typedefs.json');
...@@ -167,7 +169,7 @@ ...@@ -167,7 +169,7 @@
}; };
this.stoc_send_chat = function(client, msg, player) { this.stoc_send_chat = function(client, msg, player) {
var j, len1, line, ref; var j, len1, line, o, r, re, ref, ref1;
if (player == null) { if (player == null) {
player = 8; player = 8;
} }
...@@ -181,6 +183,12 @@ ...@@ -181,6 +183,12 @@
if (player >= 10) { if (player >= 10) {
line = "[System]: " + line; line = "[System]: " + line;
} }
ref1 = i18ns[client.lang];
for (o in ref1) {
r = ref1[o];
re = new RegExp("\\$\\{" + o + "\\}", 'g');
line = line.replace(re, r);
}
this.stoc_send(client, 'CHAT', { this.stoc_send(client, 'CHAT', {
player: player, player: player,
msg: line msg: line
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment