mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-28 05:16:23 -06:00
fix(i18n): require complete translation reuse
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user