/[pcsx2_0.9.7]/trunk/generate_pot.sh
ViewVC logotype

Contents of /trunk/generate_pot.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 401 - (show annotations) (download) (as text)
Fri Feb 25 17:31:09 2011 UTC (9 years, 5 months ago) by william
File MIME type: application/x-sh
File size: 2962 byte(s)
Auto Commited Import of: pcsx2-0.9.7-DEBUG (upstream: v0.9.7.4358 local: v0.9.7.313-latest) in ./trunk
1 #!/bin/sh -e
2
3 # PCSX2 - PS2 Emulator for PCs
4 # Copyright (C) 2002-2010 PCSX2 Dev Team
5 #
6 # PCSX2 is free software: you can redistribute it and/or modify it under the terms
7 # of the GNU Lesser General Public License as published by the Free Software Found-
8 # ation, either version 3 of the License, or (at your option) any later version.
9 #
10 # PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 # without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 # PURPOSE. See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License along with PCSX2.
15 # If not, see <http://www.gnu.org/licenses/>.
16
17 # This script call xgettext utility to generate some nice pot (translation template) files
18
19 ######################################################################
20 # Script configuration
21 ######################################################################
22 VERSION=0.9.7
23 COPYRIGHT=PCSX2_Dev_Team #FIXME if someone is able to properly escape the space...
24 BUG_MAIL="http://code.google.com/p/pcsx2/"
25
26 GENERAL_OPTION="--sort-by-file --no-wrap \
27 --package-name=PCSX2 --package-version=$VERSION \
28 --copyright-holder=$COPYRIGHT --msgid-bugs-address=$BUG_MAIL"
29
30
31 ######################################################################
32 # Build Input file list
33 ######################################################################
34 [ ! -e pcsx2 ] && echo "pcsx2 directory not present" && return 1;
35 [ ! -e common ] && echo "common directory not present" && return 1;
36
37 # Build a list of all input files
38 input_files=""
39 for directory in pcsx2 common
40 do
41 for type in cpp h
42 do
43 new_input_files=`find $directory -iname "*.${type}" -print0 | xargs -0`
44 input_files="$input_files $new_input_files"
45 done
46 done
47
48 ######################################################################
49 # Generate the pot
50 ######################################################################
51 MAIN_FILE=locales/templates/pcsx2_Main.pot
52 MAIN_KEY=_
53
54 DEV_FILE=locales/templates/pcsx2_Devel.pot
55 DEV_KEY1=pxE_dev
56 DEV_KEY2=pxDt
57
58 ICO_FILE=locales/templates/pcsx2_Iconized.pot
59 ICO_KEY=pxE
60
61 TER_FILE=locales/templates/pcsx2_Tertiary.pot
62 TER_KEY=pxEt
63
64 echo "Generate $MAIN_FILE"
65 xgettext --keyword=$MAIN_KEY $GENERAL_OPTION $input_files --output=$MAIN_FILE
66 sed --in-place $MAIN_FILE --expression=s/charset=CHARSET/charset=UTF-8/
67
68 echo "Generate $DEV_FILE"
69 xgettext --keyword=$DEV_KEY1 --keyword=$DEV_KEY2 $GENERAL_OPTION $input_files --output=$DEV_FILE
70 sed --in-place $DEV_FILE --expression=s/charset=CHARSET/charset=UTF-8/
71
72 echo "Generate $ICO_FILE"
73 xgettext --keyword=$ICO_KEY $GENERAL_OPTION $input_files --output=$ICO_FILE
74 sed --in-place $ICO_FILE --expression=s/charset=CHARSET/charset=UTF-8/
75
76 echo "Generate $TER_FILE"
77 xgettext --keyword=$TER_KEY $GENERAL_OPTION $input_files --output=$TER_FILE
78 sed --in-place $TER_FILE --expression=s/charset=CHARSET/charset=UTF-8/

  ViewVC Help
Powered by ViewVC 1.1.22