Skip to content

Commit 913b41c

Browse files
committed
chore: remove unused translations
1 parent 8565d35 commit 913b41c

File tree

11 files changed

+162
-78
lines changed

11 files changed

+162
-78
lines changed

i18n/locales/de.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
},
261261
"components": {
262262
"map_pools": {
263-
"view_on_steam": "Auf Steam ansehen"
263+
"view_on_steam": "Auf Steam anzeigen"
264264
}
265265
}
266266
},
@@ -964,7 +964,10 @@
964964
},
965965
"components": {
966966
"map_pools": {
967-
"view_on_steam": "Auf Steam ansehen"
967+
"view_on_steam": "Auf Steam anzeigen"
968968
}
969+
},
970+
"map_pools": {
971+
"edit_map": "Karte bearbeiten"
969972
}
970973
}

i18n/locales/en.json

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -208,21 +208,14 @@
208208
"map_pools": {
209209
"title": "Map Pools",
210210
"description": "Manage map pools and available maps for matchmaking.",
211-
"table": {
212-
"pool_name": "Pool Name",
213-
"maps": "Maps",
214-
"active_duty": "Active Duty",
215-
"available_modes": "Available Modes",
216-
"workshop_id": "Workshop ID"
217-
},
211+
"table": {},
218212
"form": {
219213
"name": "Name",
220214
"poster": "Poster (optional)",
221215
"poster_placeholder": "http://example.com/poster.png",
222216
"patch": "Patch (optional)",
223217
"patch_placeholder": "http://example.com/patch.png",
224218
"workshop_map_id": "Workshop Map ID (optional)",
225-
"view_on_steam": "View on Steam",
226219
"create_map": "Create Map",
227220
"update_map": "Update Map",
228221
"delete_map": "Delete Map",
@@ -242,26 +235,19 @@
242235
"update": "Error updating map"
243236
}
244237
},
245-
"edit_map": "Edit Map",
246-
"toggle_pool_type": "Map {map} has been {type} for {type}",
247-
"toggle_active_pool": "Map {map} has been {type} for active duty",
248-
"add_new_map": "Add New Map",
249238
"pool": {
250239
"title": "{type} Map Pool",
251240
"description": "Manage maps in the {type} pool",
252241
"modify_maps": "Modify maps in the pool"
253-
},
254-
"save_success": "Map pool saved successfully"
242+
}
255243
},
256244
"map_pool": {
257245
"toggle_pool_type": "Map {map} has been {type} for {type}",
258246
"toggle_active_pool": "Map {map} has been {type} for active duty",
259247
"save_success": "Map pool saved successfully"
260248
},
261249
"components": {
262-
"map_pools": {
263-
"view_on_steam": "View on Steam"
264-
}
250+
"map_pools": {}
265251
}
266252
},
267253
"layouts": {
@@ -966,5 +952,8 @@
966952
"map_pools": {
967953
"view_on_steam": "View on Steam"
968954
}
955+
},
956+
"map_pools": {
957+
"edit_map": "Edit Map"
969958
}
970-
}
959+
}

i18n/locales/es.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,5 +966,8 @@
966966
"map_pools": {
967967
"view_on_steam": "Ver en Steam"
968968
}
969+
},
970+
"map_pools": {
971+
"edit_map": "Editar mapa"
969972
}
970973
}

i18n/locales/fr.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,5 +966,8 @@
966966
"map_pools": {
967967
"view_on_steam": "Voir sur Steam"
968968
}
969+
},
970+
"map_pools": {
971+
"edit_map": "Modifier la carte"
969972
}
970973
}

i18n/locales/ja.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"maps": "マップ",
242242
"active_duty": "アクティブデューティ"
243243
},
244-
"edit_map": "編集マップ",
244+
"edit_map": "マップを編集",
245245
"toggle_pool_type": "{type} の {type} は {type} の {type} です",
246246
"toggle_active_pool": "アクティブデューティの {map} が {type} になりました",
247247
"add_new_map": "新規マップの追加",
@@ -260,7 +260,7 @@
260260
},
261261
"components": {
262262
"map_pools": {
263-
"view_on_steam": "Steamで見る"
263+
"view_on_steam": "Steamで表示"
264264
}
265265
}
266266
},
@@ -964,7 +964,7 @@
964964
},
965965
"components": {
966966
"map_pools": {
967-
"view_on_steam": "Steamで見る"
967+
"view_on_steam": "Steamで表示"
968968
}
969969
}
970970
}

i18n/locales/ru.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
},
261261
"components": {
262262
"map_pools": {
263-
"view_on_steam": "Смотреть в Steam"
263+
"view_on_steam": "Просмотреть в Steam"
264264
}
265265
}
266266
},
@@ -964,7 +964,7 @@
964964
},
965965
"components": {
966966
"map_pools": {
967-
"view_on_steam": "Смотреть в Steam"
967+
"view_on_steam": "Просмотреть в Steam"
968968
}
969969
}
970970
}

i18n/locales/sv.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
},
242242
"name": "Namn"
243243
},
244-
"edit_map": "Edit Map",
244+
"edit_map": "Redigera karta",
245245
"toggle_pool_type": "Karta {map} har varit {typ} för {typ}",
246246
"toggle_active_pool": "Karta {map} har varit {typ} för aktiv plikt",
247247
"add_new_map": "Lägg till ny karta",
@@ -260,7 +260,7 @@
260260
},
261261
"components": {
262262
"map_pools": {
263-
"view_on_steam": "Utsikt över Steam"
263+
"view_on_steam": "Visa på Steam"
264264
}
265265
}
266266
},
@@ -964,7 +964,7 @@
964964
},
965965
"components": {
966966
"map_pools": {
967-
"view_on_steam": "Utsikt över Steam"
967+
"view_on_steam": "Visa på Steam"
968968
}
969969
}
970970
}

i18n/locales/ua.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,14 @@
241241
},
242242
"name": "Назва"
243243
},
244-
"edit_map": "Редагування карти",
244+
"edit_map": "Редагувати карту",
245245
"toggle_pool_type": "Карта {map} {type} для {type}",
246246
"toggle_active_pool": "Карта {map} {type} для активних обов'язків",
247247
"add_new_map": "Додати нову карту",
248248
"pool": {
249249
"title": "{type} Карта Басейн",
250250
"description": "Керування картами в басейні {type}",
251-
"modify_maps": "Модифікувати карти в басейні"
251+
"modify_maps": "Модифікувати картини в басейні"
252252
},
253253
"save_success": "Карта басейну успішно збережено",
254254
"title": "Пул Карт"
@@ -260,7 +260,7 @@
260260
},
261261
"components": {
262262
"map_pools": {
263-
"view_on_steam": "Переглянути на Steam"
263+
"view_on_steam": "Переглянути в Steam"
264264
}
265265
}
266266
},
@@ -964,7 +964,7 @@
964964
},
965965
"components": {
966966
"map_pools": {
967-
"view_on_steam": "Переглянути на Steam"
967+
"view_on_steam": "Переглянути в Steam"
968968
}
969969
}
970970
}

i18n/locales/zh.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,5 +966,8 @@
966966
"map_pools": {
967967
"view_on_steam": "在Steam上查看"
968968
}
969+
},
970+
"map_pools": {
971+
"edit_map": "编辑地图"
969972
}
970973
}

scripts/check-translations.js

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,13 @@ function findUnusedTranslations(usedKeys, availableKeys) {
7676
// Function to find all translation files
7777
async function findAllTranslationFiles() {
7878
const files = await glob("i18n/locales/*.json");
79-
return files.map((file) => ({
80-
path: file,
81-
locale: path.basename(file, ".json"),
82-
}));
79+
// Filter to only include English translation file
80+
return files
81+
.filter(file => path.basename(file, ".json") === "en")
82+
.map((file) => ({
83+
path: file,
84+
locale: path.basename(file, ".json"),
85+
}));
8386
}
8487

8588
// Main function
@@ -160,48 +163,6 @@ async function main() {
160163
console.log(`Unused translations: ${unusedTranslations.length}`);
161164
},
162165
);
163-
164-
// Check for inconsistencies between translation files
165-
if (translationFiles.length > 1) {
166-
console.log("\n=== Translation Consistency Check ===\n");
167-
168-
// Get all unique keys across all files
169-
const allKeys = new Set();
170-
const translationsByLocale = new Map();
171-
172-
// Process each translation file
173-
const localeResults = translationFiles.map(({ path: filePath, locale }) => {
174-
const translations = JSON.parse(fs.readFileSync(filePath, "utf8"));
175-
const flattenedTranslations = flattenTranslations(translations);
176-
translationsByLocale.set(locale, flattenedTranslations);
177-
178-
// Add all keys to the set
179-
Object.keys(flattenedTranslations).forEach((key) => allKeys.add(key));
180-
181-
return { locale, flattenedTranslations };
182-
});
183-
184-
// Check for missing keys in each locale
185-
const localeKeys = Array.from(translationsByLocale.keys());
186-
const missingKeysByLocale = localeKeys.map((locale) => {
187-
const localeTranslations = translationsByLocale.get(locale);
188-
const missingKeys = Array.from(allKeys).filter(
189-
(key) => !localeTranslations[key],
190-
);
191-
192-
return { locale, missingKeys };
193-
});
194-
195-
// Process results
196-
missingKeysByLocale.forEach(({ locale, missingKeys }) => {
197-
if (missingKeys.length > 0) {
198-
console.log(`\nMissing keys in ${locale}:`);
199-
missingKeys.forEach((key) => {
200-
console.log(` - ${key}`);
201-
});
202-
}
203-
});
204-
}
205166
}
206167

207168
// Run the script

0 commit comments

Comments
 (0)