-
Notifications
You must be signed in to change notification settings - Fork 898
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
Try to come up with a solution where HTML tags in translations are not reliant on the order #19701
Comments
Hi @igorschoester - I just got that error message after initial setup and activation of Yoast. This is a Hebrew site. It's also in development and protected by HTTP AUTH. Perhaps this is the reason? |
Hello @ibanner 👋 Indeed, the culprit seems to be the translation for:
Now as to what the correct translations should be, that is very hard to determine for me 😅 But it seems also strange with the browser seemingly switching directions mid-sentence. A new translation would have to be submitted and approved on translate.wordpress.org before it can show up in your site's translation downloads. As an example. I don't think is actually correctly highlighting the words, though at least it does not crash:
|
Hello @ibanner I fixed the translation, you shouldn't get the error now. |
Example from Settings' site representation:
If the translation were to swap the
%1$s
and%2$s
our code would error due to the invalid HTML tags (in this caseCannot read properties of undefined (reading 'prevOffset')
).Maybe we can try and prevent situations like these by only allowing ordering for actual translations and not HTML tags.
Something like
%s
twice for the tags would prevent this. If a translation needs both you would get some complications, I haven't thought this through. Let's investigate.The text was updated successfully, but these errors were encountered: