Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DT-1055 - ensure all text in holocene is rendered via slot or prop #1487

Merged
merged 9 commits into from
Jul 20, 2023

Conversation

rossedfort
Copy link
Contributor

@rossedfort rossedfort commented Jul 19, 2023

Description & motivation 💭

In order to fully internationalize the UI, we need to make sure there are no hard-coded strings in Holocene components. This PR takes care of that with a few exceptions.

  • Day of Week Picker - this is hardcoded to use English days of the week for now
  • Month Picker - similarly this is hard coded to use English months for now
  • Error/Error Boundary - the library we are using to create the Error boundary does seem to let us pass props to the child components. For now the error text is hard coded in English.

I also moved some components out of src/lib/holocene and into src/lib/components, because they dealt with specific Temporal logic. Those include:

  • codec-endpoint-settings.svelte
  • data-converter-port-settings.svelte
  • data-encoder-settings.svelte
  • data-encoder-status.svelte
  • namespace-selector.svelte

These components can be translated at a later date.

Screenshots (if applicable) 📸

Design Considerations 🎨

N/a

Testing 🧪

How was this tested 👻

  • Manual testing
  • E2E tests added
  • Unit tests added

Steps for others to test: 🚶🏽‍♂️🚶🏽‍♀️

Checklists

Draft Checklist

Merge Checklist

Issue(s) closed

Docs

Any docs updates needed?

@rossedfort rossedfort requested a review from a team as a code owner July 19, 2023 17:27
@rossedfort rossedfort requested review from GiantRobots and removed request for a team July 19, 2023 17:27
@vercel
Copy link

vercel bot commented Jul 19, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
holocene ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 20, 2023 4:02pm

@rossedfort rossedfort requested review from Alex-Tideman and laurakwhit and removed request for GiantRobots July 19, 2023 17:28
@rossedfort rossedfort mentioned this pull request Jul 19, 2023
3 tasks
@Alex-Tideman
Copy link
Contributor

I guess my general question is why pass in a prop with the translated text instead of translating the string directly in the Holocene component?

@Alex-Tideman
Copy link
Contributor

Definitely agree with moving that list of components to $lib/components

@rossedfort
Copy link
Contributor Author

I guess my general question is why pass in a prop with the translated text instead of translating the string directly in the Holocene component?

Good question. If we want to publicize Holocene as a UI component library that can be consumed by external users, they may already be using their own internationalization framework other than i18next, or they may not have any i18n requirement at all. If we translated strings directly in our Holocene components, we'd be requiring everyone who uses Holocene to also bundle i18next in their app and host their own json files with the strings in them. Having all the text as props makes the Holocene agnostic to any potential internationalization frameworks.

@rossedfort rossedfort merged commit 775566c into main Jul 20, 2023
9 checks passed
@rossedfort rossedfort deleted the DT-1055-holocene-strings-as-props branch July 20, 2023 18:36
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