Improve translation system workflow (#17214)
There are several limitations to translating with the Crowdin workflow such as:
• No way to locally verify html output for documentation
• Crowdin is confused by empty target tags
• Incorrect double escaping of xml.
Description of development approach
markdownTranslate:
• No longer incorrectly xml escape content before inserting it into the lxml tree. lxml already does this.
• No longer xml unescaped content coming from the lxml tree - lxml already does this.translateXliff: add a note to certain exceptions showing the line number of the markdown file to find markdown syntax errors easier.
• translateXliff: for lines that are purely structural (no translation still ensure that the line matches the skeleton, to catch markdown syntax errors much earlier.
md2html.py
• Restructured no longer to be an SCons tool, rather it is now a standalone script in user_docs, so that other code such as the nvdaL10nUtil script can use it.
nvdaL10util:
Added a new nvdal10nUtil program, which provides the following commands:
• xliff2md: converts a translated xliff file back into its original markdown file
nvdaL10util xliff2md <xliff file> <output xliff file>
• md2html: converts a markdown file into html, including support for the keyCommands document.
nvdaL10util md2html -t {userGuide|changes|keyCommands} -l <lang> <markdown file> <output html file>
• xliff2html: converts a xliff file all the way to html, including support for the keyCommands document.
nvdaL10util xliff2html -t {userGuide|changes|keyCommands} -l <lang> <xliff file> <output html file>
• stripXliff: takes a translated xliff file and generates a new xliff file that has all unnecessary content removed, so that when uploaded, only valid, added/changed translation trings are submitted to Crowdin. It removes:
◦ empty target tags
◦ initial English source target tags
• Optionally removes any translation that already appears in the old xliff, so that the new file only contains added / changed translations since last download.
nvdaL10nUtil stripXliff [-o <old xliff>] <translated xliff file> <output stripped xliff file>
Copy
Documentation updates
• No longer talk about Crowdin approvals - this has been disabled due to inaccessibility
• No longer recommend Poedit's Crowdin cloud translation feature as it is buggy. Instead just recommend ownloading, translating with Poedit, and uploding again.