sphinx-intl
sphinx-intl copied to clipboard
feature-request: please support --previous option with sphinx-intl
When updating po files after changings in the original, it would be really beneficial for translators, if sphinx-intl would support adding the old original string to the po file (as a comment, starting with "#|" ).
This is already known for decades as a functionality of msgattrib; see https://manpages.debian.org/bookworm/gettext/msgattrib.1.en.html for example: "[--previous] keep previous msgids of translated messages.
If translator then uses an editor, that supports this feature (like lokalize for example), the editor directly shows, what has changed in the original text. That's extremly helpful for example, when there is only a minor difference like correcting a typo - imagine only one character has changed in a 10 or 20 lines long msgid - a nightmare for translators.
BTW: first I couldn't imagine, that this feature is not supported by sphinx, but I could not find it. If I overlooked it or if it's probably supported by some extension, please guide me to it. Thanks!
The make gettext command of Sphinx itself has so far been responsible for building the text of the reST/MD source into msgfmt format. In other words, Sphinx's gettext builder is just a converter from source to gettext format.
If we want to implement the ability to have previous text in po files, sphinx-intl would be the right place for now.
However, since such a function to keep track of differences can be handled by a service with a translation memory function such as transifex (in fact, the translation of sphinx itself is done on transfex), I wonder how much it would be used, even if sphinx-intl could have such a function. Even if we do, there are concerns about how much it will be used and whether the maintenance costs will be worth it.
Such concerns are not so much of a concern if the amount of code to be added is small. If you have time, I would appreciate it if you could try and implement it for us so that we can clarify such areas.
It makes me a bit sad, that Sphinx as the next generation documentation framework doesn't support such feature, which was supported for many years (decades?) in "old" tools like docbook. That being said, I'm sorry I have to admit that I'm unable to provide such code, I'm not a programmer, only a user of documentation toolings.
@shimizukawa Modern platforms implement their Translation Memory system and, therefore, will ignore the previous msgid kept in the PO file. Example of this is Transifex and Weblate. However, if one does not want to use such platforms and use sphinx-intl update to merge po and pot files, the lack of --previous is kind of a problem.
p.s.: this issue seems to deserve a 'enhancement' and 'help wanted' labels ;)
I understand.
I could not imagine a case where I would not use a platform with translation memory.
(I see AA-Turner already have the enhancement and help wanted labels set up)