fix(i18n): require complete translation reuse

This commit is contained in:
Vincent Koc
2026-07-12 14:47:48 +02:00
parent fd4bb893ae
commit 689cf0ba3a
2 changed files with 61 additions and 7 deletions
+4 -7
View File
@@ -1530,14 +1530,11 @@ function choosePreviousTranslation(
source: string,
entries: readonly { translated: string }[],
): string | undefined {
const translations = new Set<string>();
for (const entry of entries) {
if (!entry.translated.trim() || entry.translated === source) {
continue;
}
translations.add(entry.translated);
const first = entries[0]?.translated;
if (!first?.trim() || first === source) {
return undefined;
}
return translations.size === 1 ? translations.values().next().value : undefined;
return entries.every((entry) => entry.translated === first) ? first : undefined;
}
export async function syncNativeLocale(