~s-cecilio/lenmus/trunk

« back to all changes in this revision

Viewing changes to scripts/i18n/po-lenmus

  • Committer: Cecilio Salmeron
  • Date: 2012-10-27 11:00:21 UTC
  • Revision ID: s.cecilios@gmail.com-20121027110021-r6i71efrb27id7g6
final changes for 5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/bash
 
2
#------------------------------------------------------------------------------
 
3
# Update/generate lenmus.pot file and update lenmus_xx.po files for
 
4
# all languages
 
5
# This script MUST BE RUN from scripts/i18n/ folder, in source tree
 
6
#
 
7
# usage: ./po-lenmus version
 
8
#------------------------------------------------------------------------------
 
9
 
 
10
#------------------------------------------------------------------------------
 
11
# update old PO file
 
12
function UpdatePO()
 
13
{
 
14
    LANG=$1
 
15
    VERS=$2
 
16
    echo "Updating file lenmus_$LANG.po"
 
17
    cd /datos/USR/lm/projects/lenmus/trunk/locale/$LANG
 
18
    sed --in-place lenmus_$LANG.po -e 's/"Project-Id-Version:.*/"Project-Id-Version: LenMus $VERS\\n"/'
 
19
    msgmerge --update -v lenmus_$LANG.po ../lenmus.pot
 
20
}
 
21
 
 
22
 
 
23
#------------------------------------------------------------------------------
 
24
# main line starts here
 
25
 
 
26
E_SUCCESS=0         # success
 
27
E_NOARGS=65         # no arguments
 
28
 
 
29
 
 
30
# check that pack version is present
 
31
if [ -n "$1" ]
 
32
then
 
33
    echo "Usage: `basename $0` pack-version"
 
34
    exit $E_NOARGS
 
35
fi
 
36
 
 
37
# Create/Update the POT file
 
38
echo "Updating file lenmus.pot"
 
39
cd /datos/USR/lm/projects/lenmus/trunk/locale
 
40
xgettext -s --from-code=UTF-8 --keyword=_ lenmus.pot \
 
41
    $(find ../src -name "*.cpp") \
 
42
    $(find ../xrc -name "*.cpp") \
 
43
    ../installer/msw/locale/installer-strings.cpp 
 
44
 
 
45
# For each language, update old PO file
 
46
UpdatePO de $1
 
47
UpdatePO es $1
 
48
UpdatePO eu $1
 
49
UpdatePO fr $1
 
50
UpdatePO gl_ES $1
 
51
UpdatePO it $1
 
52
UpdatePO nl $1
 
53
UpdatePO tr $1
 
54
UpdatePO zh_CN $1
 
55
 
 
56
echo "done"
 
57
exit $E_SUCCESS