Giter Club home page Giter Club logo

Comments (11)

minggo avatar minggo commented on June 16, 2024

It may be related to this: https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#internationalization-support

I don't understand why regular expression is related to internationalization.

from cocos-engine.

smallmain avatar smallmain commented on June 16, 2024

它可能与此相关:https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#internationalization-support

我不明白为什么正则表达式与国际化相关。

image

Since RegExp Unicode Property Escapes are matched in a language-aware way, which requires ICU data (International Components for Unicode), which can be optionally included in NodeJS builds, So I suspect that Cocos' V8 builds don't include this data, since it works fine on other platforms.

https://github.com/tc39/proposal-regexp-unicode-property-escapes

And, theoretically, all the functions listed in the table should not work in their entirety without including this data.

from cocos-engine.

minggo avatar minggo commented on June 16, 2024

Got it, thanks.

Yep, the ICU module is not included in v8 to reduce size. We will take a look how to provide it.

from cocos-engine.

smallmain avatar smallmain commented on June 16, 2024

Got it, thanks.

Yep, the ICU module is not included in v8 to reduce size. We will take a look how to provide it.

RegExp's Unicode support is very important. If you want to correctly segment Chinese words, Emoji, etc., this is the simplest and most correct method. If the engine does not support it, the user also needs to increase the size of the polyfill.

Hope it gets taken seriously.

from cocos-engine.

minggo avatar minggo commented on June 16, 2024

Sure, we will resolve it.

from cocos-engine.

dumganhar avatar dumganhar commented on June 16, 2024

I built the same v8 version used in cocos creator 3.8.3, its size will increase 4MB (zip packed in APK) or 10MB (so size, not packed). I think only some people need this functionality. So I don't suggest to include v8 with INTL by default.
WeChatb814ccd88f65032510148c8f716d2bd8

You could download the v8 with INTL support here ( https://github.com/cocos/v8/releases/tag/11.6.189.22-intl-support ) and replace the libv8_monolith.a in engine/native/external directory.

I will write a documentation about how to enable v8 INTL support.

from cocos-engine.

smallmain avatar smallmain commented on June 16, 2024

I built the same v8 version used in cocos creator 3.8.3, its size will increase 4MB (zip packed in APK) or 10MB (so size, not packed). I think only some people need this functionality. So I don't suggest to include v8 with INTL by default. WeChatb814ccd88f65032510148c8f716d2bd8

You could download the v8 with INTL support here ( https://github.com/cocos/v8/releases/tag/11.6.189.22-intl-support ) and replace the libv8_monolith.a in engine/native/external directory.

I will write a documentation about how to enable v8 INTL support.

Can you add a option to build panel?

from cocos-engine.

dumganhar avatar dumganhar commented on June 16, 2024

Can you add a option to build panel?

It will be more work to do.

  1. [developing] Add a UI item in build panel to switch v8 with or without INTL support
  2. [developing] CMake file should be updated to link different libv8_monolith.a
  3. [testing] Test work for QA team on each platform will be doubled

If there're many developers need this functionality, we will consider to add a radio button for easier switching v8 with or without INTL support.

@minggo What's your opinion?

from cocos-engine.

minggo avatar minggo commented on June 16, 2024

I agree with @dumganhar . It may take more resource to add a new feature. Especially we should make every new feature work correctly on all platforms for every version.

from cocos-engine.

smallmain avatar smallmain commented on June 16, 2024

I agree with @dumganhar . It may take more resource to add a new feature. Especially we should make every new feature work correctly on all platforms for every version.

@minggo @dumganhar

我们不是有扩展和实验室机制吗?
Don't we have extensions and lab mechanisms?

我们既然能通过扩展发布了 shader-graphl10n 这两个 BUG 非常多、可用性不高的功能,通过实验室发布几乎不可用和很难用的 原生引擎场景,那么我觉得就应该利用这两个机制提高我们引擎特性的迭代速度,将 [testing] 环节完全简化或去除。
Now that we've been able to release 'shader-graph' and 'l10n' buggier and less usable features through extensions, and release 'native engine scenes' that are almost impossible and difficult to use through LABS, I think we should use these two mechanisms to improve the speed of feature iteration. Simplify or remove [testing] entirely.

当然,这个 Intl 貌似只有我反馈,虽然我很惊讶,但可能确实 Cocos 开发者大部分都没完善的国际化支持需求,仅提供文档我可以理解。
Of course, this' Intl 'seems to be my only feedback, and while I'm surprised, it's probably true that most Cocos developers don't need this.

from cocos-engine.

minggo avatar minggo commented on June 16, 2024

Don't we have extensions and lab mechanisms?

Extension and lab mechanism is used for the feature that we want to support but it is not ready. And we want to reduce it as few as possible.

Of course, this' Intl 'seems to be my only feedback, and while I'm surprised, it's probably true that most Cocos developers don't need this.

We will support in when more developers need it.

from cocos-engine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.