File: install-translations

package info (click to toggle)
debputy 0.1.78
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 4,616 kB
  • sloc: python: 66,232; perl: 155; sh: 102; makefile: 39
file content (22 lines) | stat: -rwxr-xr-x 585 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh

set -e

LOCALES_DIR="${DESTDIR}/usr/share/locale"

run() {
  echo "$@"
  "$@"
}

for filename in $(find po/ -name '*.po' -type f); do
  language="$(basename "${filename}" .po)"
  domain="$(basename "$(dirname "$filename")")"
  output_dir="${LOCALES_DIR}/${language}/LC_MESSAGES"
  output_file="${output_dir}/${domain}.mo"
  if [ ! -d "${output_dir}" ]; then
    run install -d -m 0755 "${output_dir}"
  fi
  # --endianness => Ensure consistent output even if built on a big-endian host
  run msgfmt --statistics --endianness=little -c "${filename}" -o "${output_file}"
done