diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-11-22 18:14:12 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-11-22 18:25:38 +0100 |
commit | 8e0e7bf4fe78b2900ab56ae1ec367b4cb67e3dab (patch) | |
tree | 8e54fdf5c2c076fa54890bb521560b1314e7edcc | |
parent | cb97d67fd39a23386e055c7f211929677306f2d2 (diff) | |
download | qttranslations-8e0e7bf4fe78b2900ab56ae1ec367b4cb67e3dab.tar.gz |
don't crash when ts files contains no strings
this will be valid for the qt aggregator catalogs
Change-Id: I93af54b7a1e27a90040fdf4c72b437f6bcc69cac
-rw-r--r-- | translations/check-ts.xq | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/translations/check-ts.xq b/translations/check-ts.xq index 2d6404c..050f505 100644 --- a/translations/check-ts.xq +++ b/translations/check-ts.xq @@ -1,3 +1,5 @@ for $file in tokenize($files, codepoints-to-string(10)) let $fresh := doc($file)/TS/context/message[not (translation/@type = 'obsolete')] - return concat($file, ":", count($fresh/translation[not (@type = 'unfinished')]) * 100 idiv count($fresh)) + return if (count($fresh) gt 0) + then concat($file, ":", count($fresh/translation[not (@type = 'unfinished')]) * 100 idiv count($fresh)) + else concat($file, ":n/a") |