Files
orca/config/scripts/locale-translation-policy.es-round5.test.mjs
T
AnddyAgudelo a202d92772 fix(localization): stop the repair policy rewriting translated generic terms to English (#12192)
Fixes #12113.

shouldPreserveEnglishValue keyed on the English value, so any key whose source
string equalled a NEVER_TRANSLATE_VALUES entry was forced back to English on
every repair run — agent, commit, repo, terminal and Continue were all on that
list. Measured on a clean checkout: ko 279, ja 461, zh 1180, es 479 values
rewritten, the large majority destroying translator work.

17 generic terms move into locale-generic-ui-terms.mjs, and the brand revert now
skips a term's canonical rendering, so genuinely nonsensical forms (zh 回购,
ja/zh 端子, es Comprometerse) still fire while 터미널/커밋/エージェント survive.
Brand, path, and code tokens are untouched — MD -> 医学博士 and HEAD -> CABEZA
are why that list still earns its keep.

No catalog values change; every file is under config/scripts/.

Co-authored-by: AnddyAgudelo <44873492+AnddyAgudelo@users.noreply.github.com>
2026-08-04 03:56:33 -07:00

66 lines
2.2 KiB
JavaScript

import { describe, expect, it } from 'vitest'
import { repairTranslatedValue } from './locale-translation-policy.mjs'
describe('locale-translation-policy es round 5', () => {
// Why: #12113 — brand names stay Latin, but generic workflow nouns keep their Spanish.
it('keeps brand names English and generic workflow terms translated', () => {
expect(
repairTranslatedValue({
key: 'auto.components.LinearIssueMarkdownDescriptionEditor.d9c47069ef',
enValue: 'Markdown',
localeValue: 'Reducción',
locale: 'es'
})
).toBe('Markdown')
expect(
repairTranslatedValue({
key: 'auto.components.TaskPage.7f3f7b4c18',
enValue: 'Description (optional, markdown)',
localeValue: 'Descripción (opcional, rebaja)',
locale: 'es'
})
).toBe('Descripción (opcional, markdown)')
expect(
repairTranslatedValue({
key: 'auto.components.right.sidebar.source.control.primary.action.ed93b4f14f',
enValue: 'Commit',
localeValue: 'Comprometerse',
locale: 'es'
})
).toBe('Commit')
expect(
repairTranslatedValue({
key: 'auto.components.right.sidebar.GitHistoryPanel.cf7cad58d2',
enValue: 'No commits yet',
localeValue: 'Aún no hay compromisos',
locale: 'es'
})
).toBe('Aún no hay commits')
expect(
repairTranslatedValue({
key: 'auto.components.right.sidebar.SourceControl.b94112eb9e',
enValue: 'Commit message',
localeValue: 'mensaje de confirmación',
locale: 'es'
})
).toBe('mensaje de confirmación')
expect(
repairTranslatedValue({
key: 'auto.components.workspace.cleanup.WorkspaceCleanupDialog.0b1766738a',
enValue: 'Repo',
localeValue: 'repositorio',
locale: 'es'
})
).toBe('repositorio')
expect(
repairTranslatedValue({
key: 'auto.components.sidebar.add.repo.local.start.actions.fb4fc5380e',
enValue: 'Local project, Git repo, or folder with many repos',
localeValue: 'Proyecto local, repositorio de Git o carpeta con muchos repositorios',
locale: 'es'
})
).toBe('Proyecto local, repositorio de Git o carpeta con muchos repositorios')
})
})