-
Notifications
You must be signed in to change notification settings - Fork 265
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 unescaped interpolated reserved key in help text and handle escaped interpolations in inconsistent interpolations check #553
Conversation
Thanks @Bilka2! It would be nice to have this branch merged - are you going to review the failed tests? Otherwise i can start from your branch and open up another PR 🙏 |
@edolix As per the PR description, the tests are failing because they need they need the PR in the i18n gem to be merged: ruby-i18n/i18n#688. Without that PR, escaping the variables does nothing to avoid the error. Merging that PR is the plan for the i18n gem: ruby-i18n/i18n#689 (comment) The only way to fix this here in i18n-tasks without the i18n PR would be to completely remove |
Apologies for the noise here, i realised that right after submitting my comment 🙏 |
559298d
to
4cae1c3
Compare
The i18n gem v1.14.5 has been released with the needed fix to respect escaped interpolations. So this PR is now good to go. |
@Bilka2 Could you fix the last lint errors? |
7141a34
to
24c5b48
Compare
Done. Apologies for the force pushes, a testing commit ended up on the wrong branch. |
No worries, I appreciate it 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, but I'll let @glebm review as well.
24c5b48
to
6bcbe39
Compare
I extracted the rubocop fixes to #564 and rebased this branch |
I'll merge it to main so we can get the tests running and can keep on iterating. Well done with the upstream change @Bilka2 ! |
Thanks for merging this - will there be version bump soon, or should we point to repo for now to get this change? |
Please try it out in your repo, then we can cut a release faster. @glebm is the one doing releases. |
Hi, I'm testing main branch with I18n 1.18.5 and it is working fine |
Sure thing. I updated a PR branch to point to the repo - mastodon/mastodon#30198 - and it both a) resolved the previous errors we were seeing that this change fixed, b) had a nice side effect of the fixed escape logic helping us find a place where we had a mistaken interpolation escape, c) as far as I can tell, at least via CI runs and some local checks, everything else is working correctly as before. |
Thanks for testing @mjankowski and @tagliala! Released v1.0.14 Thanks everyone! |
This fixes #552 if and only if ruby-i18n/i18n#688 or an equivalent is merged for the i18n gem. Otherwise escaping the offending interpolations does not appease the reserved keyword check.
This PR also contains a workaround for another issue related to escaped interpolations (ruby-i18n/i18n#689), see the code comment.
I removed some unused translations that had interpolations in them, their usage was removed in c1d1312.