@václav-trunec said in Replacing specific text from document A to B:
If I do this, the document will not be usable for our developers, since it also moves the { and } characters, determining the end of a translation key. Is there a way to skip this?
If you follow Guy’s full instructions, you will see that he added a “key” (the extra text) which will allow his two different sorts to undo each other: he sorts on that “key”, and then in the end, it re-sorts back to the original order. As Guy said, “The order of lines, in Document E, should be identical to the Document B order” after his last step.
-----
Alternatively, I recently published a script in a similar discussion, which will allow you set up pairs of English/OtherLanguage translation strings (or, in your case, OtherLanguage-to-English). If you follow the instructions in that post, but use the original/Czech as the left side of the translation dictionary and the translated/English as the right side, it should work.
So, instead of using the example from that discussion:
translation = { r'"JJIS number:"': r'"د JJIS شمیره:"', r'"Choose one"': r'"یو يې غوره کړئ"', r'"Social Security number:"': r'"د ټولنیز مصؤنیت لمبر:"', r'"State ID \(SID\):"': r'"د ایالت ID \(SID\):"' }… you would use something like …
translation = { r'Najděte upozornění patřící konkrétnímu alertu podle jeho názvu': r'Find the alert belonging to a specific alert by its name.', r'Hledat podle nazvu alertu': r'Search by alert name' }(remembering to end every pair except the last one with a comma