mirror of https://github.com/mue/mue.git
feat(dev): add remove unused translation string support to script
This commit is contained in:
parent
6d315974cc
commit
259eab31c6
|
@ -11,7 +11,17 @@ fs.readdirSync('../src/translations').forEach((file) => {
|
|||
require('../src/translations/en_GB.json'),
|
||||
require('../src/translations/' + file),
|
||||
);
|
||||
|
||||
// remove unused strings
|
||||
const en = require('../src/translations/en_GB.json');
|
||||
const keys = Object.keys(newdata);
|
||||
const enkeys = Object.keys(en);
|
||||
const unused = keys.filter((key) => !enkeys.includes(key));
|
||||
unused.forEach((key) => {
|
||||
delete newdata[key];
|
||||
});
|
||||
fs.writeFileSync('../src/translations/' + file, JSON.stringify(newdata, null, 2));
|
||||
|
||||
// add new line
|
||||
fs.appendFileSync('../src/translations/' + file, '\n');
|
||||
});
|
||||
|
|
|
@ -87,7 +87,6 @@ body {
|
|||
|
||||
/* fonts (imported from fontsource) */
|
||||
// i don't even know what the unicode-range is for, but we're keeping it so that nothing breaks
|
||||
// same reason as why fontsource is never updated, it broke font loading last time so it flashed
|
||||
@font-face {
|
||||
font-family: 'Lexend Deca';
|
||||
font-style: normal;
|
||||
|
|
Loading…
Reference in New Issue