[Libreoffice-commits] core.git: bin/ui-checkdomain.sh

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Tue May 28 08:06:16 UTC 2019


 bin/ui-checkdomain.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

New commits:
commit be17c39aab166532b4ba386c1e36f0404c19eb50
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Mon May 27 23:33:47 2019 +0200
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue May 28 10:05:34 2019 +0200

    bin/ui-checkdomain.sh: Script to check translation domain in .ui files
    
    Change-Id: Ibf6c181ecfb219ba5d142236471af03f8d3b32c6
    Reviewed-on: https://gerrit.libreoffice.org/73072
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/bin/ui-checkdomain.sh b/bin/ui-checkdomain.sh
new file mode 100755
index 000000000000..30e0c5b0f594
--- /dev/null
+++ b/bin/ui-checkdomain.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This script finds .ui files with incorrect translation domain set
+# and prints the domain, the file name and the expected domain
+# See also the discussion at https://gerrit.libreoffice.org/#/c/72973/
+
+declare -A modules
+
+# List of modules with .ui files and their expected translation domain
+modules+=(  \
+            [basctl]=basctl \
+            [chart2]=chart \
+            [cui]=cui \
+            [dbaccess]=dba \
+            [desktop]=dkt \
+            [editeng]=editeng \
+            [extensions]=pcr \
+            [filter]=flt \
+            [formula]="for" \
+            [fpicker]=fps \
+            [framework]=fwk \
+            [reportdesign]=rpt \
+            [sc]=sc \
+            [sd]=sd \
+            [sfx2]=sfx \
+            [starmath]=sm \
+            [svtools]=svt \
+            [svx]=svx \
+            [sw]=sw \
+            [uui]=uui \
+            [vcl]=vcl \
+            [writerperfect]=wpt \
+            [xmlsecurity]=xsc \
+)
+
+# Iterate the keys, i.e. modules with a uiconfig subdir
+for key in ${!modules[@]}; do
+    # Enumerate all .ui files in each module
+    for uifile in $(git ls-files ${key}/uiconfig/*\.ui); do
+        # Check that they contain the expected domain in double quotation marks, print the line if they don't
+        grep "\<interface domain=" $uifile | grep -v "\"${modules[${key}]}\"";
+        if [ "$?" -eq 0 ] ;
+            # Report the file name and the expected domain
+            then echo "^Problematic interface domain in file: $uifile ; should be: "${modules[${key}]}"";
+        fi
+    done
+done


More information about the Libreoffice-commits mailing list