summaryrefslogtreecommitdiffstats
path: root/generate-languages-list
blob: d8daded3852433e3ffecdd0a399c49db526a66a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! /bin/sh

set -e
set -u

echo "Generating list of supported languages"

OUTFILE="config/chroot_local-includes/usr/share/tails/greeter/supported_languages"

# Add our tier-1 supported languages
LANG_CODES="ar de en es fa fr hi it pt ru tr zh"

# Add the languages which have translations in Tails
TRANSLATED="$(find po -name "*.po" -exec basename {} \; | \
              sed -e "s/\.po//" -e "s/\(.*\)_.*/\1/g")"
LANG_CODES="${LANG_CODES} ${TRANSLATED}"

# Write the list to the output file
echo "${LANG_CODES}" | tr " " "\n" | sort | uniq | tr "\n" " " > "${OUTFILE}"