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

To help you get started, we’ve selected a few 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 SpongePowered / sponge-docs-theme / src / homepage / data / cldr.js View on Github external
new Promise((resolve, reject) => {
        try {
            const Cldr = require('cldrjs');
            Cldr.load(require('cldr-core/supplemental/likelySubtags'));

            // Load all bundles
            for (locale of require('cldr-core/availableLocales').availableLocales.modern) {
                Cldr.load(require(`cldr-localenames-modern/main/${locale}/languages`))
            }

            resolve(new CldrLanguages(Cldr))
        } catch (err) {
            reject(err)
        }
    });