feat: extract text from Logic Components (#9666)#9737
Open
LoneRifle wants to merge 1 commit into
Open
Conversation
* extrac text from Logic Component * fix: use dedicated i18n key for logic aria-label instead of toLowerCase
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
This PR extracts previously hardcoded UI strings in the Admin Form “Logic” sidebar into i18n translations, improving localization support and consistency.
Changes:
- Expands the
Logiclocale contract to include new labels/messages (cancel, inactive blocks, mutations, badges, errors). - Replaces hardcoded UI text in logic components with
react-i18nexttranslation keys. - Localizes mutation success toasts using i18n keys.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/frontend/src/i18n/locales/features/admin-form/sidebar/logic/index.ts | Extends the Logic locale interface with new keys used by logic UI and toasts. |
| apps/frontend/src/i18n/locales/features/admin-form/sidebar/logic/en-sg.ts | Adds English (SG) strings for the new locale keys. |
| apps/frontend/src/features/admin-form/create/logic/mutations.ts | Moves toast success messages to i18n translations. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/NewLogicBlock/NewLogicBlock.tsx | Localizes the “Add logic” submit label. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/LogicContent.tsx | Localizes the inline form-logic error message. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/InactiveLogicBlock/InactiveLogicBlock.tsx | Localizes inactive-block labels/messages and an aria-label. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/InactiveLogicBlock/FieldLogicBadge.tsx | Localizes default badge message + tooltip label with interpolation. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/EditLogicBlock/EditLogicBlock.tsx | Localizes aria label name passed into the action group. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/EditLogicBlock/EditCondition/SaveActionGroup.tsx | Localizes delete aria-label, save fallback, and cancel button. |
| apps/frontend/src/features/admin-form/create/logic/components/LogicContent/EditLogicBlock/EditCondition/EditConditionBlock.tsx | Localizes “field deleted” validation error message. |
| apps/frontend/src/features/admin-form/create/logic/CreatePageLogicTab.tsx | Localizes the floating “Add logic” button aria-label. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #8404
Merges #9666