Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve translation experience by using full sentences #759

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

Closed
FriedrichFroebel opened this issue Nov 14, 2021 · 11 comments
Closed

Improve translation experience by using full sentences #759

FriedrichFroebel opened this issue Nov 14, 2021 · 11 comments
Assignees

Comments

@FriedrichFroebel
Copy link
Contributor

I updated the German translation this week and stumbled upon some strings which are hard to handle during the translation process. The issue is that at some places sentences are split into multiple translation messages, while the word order (or some punctuation) in the target language is different.

A simple example I remember is ContactTab.cpp, where I would like to use melden Sie sich bitte auf unserem Discord- oder IRC-Server for please join our Discord or our IRC server - which is impossible at the moment due to the way the strings are created.

Ideally sentences could be translated without splitting, maybe with some untranslatable or dynamic values being replaced by verbose placeholders which make it clear to the translator what will be inserted there during runtime.

@DamirPorobic
Copy link
Member

Yes, that is possible. Do you know about other places where this change should be done?

@FriedrichFroebel
Copy link
Contributor Author

Not directly, but I might have a look at it again in the next days to check which strings actually cause problems at the moment (I did not take notes on them the last time).

@DamirPorobic
Copy link
Member

That would be nice, then I can fix all of them at once.

@FriedrichFroebel
Copy link
Contributor Author

FriedrichFroebel commented Nov 17, 2021

I just went through all the strings at Weblate and found the following strings/messages which are problematic in my opinion (at least for German translations):

  • ContactTab.cpp

    tr("If you have general questions, ideas or just want to talk about ksnip,") + QLatin1String("<br/>") +
      		tr("please join our") + QLatin1String(" <a href=\"http://discord.ksnip.org\">Discord</a> ") +
      		tr("or our") + QLatin1String(" <a href=\"https://web.libera.chat/?channels=#ksnip\">IRC</a> ") +
      		tr("server")	+ QLatin1String(".<br/><br/>")
    
  • ContactTab.cpp - tr("Please use ") + QLatin1String("<a href=\"https://github.com/ksnip/ksnip/issues/\">GitHub</a>") + tr(" to report bugs.")

  • DonateTab.cpp - tr("Also possible, ") + QLatin1String(" <a href=\"https://github.com/sponsors/DamirPorobic\">") + tr("here") + QLatin1String("</a>.")

  • DonateTab.cpp

    tr("If you want to help or just want to appreciate the work being done<br/>"
      				         "by treating developers to a beer or coffee, you can do that") + QLatin1String(" <a href=\"https://www.paypal.me/damirporobic\">") + tr("here")
    
  • HandleUploadResultOperation.cpp - tr("Upload script ") + mConfig->uploadScriptPath() + tr(" finished successfully.")

  • HandleUploadResultOperation.cpp - tr("Uploaded to") + QLatin1String(" ") + url

  • RenameOperation.cpp - tr("Successfully renamed image to ") + newFilename

  • RenameOperation.cpp - tr("Failed to rename image to ") + newFilename

There are some strings with problems which might not be related to this issue directly, but were not always clear to me and might be useful to be discussed:

  • DonateTab.cpp - tr("Become a GitHub Sponsor") + QLatin1String("?</b>") - It might be relevant that this is a question.
  • MainToolBar.cpp - tr("s") - Unclear without context, although there is a comment in this case at Weblate explaining it.
  • ActionSettingTab.cpp - tr("s") - Unclear without context as in the previous case.
  • SaveOperation.cpp - tr("Saved to") - No way to include path. Is this correct?
  • SaveOperation.cpp - tr("Failed to save image to") - No way to include path. Is this correct?

@DamirPorobic
Copy link
Member

Would you expect line breaks to be part the translation string when the line break is happening in the sentence?

@DamirPorobic
Copy link
Member

And thanks for collecting those, I'll try to fix them.

@FriedrichFroebel
Copy link
Contributor Author

Would you expect line breaks to be part the translation string when the line break is happening in the sentence?

If you mean simple newlines (\n), then I would say yes for now, as there already are strings with sentences split across multiple lines. Although I would not argue against automatic line breaks inside the strings if this is possible for all languages, as this would not require the translators to care about such display details - nevertheless it should be okay for now to insert them manually.

@DamirPorobic
Copy link
Member

Also those <br/>.

I'll check for an automatic way to handle this but if I recall correctly that wasn't going for some reason.

@FriedrichFroebel
Copy link
Contributor Author

If those <br/> are just used as the \n equivalent in HTML strings, the same should apply as in my previous comment. For other cases: Do you have an example of what you mean with it?

@DamirPorobic
Copy link
Member

That's exactly what I mean. In the about dialog we have html tagged text and all other places should be using the newline character.

@DamirPorobic DamirPorobic self-assigned this Nov 21, 2021
@DamirPorobic
Copy link
Member

I think I was able to fix all entries you had there. Also the one with "s" should have now a comment, never used it but the docu says I can add one, which I did.

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

No branches or pull requests

2 participants