- Notifications
You must be signed in to change notification settings - Fork 1.1k
feat[plugin][smartling]: ENG-9736 visual context upload, exclude blocks, edit/add/delete string instructions #4218
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
base: main
Are you sure you want to change the base?
feat[plugin][smartling]: ENG-9736 visual context upload, exclude blocks, edit/add/delete string instructions #4218
Conversation
|
| View your CI Pipeline Execution ↗ for commit 4a0e697
☁️ Nx Cloud last updated this comment at |
plugins/smartling/src/plugin.tsx Outdated
| } | ||
| const element = elements[0]; | ||
| const instructions = element.meta?.get('instructions'); | ||
| if (instructions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Edit String Instructions silently fails for falsy values
The showIf function checks element.meta?.get('instructions') !== undefined, which returns true for falsy non-undefined values like null, empty string, or 0. However, the onClick handler uses if (instructions) which is a truthiness check. If instructions is a falsy but non-undefined value, the "Edit String Instructions" menu item will appear, but clicking it will silently do nothing because the truthiness check fails. The onClick check should use !== undefined to match the showIf logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anaghav2023 can you please check if this is relevant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AishwaryaParab Thanks, resolved it !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Missing excludeFromTranslation check for Symbol in applyTranslation
The excludeFromTranslation check was added for Symbol components in getTranslateableFields (line 267), but the corresponding check is missing in applyTranslation (line 320). This inconsistency means that when a Symbol is marked with excludeFromTranslation, it won't have its text extracted for translation (correct), but applyTranslation will still process it and set translated: true in its metadata (incorrect). Other component types like Text, Core:Button, and localizedTextInputs all have the check in both functions.
packages/utils/src/translation-helpers.ts#L319-L320
builder/packages/utils/src/translation-helpers.ts
Lines 319 to 320 in b6bd777
| traverse(blocks).forEach(function (el) { | |
| if (el && el.id && el.component?.name === 'Symbol') { |
AishwaryaParab left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@anaghav2023 Is this relevant since we're bumping up the version? |
No, I have managed the version updates on my own |
Description
This PR has 3 new features
Loom
For features 1 and 2 -> https://www.loom.com/share/d6d8c880667c4453b43c7c8b7af4de0a
For feature 3 -> https://www.loom.com/share/060f9094fc3c4865972cef2f4624e1d7
Note
Introduces nested block exclusion for translations and expands Smartling plugin capabilities and settings.
translation-helpersnow honorsmeta.excludeFromTranslationrecursively (tracks depth) acrossText,Core:Button,Symbol, and customlocalizedTextInputs; updates snapshots to include button texts and carousel/custom component casesenableVisualContextCapturesetting; broadens context menu exclude/include to any block; new context menu actions to add, edit, and delete per-stringinstructions@builder.io/utilsto1.1.29;@builder.io/plugin-smartlingto0.0.23-13and dependency on utils1.1.29Written by Cursor Bugbot for commit 4a0e697. This will update automatically on new commits. Configure here.