-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrebuildTemplate.sh
More file actions
executable file
·64 lines (61 loc) · 1.6 KB
/
rebuildTemplate.sh
File metadata and controls
executable file
·64 lines (61 loc) · 1.6 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
function usage
{
echo "This tools can be used to rebuild the translation template"
echo "$0 --playonlinux $HOME/PlayOnLinux_Source --template lang/po/pol.pot"
}
if [ $# -lt 4 ]
then
usage
exit
fi
while [ $# -gt 0 ]
do
case $1 in
--playonlinux)
SOURCEDIR=$2
shift
shift
;;
--template)
TEMPLATE=$2
shift
shift
;;
*)
usage
;;
esac
done
echo "Chdir to '$SOURCEDIR'"
cd "$SOURCEDIR"
echo "Sauvegarde dans '$TEMPLATE'"
cat << EOF > $TEMPLATE
# PlayOnLinux translation template
# Copyright (C) 2007-2011 PlayOnLinux Team
# This file is distributed under the same license as the PlayOnLiux package.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PlayOnLinux\n"
"Report-Msgid-Bugs-To: MulX/APLU <pol-gettext@mulx.net>\n"
"POT-Creation-Date: $(date --rfc-3339=second)\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
EOF
tempory=$(mktemp)
#inclure les trads des plugins
[ -f plugins/pot.strings ] && cat plugins/pot.strings >> $TEMPLATE
#genere pour les fichiers shell
xgettext -L Shell -F -j --omit-header --foreign-user --from-code=utf-8 -o $tempory $(find bash -type f ) $(find lib -type f ) $(find PlayOnLinux_Scripts -type f ) playonlinux* || exit 255
#pareil pour python
xgettext -L Python -F -j --omit-header --foreign-user --from-code=utf-8 -o $tempory $(find python/ -type f ! -iname "*.pyc" ) || exit 255
cat $tempory >> $TEMPLATE
msgfmt -c $TEMPLATE -o /dev/null || exit 1
#cp $tempory $HOME
rm "$tempory"