How to use the @phensley/cldr-core.availableLocales function in @phensley/cldr-core

To help you get started, we’ve selected a few @phensley/cldr-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phensley / cldr-engine / packages / cldr-compiler / src / rbnf / collector.ts View on Github external
// compact each tag to language-script with region if specified
        const tag = parseLanguageTag(name);
        const max = LanguageResolver.resolve(name);
        id = `${max.language()}-${max.script()}`;
        if (tag.hasRegion()) {
          id = `${id}-${max.region()}`;
        }
      }
      res.set(id, data);
      ids.push(id);
    }

    res.forEach((_, id) => this.populate(res, id));

    // Fill in the locales that have no RBNF mapping.
    for (const locale of availableLocales()) {
      const { tag } = locale;
      const id = `${tag.language()}-${tag.script()}`;
      if (res.has(id)) {
        continue;
      }
      // Default to 'en-Latn' spellout
      res.set(id, res.get('en-Latn')!);
      ids.push(id);
    }

    this.core.push('root');

    // Identify the rbnf rulesets that are globally-accessible. We need to
    // ensure that each locale that requires one of these has the correct
    // set of rbnf rulesets in its resource bundle.
    const { NumberingSystems } = getSupplemental();