]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
intl: little optimization to po utils
authorJaroslav Kysela <perex@perex.cz>
Sat, 20 Jun 2015 14:42:26 +0000 (16:42 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 20 Jun 2015 14:42:26 +0000 (16:42 +0200)
support/poc.py
support/pojs.py

index b323914354c9cf7f62d4aea141723f8f8e71fe56..81475fb7b8bbf9e0d6430fecaad89d270b616b90 100755 (executable)
@@ -122,7 +122,9 @@ def to_c(po_files):
     sep = ''
     for s in strings:
       if s != strings[s]:
-        sys.stdout.write('%s"%s", "%s"' % (sep, cstr(s), cstr(strings[s])));
+        a = cstr(s)
+        b = cstr(strings[s])
+        sys.stdout.write('%s"%s", "%s"' % (sep, a, b));
         sep = ',\n'
     sys.stdout.write('%sNULL, NULL' % sep)
     sys.stdout.write('\n};\n\n');
index e42ce269da2d15153848cb0537bb108de4aa3efe..3c829aae748b32a6ba431d1e80caa79abc23fa3a 100755 (executable)
@@ -111,7 +111,10 @@ def cnv(fn):
   sep = ''
   for s in po.strings:
     if s != po.strings[s]:
-      sys.stdout.write("%s'%s':'%s'" % (sep, jsstr(s), jsstr(po.strings[s])))
+      a = jsstr(s)
+      b = jsstr(po.strings[s])
+      if a != b:
+        sys.stdout.write("%s'%s':'%s'" % (sep, a, b))
       sep = ',\n'
   sys.stdout.write("\n}\n");