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

fix(plugin): empty or whitespace-only fields #503

Merged
merged 1 commit into from
Feb 7, 2025

Conversation

sargreal
Copy link
Member

@sargreal sargreal commented Feb 6, 2025

  • plugin/server/services/translate.js
    • Skip translation if array is empty
  • plugin/server/utils/tests/translatable-fields.test.js
    • Add tests to verify that empty or whitespace-only fields are not translated.
  • plugin/server/utils/translatable-fields.js
    • Add check to ignore fields with empty or whitespace-only strings before translation.

fixes #252

* **plugin/server/services/translate.js**
  - Skip translation if array is empty
* **plugin/server/utils/__tests__/translatable-fields.test.js**
  - Add tests to verify that empty or whitespace-only fields are not translated.
* **plugin/server/utils/translatable-fields.js**
  - Add check to ignore fields with empty or whitespace-only strings before translation.

fixes #252
@sargreal sargreal force-pushed the sargreal/fix-translation-bug-empty-string branch from bde010a to b557d78 Compare February 6, 2025 19:54
@sargreal sargreal changed the title Fix translation bug in Frontpage content type fix(plugin): empty or whitespace-only fields Feb 6, 2025
@sargreal sargreal self-assigned this Feb 6, 2025
@sargreal sargreal added the bug Something isn't working label Feb 6, 2025
@sargreal sargreal added this to the backlog milestone Feb 6, 2025
@sargreal sargreal requested a review from layaxx February 6, 2025 20:07
@sargreal sargreal merged commit 7cbbb41 into main Feb 7, 2025
13 checks passed
@sargreal sargreal deleted the sargreal/fix-translation-bug-empty-string branch February 7, 2025 13:06
@fekide-bot
Copy link

🎉 This PR is included in version 1.3.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This PR is included in version 1.2.3 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This PR is included in version 1.1.2 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This PR is included in version 2.0.0-next.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This PR is included in version 1.3.0-next.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@fekide-bot
Copy link

🎉 This PR is included in version 1.2.0-next.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

[BUG]: Translating entity failed: texts parameter must be a non-empty string or array of non-empty strings
3 participants