Merge lp:~unit193/xubuntu-docs/linguas into lp:xubuntu-docs/trusty

Proposed by Unit 193
Status: Merged
Merged at revision: 148
Proposed branch: lp:~unit193/xubuntu-docs/linguas
Merge into: lp:xubuntu-docs/trusty
Diff against target: 282 lines (+75/-78)
9 files modified
Makefile (+6/-2)
debian/compat (+1/-1)
debian/control (+2/-3)
debian/rules (+2/-2)
desktop-guide/Makefile (+19/-1)
desktop-guide/po/LINGUAS (+3/-0)
scripts/rename-rosetta-po-files.sh (+0/-3)
scripts/translate.sh (+42/-33)
scripts/yelptest (+0/-33)
To merge this branch: bzr merge lp:~unit193/xubuntu-docs/linguas
Reviewer Review Type Date Requested Status
Pasi Lallinaho (community) Approve
Jack Fromm (community) Abstain
Micah Gersten Pending
Review via email: mp+205281@code.launchpad.net

Description of the change

* Updated the debian/ dir to remove cdbs and switch to dh.
* Intruduced the po/LINGUAS file to specify what translations to ship, and updated the Makefiles accordingly.
* Did an overhaul on the scripts/translate.sh script.
* Removed unused additional scripts.

To post a comment you must log in.
lp:~unit193/xubuntu-docs/linguas updated
134. By Unit 193 <unit193@Sigma>

Remove additional scripts.

Revision history for this message
Jack Fromm (jjfrv8) wrote :

Unit193, thanks. Of course I have no idea what I'm looking at ;)

review: Abstain
Revision history for this message
Pasi Lallinaho (knome) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2012-09-18 00:31:15 +0000
+++ Makefile 2014-02-07 01:59:54 +0000
@@ -1,11 +1,14 @@
1# Makefile for the Xubuntu Documentation1# Makefile for the Xubuntu Documentation
2# Ubuntu Documentation Project <ubuntu-doc@lists.ubuntu.com>2# Ubuntu Documentation Project <ubuntu-doc@lists.ubuntu.com>
33
4all: clean desktop-guide startpage4all: clean desktop-guide startpage translate
55
6desktop-guide:6desktop-guide:
7 make -C desktop-guide html7 make -C desktop-guide html
88
9translate:
10 make -C desktop-guide translate
11
9startpage:12startpage:
10 cp -r startpage/ build/about13 cp -r startpage/ build/about
1114
@@ -14,10 +17,11 @@
14 tar cvfz xubuntu-doc.tar.gz --exclude="*.tar.gz" --exclude="*~" --exclude "*.bzr*" *17 tar cvfz xubuntu-doc.tar.gz --exclude="*.tar.gz" --exclude="*~" --exclude "*.bzr*" *
1518
16clean:19clean:
20 make -C desktop-guide clean
17 rm -rf build21 rm -rf build
1822
19commit-clean:23commit-clean:
20 find . -name "*.po" -exec rm \{\} \+24 find . -name "*.po" -exec rm \{\} \+
21 find . -name "*.pot" -exec rm \{\} \+25 find . -name "*.pot" -exec rm \{\} \+
2226
23.PHONY: desktop-guide startpage27.PHONY: desktop-guide startpage translate
2428
=== modified file 'debian/compat'
--- debian/compat 2012-09-19 20:32:28 +0000
+++ debian/compat 2014-02-07 01:59:54 +0000
@@ -1,1 +1,1 @@
1819
22
=== modified file 'debian/control'
--- debian/control 2012-09-19 20:32:28 +0000
+++ debian/control 2014-02-07 01:59:54 +0000
@@ -2,13 +2,12 @@
2Section: doc2Section: doc
3Priority: optional3Priority: optional
4Maintainer: Ubuntu Documentation Team <ubuntu-doc@lists.ubuntu.com>4Maintainer: Ubuntu Documentation Team <ubuntu-doc@lists.ubuntu.com>
5Build-Depends: cdbs,5Build-Depends: debhelper (>= 9),
6 debhelper (>= 8),
7 docbook-xml,6 docbook-xml,
8 docbook-xsl,7 docbook-xsl,
9 xsltproc,8 xsltproc,
10 gnome-doc-utils9 gnome-doc-utils
11Standards-Version: 3.9.310Standards-Version: 3.9.5
1211
13Package: xubuntu-docs12Package: xubuntu-docs
14Architecture: all13Architecture: all
1514
=== modified file 'debian/rules'
--- debian/rules 2012-09-18 00:31:15 +0000
+++ debian/rules 2014-02-07 01:59:54 +0000
@@ -4,5 +4,5 @@
4DEB_MAKE_INSTALL_TARGET := 4DEB_MAKE_INSTALL_TARGET :=
5DEB_MAKE_BUILD_TARGET := all 5DEB_MAKE_BUILD_TARGET := all
66
7include /usr/share/cdbs/1/rules/debhelper.mk7%:
8include /usr/share/cdbs/1/class/makefile.mk8 dh $@
99
=== modified file 'desktop-guide/Makefile'
--- desktop-guide/Makefile 2014-01-07 00:17:08 +0000
+++ desktop-guide/Makefile 2014-02-07 01:59:54 +0000
@@ -5,6 +5,15 @@
5# Xubuntu Docbook Customization Layer5# Xubuntu Docbook Customization Layer
6XUBUNTUXSL=libs/xubuntu-html-chunk-cust.xsl6XUBUNTUXSL=libs/xubuntu-html-chunk-cust.xsl
77
8ifneq ($(wildcard po/LINGUAS),)
9 $(shell ../scripts/translate.sh -u >/dev/null)
10 OPTS=-g
11 TRANSLATIONS=$(shell cat po/LINGUAS)
12else
13 OPTS=
14 TRANSLATIONS=$(shell basename -s .po -a po/*po)
15endif
16
8html: style17html: style
9 xsltproc --xinclude -o ../build/desktop-guide/index.html $(XUBUNTUXSL) C/index.xml18 xsltproc --xinclude -o ../build/desktop-guide/index.html $(XUBUNTUXSL) C/index.xml
1019
@@ -15,4 +24,13 @@
15 cp -r libs/admon ../build/libs24 cp -r libs/admon ../build/libs
16 cp -r libs/navig ../build/libs25 cp -r libs/navig ../build/libs
1726
18.PHONY: html27translate:
28 ../scripts/translate.sh $(OPTS); \
29 for dir in $(TRANSLATIONS); do \
30 xsltproc --xinclude -o ../build/$$dir/index.html $(XUBUNTUXSL) $$dir/index.xml && \
31 rm -rf $$dir/; \
32 done
33
34clean:
35 ${RM} -r $(TRANSLATIONS)
36.PHONY: html translate
1937
=== added file 'desktop-guide/po/LINGUAS'
--- desktop-guide/po/LINGUAS 1970-01-01 00:00:00 +0000
+++ desktop-guide/po/LINGUAS 2014-02-07 01:59:54 +0000
@@ -0,0 +1,3 @@
1fi
2pt
3ru
04
=== removed file 'scripts/rename-rosetta-po-files.sh'
--- scripts/rename-rosetta-po-files.sh 2013-05-17 11:53:41 +0000
+++ scripts/rename-rosetta-po-files.sh 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1# This script renames po files downloaded from Launchpad into a standard format filename. It works around this bug in Launchpad: https://bugs.launchpad.net/bugs/353981
2
3for i in `cat libs/shipped-docs` serverguide ; do cd $i/po ; mv ../*.po . ; for x in ubuntu-docs-$i-*.po ; do echo $x ; mv $x ${x#ubuntu-docs-$i-} ; done ; cd ../../ ; done
40
=== modified file 'scripts/translate.sh'
--- scripts/translate.sh 2012-09-18 00:31:15 +0000
+++ scripts/translate.sh 2014-02-07 01:59:54 +0000
@@ -1,11 +1,11 @@
1#!/bin/sh1#!/bin/sh
22
3#################################################################################### 3####################################################################################
4# Copyright (C) 2005-2006 Ubuntu Documentation Project (ubuntu-doc@lists.ubuntu.com)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 modify5# 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 by6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version. 8# (at your option) any later version.
9#9#
10# This program is distributed in the hope that it will be useful,10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of11# but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,7 +15,7 @@
15# You should have received a copy of the GNU General Public License15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA17# 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 18# On Debian based systems a copy of the GPL can be found
19# at /usr/share/common-licenses/GPL19# at /usr/share/common-licenses/GPL
20####################################################################################20####################################################################################
2121
@@ -25,55 +25,64 @@
25# $ translate.sh25# $ translate.sh
26#26#
27# Optional parameters:27# Optional parameters:
28# -d<documentname>28# -g Translate for every language listed in po/LINGUAS
29# -l<language>29# -l<language>
30# -u Update the list of translations in po/LINGUAS
30#31#
3132
32translate () {33translate() {
33 y=$(basename ${1} .po)34 lang=$(basename ${1} .po)
34 echo " --Translating ${y}"35 echo " --Translating ${lang}"
35 mkdir -p ${y}36 mkdir -p ${lang}
36 for i in C/*xml; do37 for i in C/*xml; do
37 j=$(basename ${i} C/)38 xml=$(basename ${i} C/)
38 k=$(basename ${j} .xml)39 xml2po -e -p po/${lang}.po C/${xml} >${lang}/${xml}
39 xml2po -e -p po/${y}.po C/${j} >${y}/${j}
40 done40 done
41 if [ -e C/${document}-C.omf ]; then41 if [ -e C/${document}-C.omf ]; then
42 xml2po -e -p ${1} C/${document}-C.omf >${y}/${document}-${y}.omf42 xml2po -e -p ${1} C/${document}-C.omf >${lang}/${document}-${lang}.omf
43 sed -i -e s@\"C\"@\"${y}\"@g -e s@C/@${y}/@g ${y}/${document}-${y}.omf43 sed -i -e s@\"C\"@\"${lang}\"@g -e s@C/@${lang}/@g ${lang}/${document}-${lang}.omf
44 fi44 fi
45 ../scripts/validate.sh ${y}/${document}.xml45 ../scripts/validate.sh ${lang}/index.xml
46}46}
4747
48choose_language () {48choose_language() {
49 echo "Entering ${1}"49 if [ ${1} ]; then
50 cd ${1}50 translate "po/${1}.po"
51 if [ ${2} ]; then
52 translate "po/${2}.po"
53 else51 else
54 for x in po/*.po; do52 for x in po/*.po; do
55 translate ${x}53 translate ${x}
56 done54 done
57 fi55 fi
58 rm .xml2po.mo56}
59 cd ..57
60}58shipped_languages() {
6159percent=80
62while getopts "d:l:" Option60for po in `ls po/*.po`
61do
62 if [ `msgfmt -o /dev/null --statistics $po 2>&1|awk '{printf("%.0f\n",$1 / ($1 + $4 + $7) * 100)}'` -ge "${percent}" ];then
63 basename -s.po $po
64 fi
65done | tee po/LINGUAS
66exit
67}
68
69while getopts ":gl:u" Option
63do70do
64 case ${Option} in71 case ${Option} in
65 d) document=${OPTARG};;72 g) generated=yes;;
66 l) lang=${OPTARG};;73 l) language=${OPTARG};;
74 u) shipped_languages;;
67 *) echo "Please specify an argument.";;75 *) echo "Please specify an argument.";;
68 esac76 esac
69done77done
7078
71if [ ${document} ]; then79if [ ${language} ]; then
72 choose_language ${document} ${lang}80 choose_language ${language}
81elif [ ${generated} ] && [ -f po/LINGUAS ];then
82 for language in `cat po/LINGUAS`
83 do
84 choose_language ${language}
85 done
73else86else
74 for doc in `cat libs/shipped-docs`87 choose_language
75 do
76 choose_language ${doc} ${lang}
77 done
78fi88fi
79
8089
=== removed file 'scripts/yelptest'
--- scripts/yelptest 2012-09-18 00:31:15 +0000
+++ scripts/yelptest 1970-01-01 00:00:00 +0000
@@ -1,33 +0,0 @@
1#!/bin/bash
2
3####################################################################################
4# Yelp test script for Ubuntu Topic-based help
5# Copyright (C) 2006 Ubuntu Documentation Project (ubuntu-doc@lists.ubuntu.com)
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19# On Debian based systems a copy of the GPL can be found
20# at /usr/share/common-licenses/GPL
21#
22####################################################################################
23
24document=ubuntu/C/$1/$1.xml
25if [ -e $document ]
26then
27 yelp $document
28elif [ -e $1 ]
29then
30 yelp $1
31else
32 echo "Sorry! Document '$document' or file '$1' does not exist."
33fi

Subscribers

People subscribed via source and target branches