fix(i18n): address Codex review findings#1158
Open
JamieRuderman wants to merge 1 commit into
Open
Conversation
…ative dates, reactive labels, network/column scoping
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses the Codex review findings across the i18n PR stack. Verified each against source before fixing.
P1
i18ninit resolvedlngfrom a hard-coded'en'only, and the language was re-resolved solely on sign-in — so translated Cognito sign-in/signup/MFA screens always rendered English. Init now callsresolveLanguage()(→navigator.language); the persisted per-account override is session-scoped and still re-applied byui.setLanguageafter sign-in.P2 — concrete bugs
Confirm.tsx) were hard-codedOk/Cancel→ nowcommon.ok/common.cancel. Affects every confirm dialog app-wide.Duration.tsx) appended a literal English" ago"("3 Tage ago") and formatted month/year/date branches withnavigator.language. Now uses a translatedduration.agophrase (word-order per locale:vor {{d}}/{{d}}前/hace {{d}}) andgetLocale().Attributes.tsx) leaked the rawcolumns.<id>key (e.g. the enterprise-license actions column) underreturnEmptyString:false→ blank labels now pass through untranslated.networkNameclassified system networks by name, so a user network named "Local"/"Recent"/etc. got relabeled. Now gated on the reserved synthetic id (local/recent/public).bittegravatar.com) → added{' '}.getLocale().P2 — reactivity (module-level strings didn't re-resolve)
RouteSetting.ROUTESwas evaluated at import (while i18n was stillen) → converted togetRoutes()resolved at render (also updatedServiceAttributesForm).useTranslation()at theApproot so render-time translations resolved outside React (Attribute label getters, value functions, date/duration helpers) re-render on language switch and when a lazy locale chunk finishes loading.Deliberately deferred
applications.tslaunch-method labels (Command/Terminal/…) are set in constructors and memoized byselectApplication, so they stay stale on a live language switch until the service/connection changes. Fixing this cleanly means a getter refactor in the sharedcommon/package; deferred as low-impact (narrow surface, only on live switch) rather than risk an untested shared-package change.created→ "Created date",license) — left as-is: admin pages are internal-only and don't need translation.Verification:
tscclean, production build clean (locale chunks code-split), i18n parity check passes.