mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
Merge pull request #3307 from overleaf/jpa-i18n-fixes
[misc] i18n fixes GitOrigin-RevId: 862acff0a96b3717f1410327d1dcc469268f5e30
This commit is contained in:
@@ -19,6 +19,13 @@ async function run() {
|
||||
const json = JSON.parse(content)
|
||||
|
||||
for (const [code, lang] of Object.entries(json)) {
|
||||
if (code === 'en-GB') {
|
||||
// OneSky does not have read-after-write consistency.
|
||||
// Skip the dump of English locales, which may not include locales
|
||||
// that were just uploaded.
|
||||
continue
|
||||
}
|
||||
|
||||
for (let [key, value] of Object.entries(lang.translation)) {
|
||||
// Handle multi-line strings as arrays by joining on newline
|
||||
if (Array.isArray(value)) {
|
||||
@@ -27,9 +34,8 @@ async function run() {
|
||||
lang.translation[key] = sanitize(value)
|
||||
}
|
||||
|
||||
const outputLngCode = code === 'en-GB' ? 'en' : code
|
||||
await fs.writeFile(
|
||||
`${__dirname}/../../locales/${outputLngCode}.json`,
|
||||
`${__dirname}/../../locales/${code}.json`,
|
||||
JSON.stringify(lang.translation, null, 2) + '\n'
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user