aboutsummaryrefslogtreecommitdiffstats
path: root/tools/po-compile.sh
blob: 0a470c18a4ca2b84d64cd2af8f5cb53432508682 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

set -e

cd "$(readlink -f "$(dirname "$0")/..")"
update_mo(){
	echo $1
	language="$(basename "$1")"
	language="${language%.po}"
	target="$PWD/share/locale/$language/LC_MESSAGES/isodumper.mo"
	echo $target
	/bin/mkdir --parents "$(dirname "$target")"
	/usr/bin/msgfmt \
		--check \
		--output-file="$target" \
		"$1"
}

if test "$1"; then
  for l in $(find "$PWD/po" -type f -name "$1.po"); do
  echo $l
  update_mo "$l"
  done
else
  for l in $(find "$PWD/po" -type f -name '*.po'); do
    update_mo "$l"
  done
fi