~ubuntu-branches/ubuntu/maverick/kubuntu-docs/maverick

« back to all changes in this revision

Viewing changes to kubuntu/translate.sh

  • Committer: Bazaar Package Importer
  • Author(s): Richard A. Johnson
  • Date: 2008-02-23 01:50:44 UTC
  • Revision ID: james.westby@ubuntu.com-20080223015044-ndflf9vgrl0nwlpq
Tags: 8.04-1
* Initial Hardy Release, closes the following bug reports:
  - FTBFS in latest archive rebuild test - replaced kdelibs-bin with
    kdelibs4c2a (LP: #194514)
  - Faulty strings in Games documentation (LP: #141239)
  - Missing word in French translated Firefox homepage (LP: #159645)
  - Typo in Multimedia documentation (LP: #177461)
* Bumped Standards-Version to 3.7.3
* Cleaned up debian/control to contain no more than 80 columns per row
* Commented out translation stuff in debian/rules until the new translations
  are completed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
####################################################################################           
4
 
# Copyright (C) 2005-2006 Ubuntu Documentation Project (ubuntu-doc@lists.ubuntu.com)
5
 
#    This program is free software; you can redistribute it and/or modify
6
 
#    it under the terms of the GNU General Public License as published by
7
 
#    the Free Software Foundation; either version 2 of the License, or
8
 
#    (at your option) any later version. 
9
 
#
10
 
#    This program is distributed in the hope that it will be useful,
11
 
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
#    GNU General Public License for more details.
14
 
#
15
 
#    You should have received a copy of the GNU General Public License
16
 
#    along with this program; if not, write to the Free Software
17
 
#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
#    On Debian based systems a copy of the GPL can be found 
19
 
#    at /usr/share/common-licenses/GPL
20
 
####################################################################################
21
 
 
22
 
# NB - DON'T ATTEMPT TO USE THIS YET, IT HASN'T BEEN TESTED MUCH.
23
 
#
24
 
# This script is for generating XML documents from po files downloaded from Launchpad
25
 
# Put your freshly downloaded po files into the po folder under each document, then run:
26
 
#
27
 
# $ translate.sh
28
 
#
29
 
# Optional parameters:
30
 
#       -d<documentname>
31
 
#       -l<language>
32
 
#
33
 
 
34
 
translate () {
35
 
        y=$(basename ${1} .po)
36
 
        echo " ${y}"
37
 
        mkdir -p ${y}
38
 
        for i in C/*xml; do
39
 
                j=$(basename ${i} C/)
40
 
                echo ${j}
41
 
                k=$(basename ${j} .xml)
42
 
                echo ${k}
43
 
                xml2po -e -p po/${y}.po C/${j} >${y}/${j}
44
 
        done
45
 
        #if [ -e C/${document}-C.omf ]; then
46
 
        #       echo "  Generating omf file for ${document}"
47
 
        #    xml2po -e -p ${1} C/${document}-C.omf >${y}/${document}-${y}.omf
48
 
        #    sed -i -e s@\"C\"@\"${y}\"@g -e s@C/@${y}/@g ${y}/${document}-${y}.omf
49
 
        #fi
50
 
        ../../validate.sh ${y}/${document}.xml
51
 
        #svn add -q ${y}
52
 
}
53
 
 
54
 
choose_language () {
55
 
        echo "Entering ${1}"
56
 
        cd ${1}
57
 
        if [ ${2} ]; then
58
 
                translate "po/${2}.po"
59
 
        else
60
 
                for x in po/*; do
61
 
                        translate ${x}
62
 
                done
63
 
        fi
64
 
        rm .xml2po.mo
65
 
        cd ..
66
 
}
67
 
 
68
 
while getopts "d:l:" Option
69
 
do
70
 
        case ${Option} in
71
 
                d) document=${OPTARG};;
72
 
                l) lang=${OPTARG};;
73
 
                *) echo "Please specify an argument.";;
74
 
        esac
75
 
done
76
 
 
77
 
if [ ${document} ]; then
78
 
        choose_language ${document} ${lang}
79
 
else
80
 
        for doc in `cat libs/shipped-docs`
81
 
        do
82
 
                choose_language ${doc} ${lang}
83
 
        done
84
 
fi
85