Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: clean-up pre-CLDR 39 safety check #46606

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 4 additions & 10 deletions packages/common/locales/generate-locales-tool/cldr-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,11 @@ export class CldrData {
for (const localeName of allLocales) {
const localeData = this.getLocaleData(localeName);

// If `cldrjs` is unable to resolve a `bundle` for the current locale, then there is no data
// for this locale, and it should not be generated. This can happen as with older versions of
// CLDR where `availableLocales.json` specifies locales for which no data is available
// (even within the `full` tier packages). See:
// http://cldr.unicode.org/development/development-process/design-proposals/json-packaging.
// TODO(devversion): Remove if we update to CLDR v39 where this seems fixed. Note that this
// worked before in the Gulp tooling without such a check because the `cldr-data-downloader`
// overwrote the `availableLocales` to only capture locales with data.
if (localeData !== null) {
localesWithData.push(localeData);
if (localeData === null) {
throw new Error(`Missing locale data for the "${localeName}" locale.`);
}

localesWithData.push(localeData);
}

return localesWithData;
Expand Down