]> git.pld-linux.org Git - packages/google-chrome.git/blame - find-lang.sh
- Up to 53.0.2785.113, (flash 23.0.0.162)
[packages/google-chrome.git] / find-lang.sh
CommitLineData
b678fd32
ER
1#!/bin/sh
2PROG=${0##*/}
3if [ $# = 2 ]; then
4 # for using same syntax as rpm own find-lang
5 RPM_BUILD_ROOT=$1
6 shift
7fi
8dir=$RPM_BUILD_ROOT@localedir@/locales
9langfile=$1
10tmp=$(mktemp) || exit 1
11rc=0
12
13find $dir -name '*.pak' > $tmp
14
15echo '%defattr(644,root,root,755)' > $langfile
16while read file; do
17 lang=${file##*/}
18 lang=${lang%.pak}
19 case "$lang" in
20 zh-TW)
21 lang=zh_TW
22 ;;
23 zh-CN)
24 lang=zh_CN
25 ;;
26 en-US|en-GB)
27 lang=en
28 ;;
29 pt-BR)
30 lang=pt_BR
31 ;;
32 pt-PT)
33 lang=pt
34 ;;
35 es-419)
36 lang=es
37 ;;
c63aed29
AM
38 fake-bidi)
39 # ignore, testing locale: https://www.chromium.org/developers/testing/fake-bidi
40 continue
41 ;;
b678fd32 42 *-*)
c19259bf 43 echo >&2 "$PROG: ERROR: Need mapping for language: $lang!"
b678fd32
ER
44 rc=1
45 ;;
46 esac
47 echo "%lang($lang) ${file#$RPM_BUILD_ROOT}" >> $langfile
48done < $tmp
49
50if [ "$(egrep -v '(^%defattr|^$)' $langfile | wc -l)" -le 0 ]; then
51 echo >&2 "$PROG: Error: international files not found!"
52 rc=1
53fi
54
55rm -f $tmp
56exit $rc
This page took 0.141732 seconds and 4 git commands to generate.