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

Change localization on-the-fly #1598

Open
bhousel opened this issue Oct 30, 2024 · 0 comments
Open

Change localization on-the-fly #1598

bhousel opened this issue Oct 30, 2024 · 0 comments
Assignees
Labels
feature-l10n Issue of request related to localization/translations

Comments

@bhousel
Copy link
Contributor

bhousel commented Oct 30, 2024

Being able to change the locale on the fly has been a stretch goal for years. Currently you can only set the locale at startup and it can't change later. This is because historically a lot of our UI components were written in a way that they only work one time (they append themselves to the document).

I've recently updated a bunch of our UI components to be reentrant, meaning they can re-render as needed - this includes relocalizing any text. I'll keep this issue open until it works everywhere.

@bhousel bhousel self-assigned this Oct 30, 2024
@bhousel bhousel added the feature-l10n Issue of request related to localization/translations label Oct 30, 2024
bhousel added a commit that referenced this issue Nov 14, 2024
(re: #1598)

This means that the user can change `&locale=xx` in the url hash
(or locale can change some other way) and the UI and map will redraw.

Not all of the UI is able to react to this yet, so we'll leave #1598 open,
but the main components in the tree down through the sidebar, main map,
controls, attributions, footer can handle it.

This commit also cleans up a few rtl issues in the map footer.
bhousel added a commit that referenced this issue Nov 26, 2024
(re: #1336, #1598 and others)

- RapidInspector is a class component now with reentrant render functions
- Lots of places where localization happened at init time now happens at render time
- RapidInspector and Sidebar will redo their keybinds now on localization change
  (This is something we haven't done before - should adopt this pattern everywhere)
- Cleanup RapidInspector layout a lot - lots more flexbox
- The shortcut keys 'A' and 'D' now work on hover! (#1336)
  (This is possible because we aren't making extra inspector components all the time.)
bhousel added a commit that referenced this issue Nov 27, 2024
(re: #1598)

This is a followup from 0c196c3
Because many keyboard shortcuts can be localizable, we should refresh them if the language changes.
This wraps up all the keybinds in `_setupKeybinding` functions which can run on `localechange`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-l10n Issue of request related to localization/translations
Projects
None yet
Development

No branches or pull requests

1 participant