adobe / adobe/react-spectrum

Additional Region Support for select locales

Open
#7,413 2 comments 0 reactions 1 assignee Claimed by @devongovett View on GitHub
internationalization
Dominant language
TypeScript
Stars
15.9k
Forks
1.6k
Avg merge
3d 9m
Merged PRs (30d)
59

Description

### Provide a general summary of the feature here

We would like to support some additional locales for region support, in same way as exists for **French (Canada)**

Meaning....
- Only added regional support, no new translations required

Example...
- French Canadian
- In case of French (Canada) we display translations using **fr-FR** (French France), but use region of Canada.

New locales requested...
- es-419 (Spanish, Latin America)
- es-MS (Spanish, Mexico)
- en-AU (English, Australian)
- en-IL (English, Israel)

### 🤔 Expected Behavior?

- es-419: displays es-ES translations, but uses es-419 region
- es-MX: displays es-MX translations, but uses es-MX region
- en-AU: display en-US translations, but uses en-AU region
- en-IL: display en-US translations, but uses en-IL region

However, if intl string files added for any of the above, at later stage, then use matching strings files (eg: en-AU string files + region). Looking at current code seems already supported, just need the locales list updated for above,

### 😯 Current Behavior

These will all revert to *en-US* only

### 💁 Possible Solution

From looking at the code, looks like it might be just updating language tables:
https://github.com/adobe/react-spectrum/blob/main/.chromatic-fc/constants.js
https://github.com/adobe/react-spectrum/blob/main/packages/dev/docs/pages/react-aria/home/I18n.tsx
https://github.com/adobe/react-spectrum/blob/main/packages/%40internationalized/message/src/MessageDictionary.ts
https://github.com/adobe/react-spectrum/blob/main/packages/%40internationalized/string/src/LocalizedStringDictionary.ts

and some related files like storybook and tests:
https://github.com/adobe/react-spectrum/blob/main/.storybook/constants.js
https://github.com/adobe/react-spectrum/blob/main/.storybook-s2/constants.js
https://github.com/adobe/react-spectrum/blob/main/packages/%40internationalized/date/tests/DateFormatter.test.js
https://github.com/adobe/react-spectrum/blob/main/packages/%40internationalized/date/tests/queries.test.js

MessageDictinary looks to already support this functionality, with just adding language codes to support. es-419 might need extra handling as not xx-XX format.

### 🔦 Context

Match other Adobe areas (pls contact rgeraght, lreis any question)

### 💻 Examples

_No response_

### 🧢 Your Company/Team

Adobe

### 🕷 Tracking Issue

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.