adapt-authoring-lang 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/check.js +4 -2
- package/package.json +1 -1
package/bin/check.js
CHANGED
|
@@ -52,10 +52,12 @@ async function getTranslatedStrings () {
|
|
|
52
52
|
await Promise.all((langPacks).map(async l => {
|
|
53
53
|
await Promise.all((await fs.readdir(l)).map(async f => {
|
|
54
54
|
const keys = JSON.parse(await fs.readFile(`${l}/${f}`))
|
|
55
|
-
const
|
|
55
|
+
const parts = f.replace(/\.json$/, '').split('.')
|
|
56
|
+
const lang = parts[0]
|
|
57
|
+
const id = parts[1] // undefined for {lang}.json files
|
|
56
58
|
if (!keyMap[lang]) keyMap[lang] = {}
|
|
57
59
|
Object.keys(keys)
|
|
58
|
-
.map(k => `${id}.${k}`)
|
|
60
|
+
.map(k => id ? `${id}.${k}` : k)
|
|
59
61
|
.forEach(k => {
|
|
60
62
|
keyMap[lang][k] = false
|
|
61
63
|
})
|