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

pub run i18n_extension:getstrings malfunctions if you have comments with single apostrophes (eg don't, it's, 10's) #72

Closed
fne00 opened this issue Feb 23, 2021 · 6 comments · Fixed by #73

Comments

@fne00
Copy link

fne00 commented Feb 23, 2021

The getstrings function seems operate by finding an opening single or double quote, and then looking for the end of the string ... then it looks to see it .i18n (etc) is applied.

This goes wrong if you have unbalanced ' or " characters in the dart file.
This can easily happen if you have comment lines with words like: don't, can't, isn't, it's .

@marcglasberg
Copy link
Owner

The getstrings utility was contributed by @bauerj

Hopefully he can answer you. Thanks.

@bauerj
Copy link
Contributor

bauerj commented Mar 6, 2021

@fne00 Can you provide some Dart code that triggers this issue?

@fne00
Copy link
Author

fne00 commented Mar 6, 2021

@bauerj Take a Dart App/File that is working and add a comment like this to the code:

// You will find it doesn't work past this point

@bauerj
Copy link
Contributor

bauerj commented Mar 7, 2021

Indeed, I can confirm your issue. I will push a fix on Monday.

@bauerj
Copy link
Contributor

bauerj commented Mar 8, 2021

Hey @fne00,

I improved the utility to fix this. Me not catching this error probably means I should write more comments in my code 🤔

@fne00
Copy link
Author

fne00 commented Mar 18, 2021

@bauerj Thanks - That's great.

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 a pull request may close this issue.

3 participants