Commit c4d5a9ef authored by 李维's avatar 李维

添加俄语化

parent afa147b8
......@@ -84,22 +84,22 @@
"__id__": 341
},
{
"__id__": 353
"__id__": 355
},
{
"__id__": 361
"__id__": 363
}
],
"_active": true,
"_components": [
{
"__id__": 365
"__id__": 367
},
{
"__id__": 366
"__id__": 368
},
{
"__id__": 367
"__id__": 369
}
],
"_prefab": null,
......@@ -5261,7 +5261,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "batXaqPwxEjr+eSba0T8cl"
"_id": "11AwdVl/9MmrUTkB5DJuX1"
},
{
"__type__": "cc.Label",
......@@ -5296,7 +5296,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "1e5rcDYohG3p/yEe9tLD7j"
"_id": "f0YYFVij9HKpgxeO3voAQf"
},
{
"__type__": "cc.LabelOutline",
......@@ -5314,7 +5314,7 @@
"a": 255
},
"_width": 3,
"_id": "8dDeFbJ+dOSbYLjVUvgF5V"
"_id": "8b2Mn/UWVLY4CekBD2wg+W"
},
{
"__type__": "cc.RichText",
......@@ -5469,7 +5469,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "f7Ck6VaKZIt7AltosH6rpC"
"_id": "12YMFWGc9ATpGDwI58StHI"
},
{
"__type__": "cc.Label",
......@@ -5504,7 +5504,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "60oMWrQtFC/ZHQaGNV7QEr"
"_id": "fbMULc6sBH/qrA2mTr53Od"
},
{
"__type__": "cc.LabelOutline",
......@@ -5522,7 +5522,7 @@
"a": 255
},
"_width": 7,
"_id": "f3RylIFBtGw4ySzdoGYfR7"
"_id": "c83605yS9O8pkGw8aXDeRU"
},
{
"__type__": "cc.RichText",
......@@ -8812,7 +8812,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "7bdtMlf9BK5qEOUAklP5Kq"
"_id": "03OjPdtzJKyaaZih2gMkhM"
},
{
"__type__": "cc.Label",
......@@ -8847,7 +8847,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "3cpqLO4+JHCLLVkPsw7CHN"
"_id": "3dlNA1fRxAK4PaK9OUa36p"
},
{
"__type__": "cc.LabelOutline",
......@@ -8865,7 +8865,7 @@
"a": 255
},
"_width": 7,
"_id": "a7tMuadYFInbRhLR8xXoxY"
"_id": "6dmrrWUItFE7VOvk3Bc9lZ"
},
{
"__type__": "cc.RichText",
......@@ -9020,7 +9020,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "8fGU/SDyVKlrasblL6946m"
"_id": "8csDTIn/JIMYuLCyYPkwmo"
},
{
"__type__": "cc.Label",
......@@ -9055,7 +9055,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "46kkKSAtBA4oQRkQurTw72"
"_id": "7a8ZBwAq9K4bGSm+9E+5Xu"
},
{
"__type__": "cc.LabelOutline",
......@@ -9073,7 +9073,7 @@
"a": 255
},
"_width": 3,
"_id": "dbwfssL8lPyKXrDmIUXF0/"
"_id": "35NVXSj6FDfZW4PRUr5Am3"
},
{
"__type__": "cc.RichText",
......@@ -12166,7 +12166,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "40furCUzVKe5Zj+zQOkQQR"
"_id": "6djfsUwxhC0odz3jgPSPZB"
},
{
"__type__": "cc.Label",
......@@ -12201,7 +12201,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "21kVcB0C5DHoMEh9W0XMOn"
"_id": "7b6M0EuwVLLJXbpfUw4eDF"
},
{
"__type__": "cc.LabelOutline",
......@@ -12219,7 +12219,7 @@
"a": 255
},
"_width": 7,
"_id": "b2udEc06pHPrYbExawZ/YG"
"_id": "ea/CbllldFsJmXIMWkhvL7"
},
{
"__type__": "cc.RichText",
......@@ -12374,7 +12374,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "e6P3W/EqhBSrcrEAI4mkKR"
"_id": "026Aw/RC5IZpMBAipRo0FQ"
},
{
"__type__": "cc.Label",
......@@ -12409,7 +12409,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "a4cs/nDpFMK5ejsVkaATDR"
"_id": "9bTY2iD2dGPrzUztXrhoPp"
},
{
"__type__": "cc.LabelOutline",
......@@ -12427,7 +12427,7 @@
"a": 255
},
"_width": 3,
"_id": "7a477BzfZBNqlUVebhlLTu"
"_id": "e9RE/K5cZMWruGDQx0ptIq"
},
{
"__type__": "cc.RichText",
......@@ -15717,7 +15717,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "acxZZtj35BPb+S7zXfHPkj"
"_id": "72ddJSGe5FvYW43QvAV9Kg"
},
{
"__type__": "cc.Label",
......@@ -15752,7 +15752,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "7cG9S4VqlJf5wZUYEChWdl"
"_id": "ebGIQ33qhEIY1POuq7Uzla"
},
{
"__type__": "cc.LabelOutline",
......@@ -15770,7 +15770,7 @@
"a": 255
},
"_width": 7,
"_id": "94JQixkGxDIpZGVoQU8ooR"
"_id": "8cD/5buOJBE5VRKLZ5fZcC"
},
{
"__type__": "cc.RichText",
......@@ -15925,7 +15925,7 @@
"_groupIndex": 0,
"groupIndex": 0,
"showInEditor": false,
"_id": "8d4QRqVuFCSrYQh8q1hYHV"
"_id": "f50yMJdVxE4o8F7yg12TDL"
},
{
"__type__": "cc.Label",
......@@ -15960,7 +15960,7 @@
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "55oIvSucxOnJ+n5qZ2FKEG"
"_id": "acUbX1P9lOHacsJ9Q5lfik"
},
{
"__type__": "cc.LabelOutline",
......@@ -15978,7 +15978,7 @@
"a": 255
},
"_width": 3,
"_id": "4fnH6DF39F243BHwaYA7gv"
"_id": "62MQIbyUJK0q0gZucalKxK"
},
{
"__type__": "cc.RichText",
......@@ -16382,18 +16382,21 @@
},
{
"__id__": 348
},
{
"__id__": 350
}
],
"_active": true,
"_components": [
{
"__id__": 350
"__id__": 352
},
{
"__id__": 351
"__id__": 353
},
{
"__id__": 352
"__id__": 354
}
],
"_prefab": null,
......@@ -16748,7 +16751,7 @@
"__id__": 341
},
"_children": [],
"_active": true,
"_active": false,
"_components": [
{
"__id__": 349
......@@ -16834,6 +16837,100 @@
"_atlas": null,
"_id": "27ZteZwEJHpYZjQEqgZi+G"
},
{
"__type__": "cc.Node",
"_name": "textImg_ru",
"_objFlags": 0,
"_parent": {
"__id__": 341
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 351
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 82,
"height": 38
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0.524,
-58.257,
0,
0,
0,
0,
1,
1.2,
1.2,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "8dV1+mM/xFNrZP4Svr6LzX"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 350
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "bb218542-1dd2-4b88-bc4a-8f0f62553ab7"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "8eymMqpAhIrZDWQt+TUa84"
},
{
"__type__": "cc.Sprite",
"_name": "",
......@@ -16970,22 +17067,22 @@
},
"_children": [
{
"__id__": 354
"__id__": 356
},
{
"__id__": 356
"__id__": 358
}
],
"_active": true,
"_components": [
{
"__id__": 358
"__id__": 360
},
{
"__id__": 359
"__id__": 361
},
{
"__id__": 360
"__id__": 362
}
],
"_prefab": null,
......@@ -17041,13 +17138,13 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 353
"__id__": 355
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 355
"__id__": 357
}
],
"_prefab": null,
......@@ -17103,7 +17200,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 354
"__id__": 356
},
"_enabled": true,
"_materials": [
......@@ -17138,13 +17235,13 @@
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 353
"__id__": 355
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 357
"__id__": 359
}
],
"_prefab": null,
......@@ -17200,7 +17297,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 356
"__id__": 358
},
"_enabled": true,
"_materials": [
......@@ -17235,7 +17332,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 353
"__id__": 355
},
"_enabled": true,
"_materials": [
......@@ -17267,7 +17364,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 353
"__id__": 355
},
"_enabled": true,
"alignMode": 1,
......@@ -17294,7 +17391,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 353
"__id__": 355
},
"_enabled": true,
"_normalMaterial": null,
......@@ -17368,13 +17465,13 @@
"_active": true,
"_components": [
{
"__id__": 362
"__id__": 364
},
{
"__id__": 363
"__id__": 365
},
{
"__id__": 364
"__id__": 366
}
],
"_prefab": null,
......@@ -17430,7 +17527,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 361
"__id__": 363
},
"_enabled": true,
"_materials": [
......@@ -17462,7 +17559,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 361
"__id__": 363
},
"_enabled": true,
"alignMode": 1,
......@@ -17489,7 +17586,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 361
"__id__": 363
},
"_enabled": true,
"_normalMaterial": null,
......
import { asyncCallNetworkApiGet, asyncCallNetworkApiPost, asyncDelay, buttonOnClick, jumpToCourseWare, onHomeworkFinish, seekChildByName } from "../script/util";
import { MyCocosSceneComponent } from "../script/MyCocosSceneComponent";
import { lang as languageString, langConfig} from "../script/language_NJ_ShaMo"
const { ccclass, property } = cc._decorator;
......@@ -70,6 +71,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
orgId = 507;
localLanguage = "zh-cn"
async onLoadEnd() {
const middleLayer = cc.find('middleLayer');
if (middleLayer) {
......@@ -82,6 +84,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
await this.initData();
await this.initView();
this.localization();
this.initListener();
// 播放背景音乐
......@@ -127,6 +130,38 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
// 本地化
localization() {
const _middleLayer = cc.find('middleLayer');
if(!_middleLayer){
console.log("未检测到中间层,或中间层不支持getLocalLanguage, 使用默认语言")
this.setMoreGamesIcon(null);
return
}
const middleLayer = _middleLayer.getComponent('middleLayer')
if(!middleLayer || !middleLayer.getLocalLanguage) {
console.log("未检测到中间层,或中间层不支持getLocalLanguage, 使用默认语言")
this.setMoreGamesIcon(null);
return
}
this.localLanguage = middleLayer.getLocalLanguage();
this.setMoreGamesIcon(this.localLanguage);
}
// 小游戏字体
setMoreGamesIcon(lang) {
if(lang == "ru-ru") {
cc.find("Canvas/game/textImg").active = false;
cc.find("Canvas/game/textImg_ru").active = true;
} else {
cc.find("Canvas/game/textImg").active = true;
cc.find("Canvas/game/textImg_ru").active = false;
}
}
changeNodeGray(node) {
if (!node) {
return;
......@@ -170,11 +205,11 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (!row) {
middleLayerComponent.showTips("未解锁 [101]");
middleLayerComponent.showTips(languageString[this.localLanguage]["msg_unlockZ"]);
return;
}
if (row.locked) {
middleLayerComponent.showTips("为了保障拼读达人的学习效果,请按顺序学习哦!");
middleLayerComponent.showTips(languageString[this.localLanguage]["msg_need_finish_pre"]);
return;
}
if (i == 0) {
......@@ -194,7 +229,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (this.orgId == 507) {
const guideRow = res.rows.find(row => row.name == '指读索引');
if (!guideRow) {
middleLayerComponent.showTips("未配置‘指读索引’");
middleLayerComponent.showTips(languageString[this.localLanguage]["msg_no_config_002"]);
return;
}
middleLayerComponent.setData('NJ_game_select', {
......@@ -206,7 +241,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
jumpToCourseWare(guideRow.id);
} else {
if (res.rows.length == 0) {
middleLayerComponent.showTips("未制作");
middleLayerComponent.showTips(languageString[this.localLanguage]["msg_no_config_001"]);
return;
}
middleLayerComponent.setData('NJ_game_select', {
......@@ -228,7 +263,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
if (middleLayer) {
const middleLayerComponent = middleLayer.getComponent('middleLayer');
if (!this.moreGameFolder) {
middleLayerComponent.showTips("未解锁 [101]");
middleLayerComponent.showTips(languageString[this.localLanguage]["msg_unlock"]);
return;
}
middleLayerComponent.setData('NJ_MoreGames', {
......
export const lang = {
"zh-cn": {
"msg_need_login": "需要登录后才能使用,去登录吗?",
"msg_unlock": "未解锁 [101]",
"msg_app_update_restart": "应用程序已更新,请退出程序重新打开!",
"msg_need_finish_pre": "为了保障拼读达人的学习效果,请按顺序学习哦!",
"msg_no_config_001": "未制作",
"msg_no_config_002": "未配置‘指读索引’",
},
"ru-ru": {
"msg_need_login": "Чтобы использовать его, вам необходимо войти в систему. Хотите войти?",
"msg_unlock": "Не разблокировано [101]",
"msg_app_update_restart": "Приложение обновлено, пожалуйста, выйдите из программы и откройте ее заново!",
"msg_need_finish_pre": "Чтобы обеспечить эффект обучения мастеров правописания, пожалуйста, учитесь по порядку!",
"msg_no_config_001": "Не производится",
"msg_no_config_002": "Не настроено — относится к индексу чтения",
},
}
export const langConfig = {
"zh-cn": {
},
"ru-ru": {
}
}
\ No newline at end of file
{
"ver": "1.0.8",
"uuid": "4314d976-23a3-4617-b8ae-df2470de702f",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
{
"ver": "2.3.5",
"uuid": "5aab5572-7ff3-4127-99cb-9c54f24cd01f",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 82,
"height": 52,
"platformSettings": {},
"subMetas": {
"text_games_ru": {
"ver": "1.0.4",
"uuid": "bb218542-1dd2-4b88-bc4a-8f0f62553ab7",
"rawTextureUuid": "5aab5572-7ff3-4127-99cb-9c54f24cd01f",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 7,
"width": 82,
"height": 38,
"rawWidth": 82,
"rawHeight": 52,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
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