MCPcopy
hub / github.com/ampproject/amphtml / getLanguageStrings

Function getLanguageStrings

build-system/tasks/build-story-localization.js:47–55  ·  view source on GitHub ↗

* Reads the language files found in amp-story and stores it in a * Object. * @return {Promise }

()

Source from the content-addressed store, hash-verified

45 * @return {Promise<Object>}
46 */
47async function getLanguageStrings() {
48 const langs = Object.create(null);
49 const jsonFiles = await fastGlob(LOCALES_DIR);
50 for (const jsonFile of jsonFiles) {
51 const langKey = pathMod.basename(jsonFile, '.json');
52 langs[langKey] = readJson(jsonFile);
53 }
54 return langs;
55}
56
57/**
58 * Retrieves the fallback language codes for each current locale

Callers 1

Calls 2

readJsonFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected