Skip to content
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

the-turk-diff.forum.differences and the-turk-diff.forum.previewMode are untranslatable in some languages #7

Closed
rob006 opened this issue Apr 13, 2020 · 7 comments

Comments

@rob006
Copy link
Contributor

rob006 commented Apr 13, 2020

You're reusing some translations (the-turk-diff.forum.originalContent, the-turk-diff.forum.currentContent, the-turk-diff.forum.revisionWithNumber) to generate messages from the-turk-diff.forum.differences and the-turk-diff.forum.previewMode. But in Polish the-turk-diff.forum.differences and the-turk-diff.forum.previewMode creates completely different context and requires different translations for the-turk-diff.forum.originalContent, the-turk-diff.forum.currentContent, the-turk-diff.forum.revisionWithNumber.

Examples:

the-turk-diff.forum.differences:

EN: You're viewing differences between original content and revision 3.
PL: Przeglądasz różnice pomiędzy originalną treścią i rewizją nr 3

the-turk-diff.forum.previewMode:

EN: You're previewing original content
PL: Przeglądasz oryginalną treść

EN: You're previewing revision 3
PL: Przeglądasz rewizję nr 3

As you can see the-turk-diff.forum.originalContent and the-turk-diff.forum.revisionWithNumber requires different translations for the-turk-diff.forum.differences and different for the-turk-diff.forum.previewMode (originalną treścią vs oryginalną treść and rewizją nr 3 vs rewizję nr 3). Please create separate strings for these 2 cases (see Reuse Translations, Not Keys!) or avoid joining strings in this way completely (see Avoid Hardcoded Syntax!).

@the-turk
Copy link
Owner

the-turk commented Apr 13, 2020

Are those differences happens because of sentences? What about these:

differences: "Differences: {old} and {new}"
previewMode: "Preview: {content}"

Because those advices that you linked will took us here eventually.

@rob006
Copy link
Contributor Author

rob006 commented Apr 13, 2020

What about these

It looks unnatural, and I'm not sure how to translate it to be hones.

These differences are because of sentences, but you can still keep sentence format and give some flexibility to translators. You have at least 2 options:

  1. Create separate keys for these 2 cases. Instead of single the-turk-diff.forum.originalContent key, you could add 2 separate keys: the-turk-diff.forum.differences.originalContent and the-turk-diff.forum.preview.originalContent. For English they will be the same, but for Polish I could translate them differently.
  2. Do not build phrases in this way and provide complete phrase for each case. Although solution 1 will work, it is really hard for translators to understand how it works. Instead building phrase by joining 2-3 separate strings, just use complete combinations as single string - it will be 7 (3 + 4) strings instead of 5, with much more duplication, but it will be much easier for translators to translate it.

@the-turk
Copy link
Owner

the-turk commented Apr 13, 2020

I talked with @clarkwinkelmann on Discord and he suggested this:

ok so the translation reuse thing does make sense here. I'd suggest you create a ref namespace (you can see core has one and a few other extensions do that as well) where you define english values for originalContent, currentContent and revisionWithNumber, then you do exactly as your last example, but you re-use those ref translations with => your-ext.ref.originalContent. That way for languages where the values stay the same, the translator can replace the ref value, but for languages where they must differ, the translator can replace the individual texts directly and skip the ref part

That sounds like a perfect solution. What do you think?


That was my last example by the way:

https://i.ibb.co/CVSPtjW/example.png

@rob006
Copy link
Contributor Author

rob006 commented Apr 13, 2020

That sounds like a perfect solution. What do you think?

I would still prefer solution 2 with complete phrases for each combination (redundancy is not a problem from my perspective), but this should be fine too.

@the-turk
Copy link
Owner

the-turk commented Apr 13, 2020

Second suggestion simplifies the translation process but complicates the backend and causes repetitive code parts over and over. Clark's suggestion was relatively easy to implement and I believe it will solve this issue for most of languages.

v1.0.4 is ready for release and will solve this issue (here are some related lines) but I also want to hear from @littlegolden. I don't think these changes will effect their translations since they already have translated the extension for both Simple Chinese & Japanese languages but who knows maybe they have another issue that dissatisfies them.

@littlegolden
Copy link

littlegolden commented Apr 13, 2020

I think the way you modified now is workable, if there is a need to make it easier for the translator to understand, sample notes can be added.
image.png

In the Chinese and Japanese translations for Diff Extenxison, there is no problems about this.

@the-turk
Copy link
Owner

Thanks! v1.0.4 released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants