Debian Codegraph @

.gitlab-ci/check-po

raw symbols SCIP
1 #!/bin/bash
2 #
3 # Copyright (C) 2024 The Phosh developers
4 # SPDX-License-Identifier: GPL-3.0-or-later
5 # Author: Guido Günther <[email protected]>
6
7 cd po/ || exit 1
8 # barf on untranslated C files. Seems intltool
9 # can't be told to exit with non-zero exit status
10 # in this case
11
12 if intltool-update -m 2>&1 | grep -E -qs '/.*\.(c|ui|in)'; then
13 intltool-update -m
14 exit 1
15 fi
16
17 # Check for broken po files
18 for file in *.po; do
19 echo -n "Checking ${file}: "
20 msgfmt -v -c "${file}"
21 # Check for errors, msgfmt returns 0 on errors too
22 if msgfmt -c "${file}" 2>&1 | grep -qs 'fatal error'; then
23 exit 1
24 fi
25 done