Closed toddtarsi closed 2 months ago
**Action:** test |
**Failed stage:** [Build side-runner and selenium-ide](https://github.com/SeleniumHQ/selenium-ide/actions/runs/8848492490/job/24298426571) [❌] |
**Failure summary:**
The action failed due to multiple TypeScript compilation errors across various packages. Key issues include: packages/side-runtime/src/plugins.ts and packages/side-migrate/src/migrations/implicit-locators.ts .errors in paths like /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-commons/node_modules/.bin/side-code-export .packages/side-code-export could not be built due to errors in its dependency packages/side-runtime , which cascaded and affected other dependent projects. |
Relevant error logs:```yaml 1: ##[group]Operating System 2: Ubuntu ... 176: .../node_modules/@bazel/hide-bazel-files postinstall: Done 177: .../node_modules/@bazel/typescript postinstall: Done 178: .../node_modules/electron postinstall$ node install.js 179: .../node_modules/electron postinstall$ node install.js 180: .../node_modules/electron-chromedriver install$ node ./download-chromedriver.js 181: .../node_modules/electron postinstall: Done 182: .../node_modules/electron postinstall: Done 183: .../node_modules/electron-chromedriver install: Done 184: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-commons/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 185: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-nunit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 186: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-java-junit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 187: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-xunit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 188: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-python-pytest/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 189: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-javascript-mocha/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 190: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/selenium-ide/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 191: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/side-example-suite/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 192: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-ruby-rspec/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/dist/bin.js' 193: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-java-junit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-java-junit/node_modules/side-code-export/dist/bin.js' 194: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-commons/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-commons/node_modules/side-code-export/dist/bin.js' 195: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-python-pytest/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-python-pytest/node_modules/side-code-export/dist/bin.js' 196: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-ruby-rspec/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-ruby-rspec/node_modules/side-code-export/dist/bin.js' 197: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-javascript-mocha/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-javascript-mocha/node_modules/side-code-export/dist/bin.js' 198: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-nunit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-nunit/node_modules/side-code-export/dist/bin.js' 199: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-xunit/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-csharp-xunit/node_modules/side-code-export/dist/bin.js' 200: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/side-example-suite/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/side-example-suite/node_modules/side-code-export/dist/bin.js' 201: WARN Failed to create bin at /home/runner/work/selenium-ide/selenium-ide/packages/selenium-ide/node_modules/.bin/side-code-export. ENOENT: no such file or directory, open '/home/runner/work/selenium-ide/selenium-ide/packages/selenium-ide/node_modules/side-code-export/dist/bin.js' ... 241: 12:47:46 PM - Project 'packages/side-testkit/tsconfig.json' is out of date because output file 'packages/side-testkit/tsconfig.tsbuildinfo' does not exist 242: 12:47:46 PM - Building project '/home/runner/work/selenium-ide/selenium-ide/packages/side-testkit/tsconfig.json'... 243: 12:47:47 PM - Project 'packages/get-driver/tsconfig.json' is out of date because output file 'packages/get-driver/tsconfig.tsbuildinfo' does not exist 244: 12:47:47 PM - Building project '/home/runner/work/selenium-ide/selenium-ide/packages/get-driver/tsconfig.json'... 245: 12:47:47 PM - Project 'packages/webdriver-testkit/tsconfig.json' is out of date because output file 'packages/webdriver-testkit/tsconfig.tsbuildinfo' does not exist 246: 12:47:47 PM - Building project '/home/runner/work/selenium-ide/selenium-ide/packages/webdriver-testkit/tsconfig.json'... 247: 12:47:47 PM - Project 'packages/side-runtime/tsconfig.json' is out of date because output file 'packages/side-runtime/tsconfig.tsbuildinfo' does not exist 248: 12:47:47 PM - Building project '/home/runner/work/selenium-ide/selenium-ide/packages/side-runtime/tsconfig.json'... 249: ##[error]packages/side-runtime/src/plugins.ts(40,11): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 250: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 251: 12:47:48 PM - Project 'packages/side-code-export/tsconfig.json' can't be built because its dependency 'packages/side-runtime' has errors 252: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-runtime' has errors ... 259: 12:47:48 PM - Project 'packages/code-export-java-junit/tsconfig.json' can't be built because its dependency 'packages/side-code-export' was not built 260: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-java-junit/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export' was not built 261: 12:47:48 PM - Project 'packages/code-export-javascript-mocha/tsconfig.json' can't be built because its dependency 'packages/side-code-export' was not built 262: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-javascript-mocha/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export' was not built 263: 12:47:48 PM - Project 'packages/code-export-python-pytest/tsconfig.json' can't be built because its dependency 'packages/side-code-export' was not built 264: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-python-pytest/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export' was not built 265: 12:47:48 PM - Project 'packages/code-export-ruby-rspec/tsconfig.json' can't be built because its dependency 'packages/side-code-export' was not built 266: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-ruby-rspec/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-code-export' was not built 267: 12:47:48 PM - Project 'packages/side-api/tsconfig.json' can't be built because its dependency 'packages/side-runtime' has errors 268: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/side-api/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-runtime' has errors 269: 12:47:48 PM - Project 'packages/side-example-suite/tsconfig.json' can't be built because its dependency 'packages/code-export-python-pytest' was not built 270: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/side-example-suite/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/code-export-python-pytest' was not built 271: 12:47:48 PM - Project 'packages/side-migrate/tsconfig.json' is out of date because output file 'packages/side-migrate/tsconfig.tsbuildinfo' does not exist 272: 12:47:48 PM - Building project '/home/runner/work/selenium-ide/selenium-ide/packages/side-migrate/tsconfig.json'... 273: ##[error]packages/side-migrate/src/migrations/implicit-locators.ts(25,13): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 274: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 275: ##[error]packages/side-migrate/src/migrations/implicit-locators.ts(27,24): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 276: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 277: ##[error]packages/side-migrate/src/migrations/script-interpolation.ts(25,13): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 278: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 279: ##[error]packages/side-migrate/src/migrations/script-interpolation.ts(27,24): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 280: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 281: ##[error]packages/side-migrate/src/migrations/variable-name.ts(25,13): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 282: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 283: ##[error]packages/side-migrate/src/migrations/variable-name.ts(27,24): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 284: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 285: ##[error]packages/side-migrate/src/legacy/migrate.ts(215,12): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 286: No index signature with a parameter of type 'string' was found on type '{ acceptAlert: { name: string; description: string; }; acceptConfirmation: { name: string; description: string; }; addSelection: { name: string; description: string; target: { name: string; description: string; }; }; ... 89 more ...; while: { ...; }; }'. 287: error TS5083: Cannot read file '/home/runner/work/selenium-ide/selenium-ide/packages/side-model-locale-data/tsconfig.json'. 288: 12:47:48 PM - Project 'packages/side-runner/tsconfig.json' can't be built because its dependency 'packages/side-runtime' has errors 289: 12:47:48 PM - Skipping build of project '/home/runner/work/selenium-ide/selenium-ide/packages/side-runner/tsconfig.json' because its dependency '/home/runner/work/selenium-ide/selenium-ide/packages/side-runtime' has errors 290: ERROR: "build:ts" exited with 2. 291: ##[error]Process completed with exit code 1. ``` |
PR Description updated to latest commit (https://github.com/SeleniumHQ/selenium-ide/commit/f825e0b484c82f82f9c064232583fff6a379fd28)
⏱️ Estimated effort to review [1-5] | 4, because the PR involves significant changes across multiple files, including refactoring and internationalization efforts. The changes affect core functionalities such as command handling and UI text rendering, which require careful review to ensure functionality and consistency across different languages. |
🧪 Relevant tests | No |
🔍 Possible issues | Possible Bug: The refactoring introduces changes to how commands and language maps are handled. If not properly tested, this could lead to runtime errors or incorrect command executions. |
Localization Issues: The introduction of new language support (Chinese) needs to be thoroughly tested to ensure all text is displayed correctly and that there are no missing translations. | |
🔒 Security concerns | No |
Category | Suggestions | |||||||||||||||||||
Best practice |
Convert the import of
___
**Replace the direct import of | |||||||||||||||||||
Use template literals for multi-line strings to enhance readability.___ **Use template literals for multi-line strings to improve readability and maintainability ofthe code, especially for helper texts in configuration objects.** [packages/selenium-ide/src/browser/I18N/zh/index.ts [65-69]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-252ec41818e7e19f57caddce35b06b2d0757ff585a656bbb4b2148cbdd697a52R65-R69) ```diff -platformUrlHelper: '用例最终展示在此前端页面', -serviceHostHelper: '将用例导出到后端服务的地址', -businessListUrlHelper: '用例所属的业务列表的url地址', +platformUrlHelper: `用例最终展示在此前端页面`, +serviceHostHelper: `将用例导出到后端服务的地址`, +businessListUrlHelper: `用例所属的业务列表的url地址`, ```
| Specify a more precise version range for the
___
**Consider specifying a more precise version range for the | |||||||||||||||||||
Maintainability |
Correct a typo in the variable name for better consistency and readability.___ **Ensure consistency in object property naming by changingmaiMenuChinese to mainMenuChinese to correct the typo and improve code readability.** [packages/selenium-ide/src/browser/I18N/zh/index.ts [52]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-252ec41818e7e19f57caddce35b06b2d0757ff585a656bbb4b2148cbdd697a52R52-R52) ```diff -const maiMenuChinese = { tests: '用例', suites: '集合', config: '配置' } +const mainMenuChinese = { tests: '用例', suites: '集合', config: '配置' } ```
| Use enums for repeated string values to centralize control and ease modifications.___ **Introduce enums for repeated string values such as menu names and error messages tocentralize control and facilitate changes and translations.** [packages/selenium-ide/src/browser/I18N/zh/index.ts [6-11]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-252ec41818e7e19f57caddce35b06b2d0757ff585a656bbb4b2148cbdd697a52R6-R11) ```diff +enum MenuNames { + File = '&文件', + Edit = '&编辑', + View = '&查看', + Help = '&帮助', + Title = '项目编辑器', +} const windowTabChinese = { - file: '&文件', - edit: '&编辑', - view: '&查看', - help: '&帮助', - title: '项目编辑器', + file: MenuNames.File, + edit: MenuNames.Edit, + view: MenuNames.View, + help: MenuNames.Help, + title: MenuNames.Title, } ```
| Remove duplicate imports to clean up the code.___ **Remove the duplicate import statements forPROJECT_TAB , SUITES_TAB , and TESTS_TAB to clean up the code and avoid confusion.** [packages/selenium-ide/src/browser/components/AppBar/AppBarTabs.tsx [4-5]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-7aafe3f232281974f4ead5f8994b2bebbaef439651b62ad7bb96342d7c115207R4-R5) ```diff -import { PROJECT_TAB, SUITES_TAB, TESTS_TAB } from 'browser/enums/tab' import { PROJECT_TAB, SUITES_TAB, TESTS_TAB } from 'browser/I18N/keys' ```
| Align the
___
**Ensure that the version of | ||||||||||||||||
Enhancement |
Refactor menu configurations into a single nested object for improved manageability.___ **Refactor the individual menu configuration objects into a single object with nestedproperties for better structure and easier management of related configurations.** [packages/selenium-ide/src/browser/I18N/zh/index.ts [6-21]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-252ec41818e7e19f57caddce35b06b2d0757ff585a656bbb4b2148cbdd697a52R6-R21) ```diff -const windowTabChinese = { - file: '&文件', - edit: '&编辑', - view: '&查看', - help: '&帮助', - title: '项目编辑器', -} -const electronMenuTreeChinese = { - about: 'Electron信息', - services: '服务信息', - hideElectron: '隐藏Electron', - hideOthers: '隐藏其他', - showAll: '显示所有', - quit: '退出', +const menuConfigChinese = { + windowTab: { + file: '&文件', + edit: '&编辑', + view: '&查看', + help: '&帮助', + title: '项目编辑器', + }, + electronMenu: { + about: 'Electron信息', + services: '服务信息', + hideElectron: '隐藏Electron', + hideOthers: '隐藏其他', + showAll: '显示所有', + quit: '退出', + }, } ```
| Improve type safety and IntelliSense by defining a specific interface for
___
**Consider using a more specific type for the | ||||||||||||||||||
Pass a dynamic locale to
___
**Ensure that the | ||||||||||||||||||||
Update
___
**Update the | ||||||||||||||||||||
Possible issue |
Add conditional rendering to handle potential null or undefined
___
**Use a conditional rendering approach to handle cases where | |||||||||||||||||||
Performance |
Move the loading URL check to the top of the component to improve performance and readability.___ **Move the conditional rendering check forurl === 'http://loading' to the beginning of the component function to avoid unnecessary hook calls and state updates when the URL is loading.** [packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectSettings.tsx [25]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-95c62b6c1509005f6c74c7a0f61d39935518d6ca9478362de2486eb47f83bbbaR25-R25) ```diff +if (url === 'http://loading') { + return null; +} const [languageMap, setLanguageMap] = useState
| Remove redundant
___
**Consider removing the redundant dependency | ||||||||||||||||||
Security |
Ensure the integrity hashes for new packages are correct to enhance security.___ **Verify and ensure that the integrity hashes for all newly added packages are correct toprevent potential security risks from tampered packages.** [pnpm-lock.yaml [7491]](https://github.com/SeleniumHQ/selenium-ide/pull/1820/files#diff-32824c984905bb02bc7ffcef96a77addd1f1602cff71a11fbbfdd7f53ee026bbR7491-R7491) ```diff -resolution: {integrity: sha512-eYq5fkFBVxc7GIFDzpFQkDOZgNayNTQn4Oufe8jw6YY6OHVw70/4pA3FyCsQ0Gb2DnvEJEMmN2tOaXUGByM+kg==} +resolution: {integrity: sha512-verifiedCorrectHash==} ``` |
@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
.IntlProvider
and updating components to useFormattedMessage
.Changes walkthrough
11 files
LocatorField.tsx
Refactor LocatorField to Use Dynamic Command Maps and Locale
packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/CommandFields/LocatorField.tsx
Commands
from@seleniumhq/side-model
to replace hardcodedcommand maps.
useState
anduseEffect
to dynamically update language mapsand local values based on system locale.
TextField.tsx
Update TextField to Utilize Dynamic Commands and Language Maps
packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Tests/CommandFields/TextField.tsx
@seleniumhq/side-model
.useState
anduseEffect
for language andcommand updates.
index.ts
Add Chinese Translations for UI Components and Commands
packages/selenium-ide/src/browser/I18N/zh/index.ts
menus.
@seleniumhq/side-model
.index.ts
Setup Base English Translations and Dynamic Command Imports
packages/selenium-ide/src/browser/I18N/en/index.ts
system messages.
@seleniumhq/side-model
.ArgTypes.ts
Define Chinese Argument Types for Localization
packages/side-model/src/I18N/zh/ArgTypes.ts
localization.
AppBarTabs.tsx
Refactor AppBarTabs for Internationalization Support
packages/selenium-ide/src/browser/components/AppBar/AppBarTabs.tsx
RenamableListItem.tsx
Enhance RenamableListItem with forwardRef Implementation
packages/selenium-ide/src/browser/components/Drawer/RenamableListItem.tsx
forwardRef
for better ref handling in Reactcomponents.
AppWrapper.tsx
Wrap App Components with IntlProvider for Localization
packages/selenium-ide/src/browser/components/AppWrapper.tsx
IntlProvider
forinternationalization.
index.ts
Implement I18N Data Loader for Language Support
packages/side-model/src/I18N/index.ts
settings.
keys.ts
Generate I18N Keys for Language Mapping
packages/selenium-ide/src/browser/I18N/keys.ts
labels.
ArgTypes.ts
Export Default English Argument Types
packages/side-model/src/I18N/en/ArgTypes.ts - Exported default argument types for commands in English.