feat: atalhos de navegação Q/E e correções no i18n
This commit is contained in:
41
fix_i18n.cjs
Normal file
41
fix_i18n.cjs
Normal file
@@ -0,0 +1,41 @@
|
||||
const fs = require('fs');
|
||||
let content = fs.readFileSync('src/lib/i18n.js', 'utf8');
|
||||
|
||||
// The broken string is like:
|
||||
// weatherCurrentAvg: "{current,
|
||||
// registeredPieces: "Peças Registadas",
|
||||
// ...
|
||||
// }°C Atual • Média {avg}°C",
|
||||
|
||||
// PT
|
||||
content = content.replace(
|
||||
/weatherCurrentAvg: "\{current,([\s\S]*?)down: "Baixo",\n\}\°C Atual • Média \{avg\}\°C",/g,
|
||||
`weatherCurrentAvg: "{current}°C Atual • Média {avg}°C",\n$1down: "Baixo",`
|
||||
);
|
||||
|
||||
// EN
|
||||
content = content.replace(
|
||||
/weatherCurrentAvg: "\{current,([\s\S]*?)down: "Down",\n\}\°C Current • Average \{avg\}\°C",/g,
|
||||
`weatherCurrentAvg: "{current}°C Current • Average {avg}°C",\n$1down: "Down",`
|
||||
);
|
||||
|
||||
// ES
|
||||
content = content.replace(
|
||||
/weatherCurrentAvg: "\{current,([\s\S]*?)down: "Abajo",\n\}\°C Actual • Media \{avg\}\°C",/g,
|
||||
`weatherCurrentAvg: "{current}°C Actual • Media {avg}°C",\n$1down: "Abajo",`
|
||||
);
|
||||
|
||||
// FR
|
||||
content = content.replace(
|
||||
/weatherCurrentAvg: "\{current,([\s\S]*?)down: "Bas",\n\}\°C Actuel • Moyenne \{avg\}\°C",/g,
|
||||
`weatherCurrentAvg: "{current}°C Actuel • Moyenne {avg}°C",\n$1down: "Bas",`
|
||||
);
|
||||
|
||||
// DE
|
||||
content = content.replace(
|
||||
/weatherCurrentAvg: "\{current,([\s\S]*?)down: "Runter",\n\}\°C Aktuell • Durchschnitt \{avg\}\°C",/g,
|
||||
`weatherCurrentAvg: "{current}°C Aktuell • Durchschnitt {avg}°C",\n$1down: "Runter",`
|
||||
);
|
||||
|
||||
fs.writeFileSync('src/lib/i18n.js', content);
|
||||
console.log('Fixed i18n.js syntax errors.');
|
||||
Reference in New Issue
Block a user