mquinson / po4a

Maintain the translations of your documentation with ease (PO for anything)
http://po4a.org/
GNU General Public License v2.0
120 stars 58 forks source link

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

Open ArduanovDanil opened 1 month ago

ArduanovDanil commented 1 month ago

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?

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 commented 1 month ago

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 commented 1 month ago

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.