mirror of
https://github.com/mue/mue.git
synced 2026-06-08 14:10:42 +02:00
feat(dev): add remove unused translation string support to script
This commit is contained in:
@@ -11,7 +11,17 @@ fs.readdirSync('../src/translations').forEach((file) => {
|
|||||||
require('../src/translations/en_GB.json'),
|
require('../src/translations/en_GB.json'),
|
||||||
require('../src/translations/' + file),
|
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));
|
fs.writeFileSync('../src/translations/' + file, JSON.stringify(newdata, null, 2));
|
||||||
|
|
||||||
// add new line
|
// add new line
|
||||||
fs.appendFileSync('../src/translations/' + file, '\n');
|
fs.appendFileSync('../src/translations/' + file, '\n');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -87,7 +87,6 @@ body {
|
|||||||
|
|
||||||
/* fonts (imported from fontsource) */
|
/* fonts (imported from fontsource) */
|
||||||
// i don't even know what the unicode-range is for, but we're keeping it so that nothing breaks
|
// 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-face {
|
||||||
font-family: 'Lexend Deca';
|
font-family: 'Lexend Deca';
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
|
|||||||
Reference in New Issue
Block a user