Skip to content

Commit

Permalink
fix(translator): skip non localized / empty fields (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
r1tsuu authored Jun 16, 2024
1 parent da9542d commit 791a1bc
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "payload-enchants",
"version": "1.1.37",
"version": "1.1.38",
"private": true,
"description": "",
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion packages/better-localized-fields/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/better-localized-fields",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/better-use-as-title/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/better-use-as-title",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/bump-payload/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bump-payload",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/cached-local-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/cached-local-api",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-reorder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/docs-reorder",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/seo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/seo",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/translator/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@payload-enchants/translator",
"version": "1.1.37",
"version": "1.1.38",
"private": false,
"bugs": "https://github.com/r1tsuu/payload-enchants/issues",
"repository": "https://github.com/r1tsuu/payload-enchants",
Expand Down
2 changes: 1 addition & 1 deletion packages/translator/src/translate/traverseFields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const traverseFields = ({
case 'textarea':
if (field.custom && typeof field.custom === 'object' && field.custom.translatorSkip) return;

if (!field.localized && !localizedParent && isEmpty(siblingDataFrom[field.name])) return;
if (!field.localized || !localizedParent || isEmpty(siblingDataFrom[field.name])) return;
if (emptyOnly && siblingDataTranslated[field.name]) return;

// do not translate the block ID or admin-facing label
Expand Down
2 changes: 1 addition & 1 deletion test/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "test",
"version": "1.1.37",
"version": "1.1.38",
"private": true,
"type": "module",
"scripts": {
Expand Down

0 comments on commit 791a1bc

Please sign in to comment.