aboutsummaryrefslogtreecommitdiff
path: root/debian/merge-lumina-i18n.sh
blob: a69bcbfe952bda2556a4dd6c9fa00bbfc61a843e (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
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash

CURDIR="${PWD}"
LNGDIR="${PWD}/lumina-i18n/ts"

git clone https://github.com/pcbsd/lumina-i18n.git

[[ ! -d "${LNGDIR}" ]] && (echo "something went wrong!" && exit 1)

LANGS=("${LNGDIR}"/*)
LANGS=(${LANGS[@]/*\/ts\/})

UTILS=( config desktop fileinfo fm info open screenshot search textedit xconfig )

for lng in ${LANGS[@]}; do
	for utl in ${UTILS[@]}; do
		if [[ -e "${LNGDIR}"/${lng}/lumina-${utl}.ts ]]; then
			if [[ -d "${CURDIR}"/src-qt5/core/lumina-${utl} ]]; then
				cp "${LNGDIR}"/${lng}/lumina-${utl}.ts \
					"${CURDIR}"/src-qt5/core/lumina-${utl}/i18n/lumina-${utl}_${lng}.ts
			elif [[ -d "${CURDIR}"/src-qt5/core-utils/lumina-${utl} ]]; then
				cp "${LNGDIR}"/${lng}/lumina-${utl}.ts \
					"${CURDIR}"/src-qt5/core-utils/lumina-${utl}/i18n/lumina-${utl}_${lng}.ts
			elif [[ -d "${CURDIR}"/src-qt5/desktop-utils/lumina-${utl} ]]; then
				cp "${LNGDIR}"/${lng}/lumina-${utl}.ts \
					"${CURDIR}"/src-qt5/desktop-utils/lumina-${utl}/i18n/lumina-${utl}_${lng}.ts
			fi
		fi
	done
done

echo "updated lumina translations."

# satisfy dpkg-source when building a GIT snapshot
# first ensure all translations are known to GIT
# then create a commit using only the translation files
# other changes to the source will still be tracked by dpkg-source
[[ -d "${CURDIR}"/.git ]] && ( git add src-qt5/*/*/i18n/*.ts && git commit src-qt5/*/*/i18n/*.ts \
	-m "merge latest translations from https://github.com/pcbsd/lumina-i18n.git" )

rm -rf lumina-i18n
bgstack15