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

Is it possible to use translated (but outdated version) of changed paragraph in translated file? #500

Open
ArduanovDanil opened this issue May 18, 2024 · 2 comments

Comments

@ArduanovDanil
Copy link

Hello, Po4a maintainers team! Thanks for your cool work!

I spent 3 days looking for a tool to translate .md files to .po and back. Your tool look like ideal, but one thing is not good for me. From documentation:

Any paragraph that is not translated is left in English in the resulting document, ensuring that the end users never see an outdated translation in the documentation.

Is it possible change this behavior?

What steps will reproduce the problem?

  • Create text.md file, filled out the document with text in English
  • Run po4a, get text.lang.po file
  • Translate all paragraphs in text.lang.po
  • Run po4a, get translated text.lang.md
  • Change some words in one paragraph in text.md
  • Run po4a

What is the expected result?

text.lang.md has not changed

What do you get instead?

text.lang.md has changed, changed paragraph in English language

@mquinson
Copy link
Owner

Hello,

I guess not, there is no way to keep the old translation to a modified paragraph. It could be possible in some cases, but not always. This is because we rely on gettext tools internally to update the po file according to the new master document. If the changes are light, gettext sets the string to "fuzzy", asking the translators to update their work (and po4a could still use it), but if the changes are too heavy, gettext fails to find the matching string in the previous version of the document (https://en.wikipedia.org/wiki/Approximate_string_matching) and po4a could not do better here.

It could certainly be possible to use fuzzy translations in the produced documents, but that would probably be a bad idea in many cases. If the original string changed, there was a reason, and displaying the old one could be really misleading.

But I understand your point anyway. If the original is in English, as a native French speaker, I probably want the up to date version in English. But if it's in a language of which I don't even know the letters (such as Russian, Chinese or Arabic), I'd probably prefer the outdated translation to a perfectly useless up to date content. I'll see how I can implement this, at some point.

The best would probably to put both versions, e.g. the outdated translation with a mention "Outdated translation of ..." with ... replaced with the up to date original text. But that could break the formatting, like titles would be too long and things. I'm not sure whether this could be implemented, and that would be format-dependent (a solution for our Markdown backend may not work for Asciidoc or XML).

Thanks for your interesting suggesting, I'll think about it. I hope you're not in a rush: I was supposed to release po4a on the 15th, but I got a big week and the next one does not look much better, so I dunno when I'll implement this. It may be in weeks or months, if things go wrong...

Sorry about that, and thanks for your interest,

@ArduanovDanil
Copy link
Author

Thank you very much for your response! I discussed it with the team - the current behavior for our project is not as bad as I thought. You can consider this as an idea, perhaps in other projects it may prevent the use of your tool.

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

2 participants