2

We are using Globalize for some time now, but only for messages without plurals, so we only needed supplemental/likelySubtags in our application.

Now that we want to use all modules, we also need to add the CLDR data. And we discovered that loading all required cldr datasets ( supplemental/likelySubtags, supplemental/numberingSystems, supplemental/plurals, supplemental/ordinals, supplemental/currencyData, supplemental/timeData, supplemental/weekData, main/{locale}/numbers, main/{locale}/currencies, main/{locale}/ca-gregorian, main/{locale}/timeZoneNames, main/{locale}/dateFields, main/{locale}/units )

We end up with 150K for the main data and 150K per locale. This is quite big and we feel it's not optimal.

Is there a way to reduce this ? strip some parts of these files that are never used by globalize anyway ?

We tried Globalize compiler, it doesn't seem to help for that problem as we need to provide it our CLDR data, and it seems it's not able to strip out what isn't actually needed.

Stéphane Goetz
  • 682
  • 1
  • 7
  • 16
  • Please, can you expand your explanation on why Globalize compiler can't help you. Basically why "you need to provide it our CLDR data"? Thanks – Rafael Xavier Jan 26 '17 at 08:50
  • In the example (https://github.com/globalizejs/globalize/blob/master/examples/globalize-compiler/) The compiler command : `globalize-compiler -l en -c cldr.json ... ` You have to provide your own cldr data. and it doesn't reduce the amount of data that's inside. – Stéphane Goetz Jan 26 '17 at 19:21
  • (Re: You have to provide your own cldr data) That happens at build time and there's no problem it's the big vanilla CLDR, right. (Re: and it doesn't reduce the amount of data that's inside) Correct, it doesn't touch the data, instead it generates a .JS file that has the minimum set of data+code that sets up your formatters. Please, why can't you use that instead (which includes further optimizations)? – Rafael Xavier Jan 30 '17 at 12:33
  • I will have a look at it again, if it still does what I think it does, I will post a gist/github repo with an example – Stéphane Goetz Jan 31 '17 at 13:41

0 Answers0