-
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
Skip translation when source language equals target language #4
base: glossary
Are you sure you want to change the base?
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.
@jjinkxy I don't want to merge this without knowing what is actually being accomplished - so when you have this problem next please switch to this branch locally and see if this helps solve your problem (Edit by Julia: set to this branch in gemfile to check if this fixes my problem the next time it arises.)
37f84cf
to
c5d8348
Compare
c5d8348
to
c9ff80c
Compare
@andreas-venturini |
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.
I just ran into the same error. It occurs when you translate e.g. from=en, and removed a key from there before which is present in other locale files.
So the problem is inconsistent source files (i.e. keys missing in the source language but not in the target language)
I'm not sure this is a use case we need to support - as we generally discourage editing the translation files manually. E.g. when using i18n-tasks rm
to remove outdated translations this problem can never happen.
Can we perhaps check with i18n-tasks missing
if a key is missing (in the source) and if so raise & instruct to fix this inconsistency before proceeding with the translate ?
Not sure about using i18n-tasks for this. But maybe we could catch the Google error and raise our own. I think we could also raise an error when source language equals target language, maybe this is more specific. |
This would be better - but how would this solve the problem though?
|
When source and target language are equal, which Google doesn't like, this seems to occur only in the case I described above. We could make the error message more specific to point out that a key in the source file is missing. |
I think I still don't understand sorry. Is the missing key in the source file the problem or not? If not it wouldn't make sense to have customize this error message. I.e. can this problem happen when there is a missing key and target language is not equal to source language? |
Btw:
I'm not sure I understand. When I translate from EN and in DE the key is missing, this would be our usual use case? Not sure how this works in detail, but I think the problem is, that translating back to the source language doesn't work, because Google receives "from EN" and "to EN", which is not allowed. |
Yes, that's the only case I could reproduce the error with. |
This problem came up again:
I tried this branch out and this fixed it. (I had set the :en translations already)
TL;DR |
Closes https://github.com/denkungsart/castupload/issues/7426
@andreas-venturini
Julia had the error again. Unfortunately it only seems to happen occasionally.
So I can not say for sure this bug is fixed now.
I'd suggest to merge the change and see if it happens again (which I can't imagine).