Skip to content

Commit b1ced5e

Browse files
committed
Extract variable rc_files for clarity
I had accidentally applied sort() to the list of translation strings instead of the list of files, so this would have helped with that.
1 parent 4df5f53 commit b1ced5e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

localization/preprocess.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ const remove_ellipsis = str => str.replace("...", "");
3030
const only_unique = (value, index, self) => self.indexOf(value) === index;
3131

3232
const get_strings = (lang) => {
33-
return glob.sync(`${lang}/**/*.rc`, { cwd: __dirname, absolute: true }).sort((a, b) => a.localeCompare(b, "en")).map(
33+
const rc_files = glob.sync(`${lang}/**/*.rc`, { cwd: __dirname, absolute: true });
34+
rc_files.sort((a, b) => a.localeCompare(b, "en"));
35+
return rc_files.map(
3436
(rc_file) => parse_rc_file(fs.readFileSync(rc_file, "utf16le").replace(/\ufeff/g, ""))
3537
).flat();
3638
};

0 commit comments

Comments
 (0)