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

fixed exclude from translation for non text elements #2571

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/utils",
"version": "1.1.15",
"version": "1.1.16",
"description": "Utils for working with Builder.io content",
"main": "./dist/index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/translation-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export function getTranslateableFields(
});
}
}
if (el && el.id && el.component?.name === 'Text' && !el.meta?.excludeFromTranslation) {
if (el && el.id && !el.meta?.excludeFromTranslation) {
results[`blocks.${el.id}#text`] = {
value: el.component.options.text,
instructions: el.meta?.instructions || defaultInstructions,
Expand Down
4 changes: 2 additions & 2 deletions plugins/phrase-conector/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugins/phrase-conector/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/plugin-phrase-connector",
"version": "0.0.5",
"version": "0.0.7",
"description": "",
"keywords": [],
"main": "dist/plugin.system.js",
Expand Down Expand Up @@ -126,7 +126,7 @@
},
"dependencies": {
"@builder.io/commerce-plugin-tools": "^0.3.0",
"@builder.io/utils": "^1.1.15",
"@builder.io/utils": "^1.1.16",
"fast-json-stable-stringify": "^2.1.0",
"lodash": "^4.17.21",
"object-hash": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions plugins/phrase-conector/src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ registerPlugin(
}
const element = selectedElements[0];
const isExcluded = element.meta?.get(transcludedMetaKey);
return element.component?.name === 'Text' && !isExcluded;
return !isExcluded;
},
onClick(elements) {
elements.forEach(el => el.meta.set('excludeFromTranslation', true));
Expand All @@ -127,7 +127,7 @@ registerPlugin(
}
const element = selectedElements[0];
const isExcluded = element.meta?.get(transcludedMetaKey);
return element.component?.name === 'Text' && isExcluded;
return isExcluded;
},
onClick(elements) {
elements.forEach(el => el.meta.set('excludeFromTranslation', false));
Expand Down
4 changes: 2 additions & 2 deletions plugins/smartling/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions plugins/smartling/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@builder.io/plugin-smartling",
"version": "0.0.11",
"version": "0.0.13",
"description": "",
"keywords": [],
"main": "dist/plugin.system.js",
Expand Down Expand Up @@ -126,7 +126,7 @@
},
"dependencies": {
"@builder.io/commerce-plugin-tools": "^0.3.0",
"@builder.io/utils": "^1.1.15",
"@builder.io/utils": "^1.1.16",
"fast-json-stable-stringify": "^2.1.0",
"lodash": "^4.17.21",
"object-hash": "^3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions plugins/smartling/src/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ registerPlugin(
}
const element = selectedElements[0];
const isExcluded = element.meta?.get(transcludedMetaKey);
return element.component?.name === 'Text' && !isExcluded;
return !isExcluded;
},
onClick(elements) {
elements.forEach(el => el.meta.set('excludeFromTranslation', true));
Expand All @@ -233,7 +233,7 @@ registerPlugin(
}
const element = selectedElements[0];
const isExcluded = element.meta?.get(transcludedMetaKey);
return element.component?.name === 'Text' && isExcluded;
return isExcluded;
},
onClick(elements) {
elements.forEach(el => el.meta.set('excludeFromTranslation', false));
Expand Down