Skip to content

Commit 2a5c303

Browse files
committedMay 11, 2023
Allow more untranslated strings due to recent commits
1 parent 90e71f3 commit 2a5c303

File tree

3 files changed

+518
-1006
lines changed

3 files changed

+518
-1006
lines changed
 

‎.github/ABANDONED.md

+43-1,001
Large diffs are not rendered by default.

‎.github/TRANSLATIONS.md

+470-2
Large diffs are not rendered by default.

‎generate-translations.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ const abandoned = {}
99
const source = jsonfile.readFileSync('./lang/en.json')
1010
const keys = Object.keys(source)
1111

12+
const maxMissingKeys = 153
13+
1214
glob('./lang/*.json', {}, async function (er, files) {
1315
await Promise.all(
1416
files.map(async filename => {
1517
const lang = filename.replace(/^(.+\/)([a-zA-Z0-9-]+)(\.json)$/, '$2')
1618
if (lang !== 'en') {
1719
const json = jsonfile.readFileSync(filename)
1820
const missingKeys = keys.filter(x => !Object.keys(json).includes(x))
19-
if (missingKeys.length < 100) {
21+
if (missingKeys.length <= maxMissingKeys) {
2022
unordered[lang] = missingKeys
2123
missing = missing.concat(unordered[lang])
2224
} else {
@@ -65,7 +67,7 @@ glob('./lang/*.json', {}, async function (er, files) {
6567
if (Object.keys(abandoned).length > 0) {
6668
output =
6769
output +
68-
'The following translations have more than 100 untranslated strings **' +
70+
'The following translations have more than ' + maxMissingKeys + ' untranslated strings **' +
6971
Object.keys(abandoned).join('**, **') +
7072
'**, [are you able to help?](./ABANDONED.md)\n\n'
7173
}
@@ -145,7 +147,7 @@ glob('./lang/*.json', {}, async function (er, files) {
145147
source[sourceKey].replace(/\n/g, '\\n') +
146148
'",\n'
147149
})
148-
output = output.substr(0, output.length - 2) + '\n```\n'
150+
output = output.substring(0, output.length - 2) + '\n```\n'
149151
})
150152
write('./.github/ABANDONED.md', output)
151153
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.