globalizejs / globalizejs/globalize
How to handle if locale folder missing for any module (e.g.) number module ?
- Dominant language
- JavaScript
- Stars
- 4.8k
- Forks
- 585
- PR merge metrics
- No merged PRs in 30d
Description
I am initializing Globalize dynamically, How should I handle if the selected locale's cldr data missing?
```
locale = $("#selectedLocale").val());
$.ajaxSetup({ async: false });
const likelySubtags = $.getJSON("../../node_modules/cldr-data/supplemental/likelySubtags.json");
const numberingSystems = $.getJSON("../../node_modules/cldr-data/supplemental/numberingSystems.json");
const numbers = $.getJSON("../../node_modules/cldr-numbers-full/main/" + locale+ "/numbers.json");
Globalize.load(likelySubtags.responseJSON);
Globalize.load(numberingSystems.responseJSON);
Globalize.load(numbers.responseJSON);
$.ajaxSetup({ async: true });
Globalize.locale(locale);
```
Contributor guide
Assessment
This issue has not been assessed yet.