Conversation
Elements had msg() calls but no lit-localize.json or localize-tools, so none of them could be extracted and offshoot rendered them in English. This adds extraction to xliff/es.xlf, translates all 37 strings, and publishes them as @internetarchive/elements/locales/es.js for offshoot to merge into its bundle. The published module is lit-localize's runtime-mode templates with one change: scripts/build-locales.mts only writes messages that have a translation. An English fallback would override a real translation of the same text once the app merges it. The package never calls configureLocalization. ia-button dropped msg(this.loadingText). Extraction needs a literal, and every caller already passes a localized string. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjwDQaR3hvZ8J2PP4117W2
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #129 +/- ##
==========================================
+ Coverage 91.23% 91.26% +0.03%
==========================================
Files 60 61 +1
Lines 2520 2529 +9
Branches 583 591 +8
==========================================
+ Hits 2299 2308 +9
Misses 77 77
Partials 144 144 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Having the translations isn't enough. Seven text properties took their default from msg() when the element was created, so an element built before the app loaded Spanish kept the English default. And no element re-rendered when the language changed, so a live switch only showed after a reload. The seven defaults (ia-scrubber-bar label, the two search bars' placeholder and label, ia-status-indicator's three titles) are now left unset and fall back to msg() at render. Every element that renders a msg() gets @Localized(), including ia-transcript-entry, whose text comes from a msg() in TranscriptEntryConfig.displayText. Diff review caught that one. The locale test now switches elements that are already on the page, and fails against either the old defaults or a missing @Localized(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjwDQaR3hvZ8J2PP4117W2
latonv
left a comment
There was a problem hiding this comment.
Nice upgrade, it's great to see the localization pass finally being enabled!
| export const templates = { | ||
| s061cc20e3432dead: `Pausar`, | ||
| s0661ae8e65d136c7: str`Imagen ${0} de ${1}`, |
There was a problem hiding this comment.
Q: Do we have any process to validate/approve these translations? I don't know enough Spanish to review these myself, but a quick Claude pass over them had a few possible grammar/dialect notes that may be worth double-checking by a fluent speaker:
- "Filtros y búsqueda avanzada disponible a continuación" should be "disponibles" — coordinated subjects take plural agreement.
- "Search the Archive" became "Busca en el archivo", where lowercase "el archivo" reads as "the file / a generic archive" rather than the Internet Archive as a proper noun ("Busca en Internet Archive" or similar).
- "El código que has introducido no es válido o ha caducado" is distinctly peninsular Spanish on two counts: the "tú has introducido" phrasing and the verb "introducir" itself (Latin America strongly prefers "ingresar" for entering a code). The English source is impersonal ("The code entered..."), so a neutral rendering like "El código introducido no es válido o ha caducado" would be both closer to the source and dialect-agnostic. Since the locale is generic es (not es-ES) and the Archive's audience is global, this is the most worthwhile of the extra points.
* origin/main: WEBDEV-9230: Make the demo page usable for QA on a phone (#127)
|
Note: I tried re-running build for the failed tests but it seems like there's still a failure about |
Elements' msg() calls have never been extractable, so offshoot shows them in English. This extracts them to
xliff/es.xlf, translates all 37, and publishes@internetarchive/elements/locales/es.jsfor offshoot to merge into its one bundle (offshoot side is WEBDEV-9225, pinned to prerelease1.1.3-webdev-9226.1).templatesshape, translated messages only. An English fallback would override a real translation of the same text once it's merged.configureLocalization. The app owns it.@localized(), so a live language switch shows without a reload.ia-buttondropsmsg(this.loadingText). Extraction needs a literal and every caller already passes a localized string.WEBDEV-9226: https://webarchive.jira.com/browse/WEBDEV-9226
🤖 Generated with Claude Code
https://claude.ai/code/session_01HjwDQaR3hvZ8J2PP4117W2