2

For some weird reason, I'm getting this error:

Cannot satisfy requirements for "ext-locale"! [ERR] The following versions cannot be satisfied: [ERR] App: ext-locale (No matches!) [ERR] Cannot resolve package requirements

Per official instructions, I added the requires to app.json

"classic": {
        "requires": [
            "ext-locale"
        ]
    },

I'm using the universal template:

"template": "universalclassicmodern"

I looked at @sencha/ext-classic/ but I can't see a locale directory there.

Do I have to manually install the package via npm?

John Smith
  • 1,848
  • 3
  • 13
  • 24

2 Answers2

2

If you use the Classic or Modern template: Try to change the code like this. Open app.json file, in global requires.

"requires": [
        "font-awesome",
        "locale"
    ],
"locale":"zh_CN",  //!!!Your localization parameters

Configure specific build options

"production": {
        "requires": [
            "locale"
        ],
        "locale":"zh_CN", //!!!Your localization parameters
        ...
},
"testing": {
    "requires": [
        "locale"
    ],
    "locale":"zh_CN",  //!!!Your localization parameters
    ...
},
"development": {
    "requires": [
        "locale"
    ],
    "locale":"zh_CN",  //!!!Your localization parameters
    ...
},

If you use the universal template,Try to change the code like this.Open app.json file, in global requires.

"requires": [
        "font-awesome",
        "locale"
    ],
"locale": "zh_CN",  //!!!Your localization parameters

Then according to the official documentation, add "ext-locale" to the "requires" under the Classic and Modern nodes

"classic": {
     "requires": [
        "ext-locale"
     ],
     "locale": "zh_CN",  //!!!Your localization parameters
     .....
},
"modern": {
     "requires": [
         "ext-locale"
      ],
      "locale": "zh_CN",  //!!!Your localization parameters
      ...
}
Panda666
  • 21
  • 3
  • I followed your exact instructions. Still no luck: [INF] Processing Build Descriptor : desktop (development environment) [ERR] Cannot satisfy requirements for "ext-locale"! [ERR] The following versions cannot be satisfied: [ERR] App: ext-locale (No matches!) [ERR] Cannot resolve package requirements Here's the entire file: https://pastebin.com/X7b5RNbj – John Smith Jul 08 '21 at 04:03
  • 1
    Did you try `locale` instead of `ext-locale` ? – Dinkheller Jul 12 '21 at 11:35
  • Yes, I tried using "locale" inside classic->requires but it throws this error: ```[INF] Processing Build Descriptor : desktop (development environment) [ERR] null``` – John Smith Jul 13 '21 at 21:58
  • I've revised my answer. I found it through my own tests these days – Panda666 Jul 15 '21 at 04:30
  • 2
    @Dinkheller seems that the problem happens only one you install ExtJS via NPM: ```ext-gen app -a -t universalclassicmodern -n myApp``` When you start project from the official .zip, it works, because it comes with classic/locale data. The NPM installation doesn't seem to bring the locales. Try it out. – John Smith Jul 16 '21 at 21:33
0

I finally found the solution:

If you install ExtJS via npm, like:

ext-gen app -a -t universalclassicmodern -n myApp

You'll need to install localization packages separately with:

npm i @sencha/ext-classic-locale
npm i @sencha/ext-modern-locale

And in app.json, you only need these settings regarding localization:

"locale": "es", // <-- Your locale here
    "requires": [      
        "ext-locale"
    ],...

Seems that you don't need to specify the locale for each build/tookit.

This guide should be updated and explain it: https://docs.sencha.com/extjs/7.4.0/guides/core_concepts/localization.html

John Smith
  • 1,848
  • 3
  • 13
  • 24