els-intl-addon
Advanced tools
Comparing version 1.0.3 to 1.0.4
32
index.js
@@ -57,2 +57,21 @@ const flat = require("flat"); | ||
function recursiveIntlTranslationsSearch(hashMap, startPath) { | ||
const localizations = fs.readdirSync(startPath); | ||
localizations.forEach((fileName) => { | ||
const extName = path.extname(fileName); | ||
const localization = path.basename(fileName, extName); | ||
const filePath = path.join(startPath, fileName); | ||
try { | ||
if (fs.lstatSync(filePath).isDirectory()) { | ||
recursiveIntlTranslationsSearch(hashMap, filePath); | ||
} else { | ||
const file = objFromFile(filePath); | ||
addToHashMap(hashMap, file, localization); | ||
} | ||
} catch (e) { | ||
console.log("e", e); | ||
} | ||
}); | ||
} | ||
function getTranslations(root) { | ||
@@ -63,14 +82,3 @@ const hashMap = {}; | ||
if (fs.existsSync(intlEntry)) { | ||
const localizations = fs.readdirSync(intlEntry); | ||
localizations.forEach(fileName => { | ||
const extName = path.extname(fileName); | ||
const localization = path.basename(fileName, extName); | ||
const filePath = path.join(intlEntry, fileName); | ||
try { | ||
const file = objFromFile(filePath); | ||
addToHashMap(hashMap, file, localization); | ||
} catch (e) { | ||
console.log("e", e); | ||
} | ||
}); | ||
recursiveIntlTranslationsSearch(hashMap, intlEntry); | ||
} else if (fs.existsSync(i18nEntry)) { | ||
@@ -77,0 +85,0 @@ const localizations = fs.readdirSync(i18nEntry); |
{ | ||
"name": "els-intl-addon", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Ember Language Server intl extension", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7741
8
163