-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmaketranslation
executable file
·34 lines (33 loc) · 1.24 KB
/
maketranslation
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
#!/bin/bash
ME="Israel Dahl"
basedir="${PWD}"
srcdir="${basedir}/src/"
fltkdir="${basedir}/fltk/"
outputdir="${basedir}/po"
[[ -d "${outputdir}" ]] || mkdir -p "${outputdir}"
programminglanguage="c++"
defaultdomain="jwm-settings-manager"
packagename="jwm-settings-manager"
comments="//"
pofile="jwm-settings-manager.pot"
xgettext -c --copyright-holder="\"$ME\"" -p "$outputdir" --strict --default-domain="$defaultdomain" --package-name="\"$packagename\"" --output "${outputdir}/${pofile}" --c++ --package-version=$verno fltk/*.cxx src/*.cpp
sed -i 's/CHARSET/UTF-8/' "${outputdir}/${pofile}"
programminglanguage="Shell"
comments="#"
xgettext -c --copyright-holder="\"$ME\"" -p "$outputdir" -j -L "$programminglanguage" --add-comments="$comments" --strict --default-domain="$defaultdomain" --package-version=$verno --package-name="\"$packagename\"" --output "${outputdir}/${pofile}" debian/postinst
cd "${basedir}"
echo "Generating the locales"
for locale in "$outputdir/"**.po
do
if [[ -f "$locale" ]]
then
echo $locale
DIR="${locale/*\/}"
DIR="${DIR/.po}"
DIR="$basedir/usr/share/locale/$DIR/LC_MESSAGES/"
[[ -d "$DIR" ]] || mkdir -p "$DIR"
msgfmt -o "$defaultdomain.mo" "$locale"
mv "$defaultdomain.mo" "$DIR"
fi
done
echo "Done"