Merge lp:~timo-jyrinki/example-content/folder_i18n into lp:~ubuntu-core-dev/example-content/ubuntu
- folder_i18n
- Merge into ubuntu
Proposed by
Timo Jyrinki
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~timo-jyrinki/example-content/folder_i18n |
Merge into: | lp:~ubuntu-core-dev/example-content/ubuntu |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~timo-jyrinki/example-content/folder_i18n |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ubuntu Core Development Team | Pending | ||
Review via email: mp+4416@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote : | # |
- 51. By Timo Jyrinki <timo@olohuone>
-
Remove postrm which I forgot. Not needed anymore.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added directory 'data' |
2 | === added file 'data/examples.desktop.in' |
3 | --- data/examples.desktop.in 1970-01-01 00:00:00 +0000 |
4 | +++ data/examples.desktop.in 2009-03-12 18:09:45 +0000 |
5 | @@ -0,0 +1,8 @@ |
6 | +[Desktop Entry] |
7 | +Version=1.0 |
8 | +Type=Link |
9 | +_Name=Examples |
10 | +_Comment=Example content for Ubuntu |
11 | +URL=file:///usr/share/example-content/ |
12 | +X-Ubuntu-Gettext-Domain=example-content |
13 | + |
14 | |
15 | === modified file 'debian/changelog' |
16 | --- debian/changelog 2008-10-22 07:16:03 +0000 |
17 | +++ debian/changelog 2009-03-12 18:09:45 +0000 |
18 | @@ -1,3 +1,13 @@ |
19 | +example-content (36) jaunty; urgency=low |
20 | + |
21 | + * Change symlink into a .desktop file |
22 | + * Add I18N infrastructure for the .desktop file using Python (LP: #45489) |
23 | + * Move content from root to main and source directories |
24 | + * Update Standards-Version (no changes) |
25 | + * Update copyright file |
26 | + |
27 | + -- Timo Jyrinki <timo.jyrinki@iki.fi> Thu, 11 Mar 2009 19:56:55 +0200 |
28 | + |
29 | example-content (35) intrepid; urgency=low |
30 | |
31 | * fables_01_01_aesop.spx: re-encoded the file at the proper bitrate, smaller |
32 | |
33 | === modified file 'debian/control' |
34 | --- debian/control 2008-10-07 06:22:21 +0000 |
35 | +++ debian/control 2009-03-12 18:09:45 +0000 |
36 | @@ -2,14 +2,15 @@ |
37 | Section: x11 |
38 | Priority: optional |
39 | Maintainer: Ubuntu Artwork Team <ubuntu-art@lists.ubuntu.com> |
40 | -Build-Depends: cdbs, debhelper (>= 5), |
41 | +Build-Depends: cdbs, debhelper (>= 5), po-debconf, python-central, python-dev, python-setuptools, python-distutils-extra |
42 | #Build-Depends-Indep: openoffice.org-dev, xvfb, xfonts-base |
43 | XS-Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-art-pkg/example-content/ubuntu |
44 | -Standards-Version: 3.7.3 |
45 | +Standards-Version: 3.8.0 |
46 | Homepage: https://launchpad.net/example-content |
47 | |
48 | Package: example-content |
49 | Architecture: all |
50 | +Depends: ${misc:Depends} |
51 | Description: Ubuntu example content |
52 | For each desktop application in the default install where it is practical, |
53 | we provide at least one piece of example content. This is valuable for |
54 | |
55 | === modified file 'debian/copyright' |
56 | --- debian/copyright 2006-09-07 15:31:30 +0000 |
57 | +++ debian/copyright 2009-03-12 18:09:45 +0000 |
58 | @@ -60,6 +60,12 @@ |
59 | Henrik Nilsen Omma <henrik@ubuntu.com> |
60 | |
61 | |
62 | +Python I18N framework: |
63 | +Based loosely on checkbox package's framework by Marc Tardif |
64 | +<marc.tardif@canonical.com>, modified for example-content usage |
65 | +by Timo Jyrinki <timo.jyrinki@iki.fi>. Licensed under GPL. |
66 | + |
67 | + |
68 | |
69 | License: |
70 | |
71 | |
72 | === modified file 'debian/install' |
73 | --- debian/install 2008-10-16 09:58:27 +0000 |
74 | +++ debian/install 2009-03-12 18:09:45 +0000 |
75 | @@ -1,4 +1,1 @@ |
76 | -*.{doc,odg,odp,ods,odt,ogg,png,rtf,spx,TXT,xcf,xls,pdf,jpg} /usr/share/example-content |
77 | -#build/usr/lib/openoffice /usr/lib |
78 | -logos /usr/share/example-content |
79 | -Ubuntu_Free_Culture_Showcase /usr/share/example-content |
80 | +etc/skel/examples.desktop /etc/skel |
81 | |
82 | === removed file 'debian/links' |
83 | --- debian/links 2006-03-23 13:56:32 +0000 |
84 | +++ debian/links 1970-01-01 00:00:00 +0000 |
85 | @@ -1,1 +0,0 @@ |
86 | -/usr/share/example-content /etc/skel/Examples |
87 | |
88 | === modified file 'debian/rules' |
89 | --- debian/rules 2008-10-07 06:22:21 +0000 |
90 | +++ debian/rules 2009-03-12 18:09:45 +0000 |
91 | @@ -1,5 +1,15 @@ |
92 | #!/usr/bin/make -f |
93 | + |
94 | +DEB_PYTHON_SYSTEM := pycentral |
95 | + |
96 | include /usr/share/cdbs/1/rules/debhelper.mk |
97 | +include /usr/share/cdbs/1/class/python-distutils.mk |
98 | + |
99 | +# DEB_PYTHON_INSTALL_ARGS_ALL := --no-compile |
100 | +# --single-version-externally-managed |
101 | + |
102 | +clean:: |
103 | + rm -rf build etc example_content.egg-info debian/pycompat |
104 | |
105 | # oversized .svg files |
106 | OVERSIZED_FILES := |
107 | |
108 | === added directory 'main' |
109 | === renamed file 'case_Contact.pdf' => 'main/case_Contact.pdf' |
110 | === renamed file 'case_KRUU.pdf' => 'main/case_KRUU.pdf' |
111 | === renamed file 'case_OaklandUniversity.pdf' => 'main/case_OaklandUniversity.pdf' |
112 | === renamed file 'case_Skegness.pdf' => 'main/case_Skegness.pdf' |
113 | === renamed file 'case_Wellcome.pdf' => 'main/case_Wellcome.pdf' |
114 | === renamed file 'case_howard_county_library.pdf' => 'main/case_howard_county_library.pdf' |
115 | === renamed file 'case_oxford_archaeology.pdf' => 'main/case_oxford_archaeology.pdf' |
116 | === renamed file 'case_ubuntu_johnshopkins_v2.pdf' => 'main/case_ubuntu_johnshopkins_v2.pdf' |
117 | === renamed file 'case_ubuntu_locatrix_v1.pdf' => 'main/case_ubuntu_locatrix_v1.pdf' |
118 | === renamed file 'fables_01_01_aesop.spx' => 'main/fables_01_01_aesop.spx' |
119 | === renamed file 'gimp-ubuntu-splash.xcf' => 'main/gimp-ubuntu-splash.xcf' |
120 | === renamed file 'kubuntu-leaflet.jpg' => 'main/kubuntu-leaflet.jpg' |
121 | === renamed file 'oo-about-these-files.odt' => 'main/oo-about-these-files.odt' |
122 | === renamed file 'oo-about-ubuntu-ru.rtf' => 'main/oo-about-ubuntu-ru.rtf' |
123 | === renamed file 'oo-derivatives.doc' => 'main/oo-derivatives.doc' |
124 | === renamed file 'oo-maxwell.odt' => 'main/oo-maxwell.odt' |
125 | === renamed file 'oo-payment-schedule.ods' => 'main/oo-payment-schedule.ods' |
126 | === renamed file 'oo-presenting-kubuntu.odp' => 'main/oo-presenting-kubuntu.odp' |
127 | === renamed file 'oo-presenting-ubuntu.odp' => 'main/oo-presenting-ubuntu.odp' |
128 | === renamed file 'oo-trig.xls' => 'main/oo-trig.xls' |
129 | === renamed file 'oo-welcome.odt' => 'main/oo-welcome.odt' |
130 | === added directory 'po' |
131 | === added file 'po/POTFILES.in' |
132 | --- po/POTFILES.in 1970-01-01 00:00:00 +0000 |
133 | +++ po/POTFILES.in 2009-03-12 18:09:45 +0000 |
134 | @@ -0,0 +1,6 @@ |
135 | +# List of source files containing translatable strings. |
136 | +# Please keep this file sorted alphabetically. |
137 | +# |
138 | +[encoding: UTF-8] |
139 | +data/examples.desktop.in |
140 | + |
141 | |
142 | === added file 'po/es.po' |
143 | --- po/es.po 1970-01-01 00:00:00 +0000 |
144 | +++ po/es.po 2009-03-12 18:09:45 +0000 |
145 | @@ -0,0 +1,25 @@ |
146 | +# SOME DESCRIPTIVE TITLE. |
147 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
148 | +# This file is distributed under the same license as the PACKAGE package. |
149 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
150 | +# |
151 | +#, fuzzy |
152 | +msgid "" |
153 | +msgstr "" |
154 | +"Project-Id-Version: example-content\n" |
155 | +"Report-Msgid-Bugs-To: \n" |
156 | +"POT-Creation-Date: 2009-03-11 11:36+0200\n" |
157 | +"PO-Revision-Date: 2009-03-11 11:39+0200\n" |
158 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
159 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
160 | +"MIME-Version: 1.0\n" |
161 | +"Content-Type: text/plain; charset=UTF-8\n" |
162 | +"Content-Transfer-Encoding: 8bit\n" |
163 | + |
164 | +#: ../data/examples.desktop.in.h:1 |
165 | +msgid "Example content for Ubuntu" |
166 | +msgstr "Contenido del ejemplo para Ubuntu" |
167 | + |
168 | +#: ../data/examples.desktop.in.h:2 |
169 | +msgid "Examples" |
170 | +msgstr "Ejemplos" |
171 | |
172 | === added file 'po/example-content.pot' |
173 | --- po/example-content.pot 1970-01-01 00:00:00 +0000 |
174 | +++ po/example-content.pot 2009-03-12 18:09:45 +0000 |
175 | @@ -0,0 +1,25 @@ |
176 | +# SOME DESCRIPTIVE TITLE. |
177 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
178 | +# This file is distributed under the same license as the PACKAGE package. |
179 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
180 | +# |
181 | +#, fuzzy |
182 | +msgid "" |
183 | +msgstr "" |
184 | +"Project-Id-Version: PACKAGE VERSION\n" |
185 | +"Report-Msgid-Bugs-To: \n" |
186 | +"POT-Creation-Date: 2009-03-12 17:04+0200\n" |
187 | +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" |
188 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
189 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
190 | +"MIME-Version: 1.0\n" |
191 | +"Content-Type: text/plain; charset=CHARSET\n" |
192 | +"Content-Transfer-Encoding: 8bit\n" |
193 | + |
194 | +#: ../data/examples.desktop.in.h:1 |
195 | +msgid "Example content for Ubuntu" |
196 | +msgstr "" |
197 | + |
198 | +#: ../data/examples.desktop.in.h:2 |
199 | +msgid "Examples" |
200 | +msgstr "" |
201 | |
202 | === added file 'po/fi.po' |
203 | --- po/fi.po 1970-01-01 00:00:00 +0000 |
204 | +++ po/fi.po 2009-03-12 18:09:45 +0000 |
205 | @@ -0,0 +1,25 @@ |
206 | +# SOME DESCRIPTIVE TITLE. |
207 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
208 | +# This file is distributed under the same license as the PACKAGE package. |
209 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
210 | +# |
211 | +#, fuzzy |
212 | +msgid "" |
213 | +msgstr "" |
214 | +"Project-Id-Version: example-content\n" |
215 | +"Report-Msgid-Bugs-To: \n" |
216 | +"POT-Creation-Date: 2009-03-11 11:36+0200\n" |
217 | +"PO-Revision-Date: 2009-03-11 11:39+0200\n" |
218 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
219 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
220 | +"MIME-Version: 1.0\n" |
221 | +"Content-Type: text/plain; charset=UTF-8\n" |
222 | +"Content-Transfer-Encoding: 8bit\n" |
223 | + |
224 | +#: ../data/examples.desktop.in.h:1 |
225 | +msgid "Example content for Ubuntu" |
226 | +msgstr "Esimerkkisisältöjä Ubuntulle" |
227 | + |
228 | +#: ../data/examples.desktop.in.h:2 |
229 | +msgid "Examples" |
230 | +msgstr "Esimerkkejä" |
231 | |
232 | === added file 'po/fr.po' |
233 | --- po/fr.po 1970-01-01 00:00:00 +0000 |
234 | +++ po/fr.po 2009-03-12 18:09:45 +0000 |
235 | @@ -0,0 +1,25 @@ |
236 | +# SOME DESCRIPTIVE TITLE. |
237 | +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER |
238 | +# This file is distributed under the same license as the PACKAGE package. |
239 | +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. |
240 | +# |
241 | +#, fuzzy |
242 | +msgid "" |
243 | +msgstr "" |
244 | +"Project-Id-Version: example-content\n" |
245 | +"Report-Msgid-Bugs-To: \n" |
246 | +"POT-Creation-Date: 2009-03-11 11:36+0200\n" |
247 | +"PO-Revision-Date: 2009-03-11 11:39+0200\n" |
248 | +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" |
249 | +"Language-Team: LANGUAGE <LL@li.org>\n" |
250 | +"MIME-Version: 1.0\n" |
251 | +"Content-Type: text/plain; charset=UTF-8\n" |
252 | +"Content-Transfer-Encoding: 8bit\n" |
253 | + |
254 | +#: ../data/examples.desktop.in.h:1 |
255 | +msgid "Example content for Ubuntu" |
256 | +msgstr "Contenu d'exemple pour Ubuntu" |
257 | + |
258 | +#: ../data/examples.desktop.in.h:2 |
259 | +msgid "Examples" |
260 | +msgstr "Exemples" |
261 | |
262 | === added file 'setup.cfg' |
263 | --- setup.cfg 1970-01-01 00:00:00 +0000 |
264 | +++ setup.cfg 2009-03-12 18:09:45 +0000 |
265 | @@ -0,0 +1,11 @@ |
266 | +[build] |
267 | +i18n=True |
268 | + |
269 | +[build_i18n] |
270 | +domain=example-content |
271 | +# This is ugly, but needed so that it gets installed in the correct place |
272 | +desktop_files=[("../etc/skel/", ("data/examples.desktop.in",))] |
273 | + |
274 | +[install_egg_info] |
275 | +# just away from the packaging directory |
276 | +install_dir = build/temp |
277 | |
278 | === added file 'setup.py' |
279 | --- setup.py 1970-01-01 00:00:00 +0000 |
280 | +++ setup.py 2009-03-12 18:09:45 +0000 |
281 | @@ -0,0 +1,70 @@ |
282 | +#!/usr/bin/env python |
283 | + |
284 | +import os |
285 | +import re |
286 | +import posixpath |
287 | +from glob import glob |
288 | + |
289 | +from distutils.core import setup |
290 | +from setuptools import setup |
291 | + |
292 | +from distutils.command.install_data import install_data |
293 | +#from DistUtilsExtra.command.build_extra import build_extra |
294 | +from DistUtilsExtra.command.build_i18n import build_i18n |
295 | + |
296 | +def changelog_version(changelog="debian/changelog"): |
297 | + version = "dev" |
298 | + if posixpath.exists(changelog): |
299 | + head=open(changelog).readline() |
300 | + match = re.compile(".*\((.*)\).*").match(head) |
301 | + if match: |
302 | + version = match.group(1) |
303 | + |
304 | + return version |
305 | + |
306 | +class example_content_install_data(install_data, object): |
307 | + |
308 | + def finalize_options(self): |
309 | + """Add wildcard support for filenames.""" |
310 | + super(example_content_install_data, self).finalize_options() |
311 | + |
312 | + for f in self.data_files: |
313 | + if type(f) != str: |
314 | + files = f[1] |
315 | + i = 0 |
316 | + while i < len(files): |
317 | + if "*" in files[i]: |
318 | + for e in glob(files[i]): |
319 | + files.append(e) |
320 | + files.pop(i) |
321 | + i -= 1 |
322 | + i += 1 |
323 | + |
324 | + def run(self): |
325 | + """Run substitutions on files.""" |
326 | + super(example_content_install_data, self).run() |
327 | + # Causes Lintian warning |
328 | + ## os.chmod("etc/skel/examples.desktop", 755) |
329 | + return |
330 | + |
331 | +setup( |
332 | + name = "example-content", |
333 | + version = changelog_version(), |
334 | + author = "Timo Jyrinki", |
335 | + author_email = "timo.jyrinki@iki.fi", |
336 | + license = "GPL", |
337 | + description = "Example Content I18N", |
338 | + long_description = """ |
339 | +Python is only used for I18N of the .desktop entry. |
340 | +""", |
341 | + data_files = [ |
342 | + ("share/example-content/", ["main/*"]), |
343 | + ("share/example-content/logos/", ["logos/*"]), |
344 | + ("share/example-content/Ubuntu_Free_Culture_Showcase/", ["Ubuntu_Free_Culture_Showcase/*"]) |
345 | + ], |
346 | + cmdclass = { |
347 | + "install_data": example_content_install_data, |
348 | +# "build" : build_extra, |
349 | + "build_i18n" : build_i18n } |
350 | +) |
351 | + |
352 | |
353 | === added directory 'source' |
354 | === renamed file 'kubuntu-leaflet.svg' => 'source/kubuntu-leaflet.svg' |
The ~timo-jyrinki/ example- content/ folder_ i18n branch changes the Examples link into an examples.desktop file, which is of type Link and points to the folder. It uses gettext to get translations on-the-fly from langpacks, therefore fixing the bug #45489 for the case of after-installation for every Ubuntu user's home folder. The link on the Live-CD desktop probably comes from elsewhere.
At the same time, some of the content was moved around. The python usage here is a bit of an overkill, but it was the way I (thought I) knew how to make this work. The only hack needed was for installing the .desktop file under /etc while still using cdbs defaults otherwise.
It's lintian clean and tested with pbuilder, and seems to work fine. I'm attaching a screenshot to the bug report of a situation where the examples.desktop is installed in /etc/skel (without translations), .mo files are in locale directories, a new user has been created and it has been logged in for the first time.
I didn't use Icon=Folder, since it's actually after the ordinary folders and the icon in my opinion confused the user. So it's just the default link icon, which I'd prefer over also a folder icon with a link arrow on it since it looks wrong in the alphabetical order if it looks like a folder but is after other folders in the list.