[rkward] scripts: Update translation import script for KF5

Thomas Friedrichsmeier null at kde.org
Tue Apr 3 20:37:24 UTC 2018


Git commit c574a5df6ad50d637bb16416fda535d7e3fe0c4c by Thomas Friedrichsmeier.
Committed on 03/04/2018 at 20:37.
Pushed by tfry into branch 'master'.

Update translation import script for KF5

M  +6    -2    scripts/import_translations.py

https://commits.kde.org/rkward/c574a5df6ad50d637bb16416fda535d7e3fe0c4c

diff --git a/scripts/import_translations.py b/scripts/import_translations.py
index 8df52b9e..83fb0098 100755
--- a/scripts/import_translations.py
+++ b/scripts/import_translations.py
@@ -29,7 +29,7 @@ import os
 import codecs
 import re
 
-SVNROOT = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kde4/"
+SVNROOT = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5/"
 RKWARDSVNPATH = "messages/playground-edu/"
 SCRIPTDIR = os.path.dirname (os.path.realpath (sys.argv[0]))
 TMPDIR = os.path.join (SCRIPTDIR, "tmp")
@@ -73,10 +73,14 @@ for lang in LANGUAGES:
     os.chdir (TMPDIR)
     for pofile in pofiles:
         outfile = os.path.join (EXPORTDIR, re.sub ("po$", lang + ".po", pofile))
+        infile = os.path.join (langdir, pofile)
+        if not os.path.isfile (infile):
+            print ("###### svn up failed to create " + infile + " #######")
+            continue
 
         # copy to destination, and strip unneeded comments
         print ("writing " + outfile)
-        pf = codecs.open (os.path.join (langdir, pofile), 'r', 'utf-8')
+        pf = codecs.open (infile, 'r', 'utf-8')
         of = codecs.open (outfile, 'w', 'utf-8')
         prev_was_comment = False
         for line in pf:



More information about the rkward-tracker mailing list