Changeset View
Changeset View
Standalone View
Standalone View
contrib/devtools/update-translations.py
#!/usr/bin/env python | #!/usr/bin/env python3 | ||||
# Copyright (c) 2014 Wladimir J. van der Laan | # Copyright (c) 2014 Wladimir J. van der Laan | ||||
# Distributed under the MIT software license, see the accompanying | # Distributed under the MIT software license, see the accompanying | ||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php. | # file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
''' | ''' | ||||
Run this script from the root of the repository to update all translations from | Run this script from the root of the repository to update all translations from | ||||
transifex. | transifex. | ||||
It will do the following automatically: | It will do the following automatically: | ||||
- fetch all translations using the tx tool | - fetch all translations using the tx tool | ||||
- post-process them into valid and committable format | - post-process them into valid and committable format | ||||
- remove invalid control characters | - remove invalid control characters | ||||
- remove location tags (makes diffs less noisy) | - remove location tags (makes diffs less noisy) | ||||
TODO: | TODO: | ||||
- auto-add new translations to the build system according to the translation process | - auto-add new translations to the build system according to the translation process | ||||
''' | ''' | ||||
from __future__ import division, print_function | |||||
import subprocess | import subprocess | ||||
import re | import re | ||||
import sys | import sys | ||||
import os | import os | ||||
import io | import io | ||||
import xml.etree.ElementTree as ET | import xml.etree.ElementTree as ET | ||||
# Name of transifex tool | # Name of transifex tool | ||||
▲ Show 20 Lines • Show All 203 Lines • Show Last 20 Lines |