Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: Ensure old feature works with new and show translate button in correct scenarios #215
FIX: Ensure old feature works with new and show translate button in correct scenarios #215
Changes from 1 commit
2748ef5
38a03c1
40d8657
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
The setup for this test is exactly the same as the test before it. I think the set up for this test should be clearing out the post's translation?
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.
The post will not have translation if I don't explicitly add
post.set_translation(locale, text)
It's exactly the same setup, but my intent is that the test description is the documentation of the behaviour not the implementation.
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.
Thank you for clarifying 👍 Perhaps we can just combine the two test cases into one? Technically we can only translate when post's detected locale does not match i18n locale and also when the post does not have translation.
Might also be useful to assert that the post cannot be translated when the post's translation is present for the given locale.
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.
Actually, "can_translate" is the bool that determines if the 🌐 appears on the post.
(Old feature) If the translation exists for the locale, the value should still be true, since the user will click on 🌐 and we will return the existing translation to the user. This is the old feature that we need to maintain, where viewing translations are manual, not the new feature where it is automatically rendered by default.
old feature
new experimental feature