-
-
Notifications
You must be signed in to change notification settings - Fork 821
moving intl deeper into the toolkit #1820
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
Conversation
CI Failure Feedback
✨ CI feedback usage guide:The CI feedback tool (
In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR: where Configuration options
See more information about the |
|
PR Description updated to latest commit (f825e0b)
|
PR Review
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
|
@toddtarsi Your idea is right, using react-intl for translation eliminates the need for developers to maintain it themselves, which is great! |
|
@fernandozw - I think it's good here, and I'm going to merge to the latest on trunk. What I'd really appreciate from your side is to test the latest on trunk in the next few days, and if it looks good as a release candidate, we'll send it out! I figure by merging it to trunk, even if it's 90% right and 10% wrong, it will be an easier workflow for you to do fixes there before we increment and truly release, even if the latest tag is updated. |
User description
@fernandozw - I am reworking the i18n stuff a bit for the following tweaks:
I am moving some of the command map translations into side-model. I want that stuff really low down so we can reuse your translations cleanly in both the IDE and the side runner. I am assuming if you're enjoying the IDE, you'll probably want correctly translated strings for your CI too.
I am moving the app translation hooks to just use react-intl and a single typed master translation document. This way we get a few more errors about missing translations, and whenever I add a new english string, the compiler will kick my ass until I add a chinese equivalent. It will help me keep language support going forward. Also, react-intl has good support for template strings and variable injection w/r/t localization and doing numbers and dates and all that stuff too.
Rather than manually specifying language and storing that in the electron-store, I'm just going to use the system locale data so the app starts in the users language of choice.
I am looking at combining metadata from custom commands into the language map in the browser at runtime. Right now, custom commands (provided via plugin) crash the app UX.
Type
enhancement
Description
@seleniumhq/side-model.IntlProviderand updating components to useFormattedMessage.Changes walkthrough
11 files
LocatorField.tsx
Refactor LocatorField to Use Dynamic Command Maps and Localepackages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/CommandFields/LocatorField.tsx
Commandsfrom@seleniumhq/side-modelto replace hardcodedcommand maps.
useStateanduseEffectto dynamically update language mapsand local values based on system locale.
TextField.tsx
Update TextField to Utilize Dynamic Commands and Language Mapspackages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/CommandFields/TextField.tsx
@seleniumhq/side-model.useStateanduseEffectfor language andcommand updates.
index.ts
Add Chinese Translations for UI Components and Commandspackages/selenium-ide/src/browser/I18N/zh/index.ts
menus.
@seleniumhq/side-model.index.ts
Setup Base English Translations and Dynamic Command Importspackages/selenium-ide/src/browser/I18N/en/index.ts
system messages.
@seleniumhq/side-model.ArgTypes.ts
Define Chinese Argument Types for Localizationpackages/side-model/src/I18N/zh/ArgTypes.ts
localization.
AppBarTabs.tsx
Refactor AppBarTabs for Internationalization Supportpackages/selenium-ide/src/browser/components/AppBar/AppBarTabs.tsx
RenamableListItem.tsx
Enhance RenamableListItem with forwardRef Implementationpackages/selenium-ide/src/browser/components/Drawer/RenamableListItem.tsx
forwardReffor better ref handling in Reactcomponents.
AppWrapper.tsx
Wrap App Components with IntlProvider for Localizationpackages/selenium-ide/src/browser/components/AppWrapper.tsx
IntlProviderforinternationalization.
index.ts
Implement I18N Data Loader for Language Supportpackages/side-model/src/I18N/index.ts
settings.
keys.ts
Generate I18N Keys for Language Mappingpackages/selenium-ide/src/browser/I18N/keys.ts
labels.
ArgTypes.ts
Export Default English Argument Typespackages/side-model/src/I18N/en/ArgTypes.ts