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
Help for translators with interpolation #3939
Comments
In terms of severity, this is not the highest. With this approach translators can still control word order to create grammatical sentences (as opposed to hard-coded string concatenation). The challenge is to have them understand how to do it. Like I said, message docs can help to some extent: we can make links to the connected messages and show their current translation. |
I didn't really understand @Nikerabbit's code, not because I don't know PHP (though I don't) but because it's not clear what the As far as I know they rails i18n stuff doesn't have anything like that anyway. |
I think @Nikerabbit was trying to illustrate an approach something like this: https://github.com/iGEL/it |
That looks nice - shame it seems to be a bit dormant. |
This approach could cause some headache for translators. Using another sentence from the new bold versions:
The German translation would go:
But that's not really what you would want. You would want: OpenStreetMap ist ein Ort, um Dinge zu mappen die sowohl echt als auch aktuell sind. Have you considered using a simplified markdown? Most people are familiar with the (NB: The English texts are are really difficult to translate as is, because they use unusual and complicated sentence structures. Rewording into simpler English might solve some of the problems as well.) |
@lonvia Thanks for the example and the perspective. We could look into introducing inline markdown, which moves away from the zero-markup approach I was aiming for, but doesn't open as many headaches as using full html markup. I had a brief look to see whether there are any implications for non-Latin languages, and found an edge case (with CJK, punctuation and needing spaces after |
@Nikerabbit I'm not super expert with the translatewiki interface, so apologies if this is already implemented. Is there some way that, when translating a specific string, you can review the other strings in the same key hierarchy? For example, when translating Alternatively, is there any way we can indicate in the en.yml file that two keys are related, and have that show up in the translatewiki interface? I want to make sure that, for example, if someone gets the |
Looks like some helpful person has already added some documentation with such links, for example https://translatewiki.net/w/i.php?title=Special:Translate&showMessage=site.welcome.whats_on_the_map.on_the_map_html&group=out-osm-site&language=qqq&filter=&optional=1&action=translate |
What's wrong with HTML tags in messages? Better than a single sentence divided into several fragments. Indecipherable by some translators, and single words translated without context. |
Yes, I'm totally aware that dividing these sentences up makes them harder to translate, and I'm sorry that this is the case. That's why I opened this issue. However, there are some fundamental problems, including security implications, with allowing html in the translations. I can explain in more detail at some point in the future. |
In a commit comment, @Nikerabbit writes:
I'm opening this issue to explore what we can do to make it easier for our translators to handle translations with interpolations. The most common usage of the interpolations are for links, where the link text is used by a link helper and then interpolated into the rest of the sentence, for example:
I'm currently working on a series of PRs to remove all the raw html from the translations, and so this interpolation approach is also being used for html within sentences (bold, emphasis etc) like:
The text was updated successfully, but these errors were encountered: