cocos-creator-packages / i18n Goto Github PK
View Code? Open in Web Editor NEWi18n for Label and Sprites
i18n for Label and Sprites
第一次提问,不知道问题是否该提在这里,如果不是请见谅。。。
错误描述:
在Label节点设置为非Active的情况下,通过菜单/扩展/i18n/open打开设置时报错。
错误日志:
Failed to update localized label, label component is invalid!
at LocalizedLabel.updateLabel (file:///[Project Path]/library/bundle.project.js?014:185:16)
at Object.updateSceneRenderers (file:///[Project Path]/library/bundle.project.js?014:93:19)
at Object.update-default-language ([Project Path]\packages\i18n\scene-script.js:6:18)
at Object.Panel._dispatch ([Installation Path]\resources\app.asar\editor-framework\lib\renderer\panel.js:1:2294)
at EventEmitter. ([Installation Path]\resources\app.asar\editor-framework\lib\renderer\ipc.js:1:5098)
at emitMany (events.js:127:13)
at EventEmitter.emit (events.js:201:7)
分析:
当Label节点为非Active时,其LocalizedLabel组件onload方法没有执行,导致了fetchRender也没有执行,this.label属性为空。这时updateSceneRenderers方法只调用了updateLabel而没有执行fetchRender,故导致了以上报错。
how to use in typescript?
This option is not present anywhere in Cocos Creator v2.4.3. It's not there in the Extensions as well. How to find it? How to use it?
RT
I'm using:
I import it like all the examples:
const i18n = require("LanguageData");
It works well in local development and from the GUI build. But if I use the command line build, it shows the following error:
[23008] Start building assets
[23008] Start spawn build-worker
[23008] Finish spawn build-worker
[23008] Start init build-worker
[23008] load script [LanguageData] failed : Error: Cannot find module 'LanguageData'
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename [as _resolveFilenameVendor] (C:\CocosCreator\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.s._resolveFilename (C:\CocosCreator\resources\app.asar\editor\page\project-scripts.js:1:941)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.cc.require (C:\CocosCreator\resources\app.asar\editor\page\project-scripts.js:1:589)
at C:\project-folder\temp\quick-scripts\assets\scripts\components\managers\networkManager.js:1:377
at __define (C:\project-folder\temp\quick-scripts\assets\scripts\components\managers\networkManager.js:20:12)
at C:\project-folder\temp\quick-scripts\assets\scripts\components\managers\networkManager.js:127:13
To build I use:
C:\CocosCreator\CocosCreator.exe --path . --build "platform=web-desktop;inlineSpriteFrames=true;debug=false"
Any solutions? We need command line build for Jenkins
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.