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?

@MagentaManifold
Copy link
Contributor

Sorry for the long delay! I just came back from vacation. I just ran CI on your PR, but sadly it still does not compile. You can see the error messages yourself by clicking on the failed CI tasks (LMK if you don't have access to them).

@RUTUPARNk
Copy link
Author

@MagentaManifold I can't access CI tasks.

@MagentaManifold
Copy link
Contributor

> nx run fxa-settings:compile

src/components/DeviceInfoBlock/index.tsx(42,33): error TS2322: Type 'string | undefined' is not assignable to type 'FluentVariable'.
  Type 'undefined' is not assignable to type 'FluentVariable'.
src/components/DeviceInfoBlock/index.tsx(50,27): error TS2322: Type 'string | undefined' is not assignable to type 'FluentVariable'.
src/components/DeviceInfoBlock/index.tsx(58,25): error TS2322: Type 'string | undefined' is not assignable to type 'FluentVariable'.
src/components/DeviceInfoBlock/index.tsx(66,19): error TS2322: Type 'string | undefined' is not assignable to type 'FluentVariable'.

To be honest you should see these if you actually attempted to build the repo locally

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.

2 participants