Skip to content

Conversation

@RUTUPARNk
Copy link

Changes -
Backend (fxa-shared)
Locale-Agnostic ClientFormatter

ClientFormatter.ts: Removed CLDR dependency and server-side localization logic.
formatLocation
now returns the canonical countryCode (from the existing
Location
type) and the raw country string.
No changes to
AttachedClient.ts
.
Frontend (fxa-settings)
Client-Side Localization

types.ts
: Added countryCode to
RemoteMetadata
.
DeviceInfoBlock
: uses Intl.DisplayNames to localize the country name based on the user's current locale, falling back to the raw name.
Tests
Updated
fxa-shared/test/connected-services/formatters.ts
to assert countryCode presence and verify that country strings are passed through without server-side localization.
Closes: (#18859)

Checklist:
[x] My commit is GPG signed.
Logic: Static analysis confirms the data flow: Geodb -> Location (with countryCode) -> ClientFormatter (passes countryCode) -> API -> Frontend -> Intl -> UI.
API Contract: The backend now strictly follows the "canonical identifier" contract.
Build: Local build was skipped due to environment issues, but the code changes are now stripped of any risky type redefinitions.

Refactor ClientFormatter to be locale-agnostic and return countryCode.

Update DeviceInfoBlock to use Intl.DisplayNames.

Update RemoteMetadata type.
@RUTUPARNk RUTUPARNk requested a review from a team as a code owner December 23, 2025 23:34
@RUTUPARNk
Copy link
Author

@MagentaManifold can you review now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant