Skip to content

Skip empty strings in translation to avoid unnecessary errors #60

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

Merged
merged 3 commits into from
Jun 23, 2024

Conversation

tomasen
Copy link
Contributor

@tomasen tomasen commented Jun 20, 2024

Related to #59

Implements a check to skip empty strings in the translation process to enhance efficiency and reduce errors.

  • Adds a condition at the beginning of the plaintranslate function in src/core/translator.ts to immediately return the input string if it is empty, effectively skipping the translation process for empty strings.
  • Utilizes str.trim() === '' to check for empty strings, ensuring that strings containing only whitespace are also skipped.

For more details, open the Copilot Workspace session.

Copy link
Contributor Author

@tomasen tomasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skip empty and blank string

@ParvinEyvazov ParvinEyvazov merged commit b495a13 into mololab:master Jun 23, 2024
@ParvinEyvazov
Copy link
Member

Awesome! Thank you for your contribution @tomasen.

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

Successfully merging this pull request may close these issues.

2 participants