diff options
Diffstat (limited to 'src/mpc-hc/mpcresources/UpdateIS.py')
-rw-r--r-- | src/mpc-hc/mpcresources/UpdateIS.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mpc-hc/mpcresources/UpdateIS.py b/src/mpc-hc/mpcresources/UpdateIS.py index 7d68f0a1e..5ec1b6822 100644 --- a/src/mpc-hc/mpcresources/UpdateIS.py +++ b/src/mpc-hc/mpcresources/UpdateIS.py @@ -1,4 +1,4 @@ -# (C) 2013 see Authors.txt +# (C) 2013, 2015-2016 see Authors.txt # # This file is part of MPC-HC. # @@ -15,12 +15,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import sys import glob from TranslationDataIS import * -if __name__ == '__main__': + +def UpdateIS(normalizePOFile=True): translationsConfigAndData = [] for cfgPath in glob.glob(r'cfg\*.cfg'): config = ConfigParser.RawConfigParser({'installerIsTranslated': 'True'}) @@ -30,9 +30,15 @@ if __name__ == '__main__': poPath = r'PO\mpc-hc.installer.' + config.get('Info', 'langShortName') translationData = TranslationDataIS() translationData.loadFromPO(poPath, 'po', (False, False, True)) - # Write back the PO file to ensure it's properly normalized - translationData.writePO(poPath, 'po', (False, False, True)) + if normalizePOFile: + # Write back the PO file to ensure it's properly normalized + translationData.writePO(poPath, 'po', (False, False, True)) translationsConfigAndData.append((config, translationData)) - TranslationDataIS.translateIS(translationsConfigAndData, r'..\..\..\distrib\custom_messages.iss', r'..\..\..\distrib\custom_messages_translated.iss') + TranslationDataIS.translateIS(translationsConfigAndData, + r'..\..\..\distrib\custom_messages.iss', + r'..\..\..\distrib\custom_messages_translated.iss') + +if __name__ == '__main__': + UpdateIS() |