()
| 178 | |
| 179 | // Main function to load the source file and update each target file |
| 180 | async function updateLocalizationFiles() { |
| 181 | const folders = [ |
| 182 | "src/locales", |
| 183 | "src/locales/dynamic", |
| 184 | "src/locales/sql-review", |
| 185 | "src/locales/subscription", |
| 186 | ]; |
| 187 | |
| 188 | for (const folder of folders) { |
| 189 | const sourceData = await loadJsonFile(`${folder}/${SOURCE_LANG}.json`); |
| 190 | for (const lang of TARGET_LANGS) { |
| 191 | const langFile = `${folder}/${lang}.json`; |
| 192 | const targetData = await loadJsonFile(langFile); |
| 193 | const updatedData = await addMissingKeysFromSource( |
| 194 | sourceData, |
| 195 | targetData, |
| 196 | lang.split("-")[0] |
| 197 | ); |
| 198 | await saveJsonFile(langFile, updatedData); |
| 199 | } |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | updateLocalizationFiles().catch(console.error); |
no test coverage detected