Skip to content

Fix of the crash when a string contains '/' #39

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Theo-Fourniez
Copy link

  • Passed the unit tests
  • Added unit tests for the special case

Closes #38

@@ -208,8 +208,7 @@ TranslationManager.prototype.getSuggestedKey = async function (pathToFile, text,

var words = text.trim().split(' ')
if (words.length > 4) words = words.slice(0, 3)

let word = camelCase(words.join(' ').replace(/[^a-zA-Z ]/g, ''))
let word = camelCase(words.join(' ').replace(/[^a-zA-Z ]/g, '').replace(/\s\s+/g, ' '))
Copy link
Author

Choose a reason for hiding this comment

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

Added a chained .replace to remove whitespaces that caused the crash

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

Successfully merging this pull request may close these issues.

Error when a string to translate contains specific characters ?
1 participant