tdf#118711 writerfilter: don't hardcode default page description
[LibreOffice.git] / bin / ui-checkdomain.sh
blob30e0c5b0f594574e6bcd27f2d5f66db4976be8d5
1 #!/bin/bash
2 # This file is part of the LibreOffice project.
4 # This Source Code Form is subject to the terms of the Mozilla Public
5 # License, v. 2.0. If a copy of the MPL was not distributed with this
6 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # This script finds .ui files with incorrect translation domain set
9 # and prints the domain, the file name and the expected domain
10 # See also the discussion at https://gerrit.libreoffice.org/#/c/72973/
12 declare -A modules
14 # List of modules with .ui files and their expected translation domain
15 modules+=( \
16 [basctl]=basctl \
17 [chart2]=chart \
18 [cui]=cui \
19 [dbaccess]=dba \
20 [desktop]=dkt \
21 [editeng]=editeng \
22 [extensions]=pcr \
23 [filter]=flt \
24 [formula]="for" \
25 [fpicker]=fps \
26 [framework]=fwk \
27 [reportdesign]=rpt \
28 [sc]=sc \
29 [sd]=sd \
30 [sfx2]=sfx \
31 [starmath]=sm \
32 [svtools]=svt \
33 [svx]=svx \
34 [sw]=sw \
35 [uui]=uui \
36 [vcl]=vcl \
37 [writerperfect]=wpt \
38 [xmlsecurity]=xsc \
41 # Iterate the keys, i.e. modules with a uiconfig subdir
42 for key in ${!modules[@]}; do
43 # Enumerate all .ui files in each module
44 for uifile in $(git ls-files ${key}/uiconfig/*\.ui); do
45 # Check that they contain the expected domain in double quotation marks, print the line if they don't
46 grep "\<interface domain=" $uifile | grep -v "\"${modules[${key}]}\"";
47 if [ "$?" -eq 0 ] ;
48 # Report the file name and the expected domain
49 then echo "^Problematic interface domain in file: $uifile ; should be: "${modules[${key}]}"";
51 done
52 done