-
Notifications
You must be signed in to change notification settings - Fork 0
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
22041 when checking for "inconsistent interpolations" also check for "unrestored interpolations" #4
22041 when checking for "inconsistent interpolations" also check for "unrestored interpolations" #4
Conversation
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.
Looks good overall, just one minor comment about code style.
Additionally however, shouldn't we also include this check at translation time? I think this is explicitly where the 'raise_interpolation_error' function is for: To already raise these errors during translation, rather than in a check afterwards.
lib/i18n/tasks/interpolations.rb
Outdated
locales.each do |locale| | ||
data[locale].key_values.each do |key, value| | ||
next unless value.is_a?(String) | ||
next unless value.index('!!!!!') |
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.
Any reason not to use #include?
? It indicates the intent better I think
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.
@barak-neeman Can you add this change, before I do my next review?
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.
@barak-neeman Can you add this change, before I do my next review?
@tom-brouwer-bex my bad, I amended the commit without any changes... It's done now.
198684c
to
3c278ec
Compare
Yes when the restoration is really bad, but that is rare and I don't really know how to detect a really bad restoration in code (no idea what they would look like). The usual restore failure would be DeepL gobbling one or two characters around the tags, and for those cases it's quite useful to let the translation finish. It's helpful for improving the restore_interpolations method, and it's helpful for manually fixing the translated text. The check here is just to prevent it from going into prod. |
…"unrestored interpolations" (which is just a fancy name for translation texts that have '!!!!!' in them - the new restore interpolations method outputs !!!!! when it fails to restore correctly) References bookingexperts/support#22041
3c278ec
to
5279b0f
Compare
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.
LGTM
"unrestored interpolations" is just a fancy name for translation texts that have '!!!!!' in them - the new restore interpolations method outputs !!!!! when it fails to restore correctly
References bookingexperts/support#22041