Merge lp:~dholbach/help-app/1426304 into lp:~ubuntu-touch-coreapps-drivers/help-app/trunk

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 67
Proposed branch: lp:~dholbach/help-app/1426304
Merge into: lp:~ubuntu-touch-coreapps-drivers/help-app/trunk
Diff against target: 1083 lines (+391/-266)
10 files modified
edit-here/generate-pot (+1/-2)
edit-here/generate-translations (+0/-1)
edit-here/index.html (+4/-0)
edit-here/po/de.po (+39/-26)
edit-here/po/fr.po (+37/-25)
edit-here/po/help.pot (+5/-5)
edit-here/po/it.po (+37/-25)
edit-here/po/pt.po (+38/-27)
edit-here/po/ro.po (+37/-25)
edit-here/translations.py (+193/-130)
To merge this branch: bzr merge lp:~dholbach/help-app/1426304
Reviewer Review Type Date Requested Status
David Planella Approve
Daniel Holbach (community) Needs Fixing
Review via email: mp+251589@code.launchpad.net
To post a comment you must log in.
lp:~dholbach/help-app/1426304 updated
68. By Daniel Holbach

add require() function to simplify code a bit

69. By Daniel Holbach

update index.html with new languages

70. By Daniel Holbach

merge from trunk, resolve conflicts

71. By Daniel Holbach

update German translation, this will help as a test-case

72. By Daniel Holbach

omit untranslated 'Title:' line, as it would give us two 'Title:' lines

73. By Daniel Holbach

also bend links if the link title is translated

74. By Daniel Holbach

fix case where 'original_title in msgid' was not good enough, we need it exact

Revision history for this message
David Planella (dpm) wrote :

Looks good to me, just two inline comments.

review: Needs Information
lp:~dholbach/help-app/1426304 updated
75. By Daniel Holbach

add Portoguese

Revision history for this message
Daniel Holbach (dholbach) wrote :

Ok, we decided to go without saving 'title_lines' anywhere, but just agree that the Title line is always the first. I'll add a piece of code in the "Title" line replacer which checks the line number.

Working on this now.

review: Needs Fixing
lp:~dholbach/help-app/1426304 updated
76. By Daniel Holbach

instead of doing internal bookkeeping, assume that the first line is the title_line - also error out, if we find a title line that doesn't have linenumber 1

Revision history for this message
David Planella (dpm) wrote :

Looks good to me, good work! I've just added an inline comment as a suggestion, but for me it's already good to go.

review: Approve
lp:~dholbach/help-app/1426304 updated
77. By Daniel Holbach

remove leftover print statement

Revision history for this message
Daniel Holbach (dholbach) wrote :

Fixed.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'edit-here/generate-pot'
--- edit-here/generate-pot 2015-02-25 16:02:15 +0000
+++ edit-here/generate-pot 2015-03-05 08:14:16 +0000
@@ -10,8 +10,7 @@
1010
11def main():11def main():
12 translations = Translations()12 translations = Translations()
13 translations.generate_pot_file()13 if not translations.generate_pot_file():
14 if not translations.update_po_files():
15 sys.exit(1)14 sys.exit(1)
1615
17if __name__ == '__main__':16if __name__ == '__main__':
1817
=== modified file 'edit-here/generate-translations'
--- edit-here/generate-translations 2015-02-25 14:41:25 +0000
+++ edit-here/generate-translations 2015-03-05 08:14:16 +0000
@@ -9,7 +9,6 @@
99
10def main():10def main():
11 translations = Translations()11 translations = Translations()
12 translations.rewrite_links()
13 translations.generate_translations()12 translations.generate_translations()
1413
1514
1615
=== modified file 'edit-here/index.html'
--- edit-here/index.html 2015-02-26 14:25:16 +0000
+++ edit-here/index.html 2015-03-05 08:14:16 +0000
@@ -10,7 +10,11 @@
10 <body>10 <body>
11 <ul>11 <ul>
12 <li><a href="index.en-us.html">English</a></li>12 <li><a href="index.en-us.html">English</a></li>
13 <li><a href="index.fr.html">French</a></li>
13 <li><a href="index.de.html">German</a></li>14 <li><a href="index.de.html">German</a></li>
15 <li><a href="index.it.html">Italian</a></li>
16 <li><a href="index.pt.html">Portuguese</a></li>
17 <li><a href="index.ro.html">Romanian</a></li>
14 </ul>18 </ul>
15 </body>19 </body>
16</html>20</html>
1721
=== modified file 'edit-here/po/de.po'
--- edit-here/po/de.po 2015-02-28 06:41:48 +0000
+++ edit-here/po/de.po 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (C) YEAR Free Software Foundation, Inc.2# Copyright (C) YEAR Free Software Foundation, Inc.
3# This file is distributed under the same license as the PACKAGE package.3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#5#
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: PACKAGE VERSION\n"8"Project-Id-Version: PACKAGE VERSION\n"
@@ -11,17 +11,12 @@
11"PO-Revision-Date: 2015-02-27 03:52+0000\n"11"PO-Revision-Date: 2015-02-27 03:52+0000\n"
12"Last-Translator: Daniel Holbach <daniel.holbach@ubuntu.com>\n"12"Last-Translator: Daniel Holbach <daniel.holbach@ubuntu.com>\n"
13"Language-Team: LANGUAGE <LL@li.org>\n"13"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language: \n"
14"MIME-Version: 1.0\n"15"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"16"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"17"Content-Transfer-Encoding: 8bit\n"
18"X-Generator: Launchpad (build 17361)\n"
17"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"19"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"
18"X-Generator: Launchpad (build 17361)\n"
19"Language: \n"
20
21#. type: Plain text
22#: content/pages/faq.md:2
23msgid "Title: Get your questions answered."
24msgstr "Title: Antworten auf Deine Fragen."
2520
26#. type: Plain text21#. type: Plain text
27#: content/pages/faq.md:522#: content/pages/faq.md:5
@@ -43,11 +38,6 @@
43msgstr "..."38msgstr "..."
4439
45#. type: Plain text40#. type: Plain text
46#: content/pages/index.md:2
47msgid "Title: Welcome to Help for Ubuntu for devices!"
48msgstr "Title: Willkommen bei der Hilfe für Ubuntu-Geräte!"
49
50#. type: Plain text
51#: content/pages/index.md:541#: content/pages/index.md:5
52msgid ""42msgid ""
53"The world-wide Ubuntu community wants to give you the best possible "43"The world-wide Ubuntu community wants to give you the best possible "
@@ -70,7 +60,8 @@
70#: content/pages/index.md:960#: content/pages/index.md:9
71msgid "links to get in touch with experts and other community members"61msgid "links to get in touch with experts and other community members"
72msgstr ""62msgstr ""
73"Links, um mit anderen Community-Mitgliedern und Experten in Kontakt zu kommen"63"Links, um mit anderen Community-Mitgliedern und Experten in Kontakt zu "
64"kommen"
7465
75#. type: Plain text66#. type: Plain text
76#: content/pages/index.md:1167#: content/pages/index.md:11
@@ -81,17 +72,12 @@
81#: content/pages/index.md:1272#: content/pages/index.md:12
82#, no-wrap73#, no-wrap
83msgid "[Take me to the FAQ!]({filename}faq.md) \n"74msgid "[Take me to the FAQ!]({filename}faq.md) \n"
84msgstr "[Gib mir die Antworten!]({filename}faq.md) \n"75msgstr "[Gib mir die Antworten!]({filename}faq.de.md) \n"
8576
86#. type: Plain text77#. type: Plain text
87#: content/pages/index.md:1478#: content/pages/index.md:14
88msgid "[Get in touch]({filename}get-in-touch.md)"79msgid "[Get in touch]({filename}get-in-touch.md)"
89msgstr "[Kontakt]({filename}get-in-touch.md)"80msgstr "[Kontakt]({filename}get-in-touch.de.md)"
90
91#. type: Plain text
92#: content/pages/apps.md:2
93msgid "Title: FAQ - Apps"
94msgstr "Title: FAQ - Apps"
9581
96#. type: Plain text82#. type: Plain text
97#: content/pages/apps.md:583#: content/pages/apps.md:5
@@ -138,11 +124,6 @@
138"---\n"124"---\n"
139125
140#. type: Plain text126#. type: Plain text
141#: content/pages/get-in-touch.md:2
142msgid "Title: Get in touch"
143msgstr "Title: Kontakt"
144
145#. type: Plain text
146#: content/pages/get-in-touch.md:7127#: content/pages/get-in-touch.md:7
147#, no-wrap128#, no-wrap
148msgid ""129msgid ""
@@ -167,3 +148,35 @@
167"out about all the individual teams in Ubuntu, what they do, where they hang "148"out about all the individual teams in Ubuntu, what they do, where they hang "
168"out and how to get involved."149"out and how to get involved."
169msgstr ""150msgstr ""
151
152#. type: Plain text
153#: content/pages/faq.md:2
154msgid "Get your questions answered."
155msgstr "Antworten auf Deine Fragen."
156
157#. type: Plain text
158#: content/pages/index.md:2
159msgid "Welcome to Help for Ubuntu for devices!"
160msgstr "Willkommen zur Ubuntu Hilfe!"
161
162#. type: Plain text
163#: content/pages/apps.md:2
164msgid "FAQ - Apps"
165msgstr ""
166
167#. type: Plain text
168#: content/pages/get-in-touch.md:2
169msgid "Get in touch"
170msgstr "Kontakt"
171
172#~ msgid "Title: Get your questions answered."
173#~ msgstr "Title: Antworten auf Deine Fragen."
174
175#~ msgid "Title: Welcome to Help for Ubuntu for devices!"
176#~ msgstr "Title: Willkommen bei der Hilfe für Ubuntu-Geräte!"
177
178#~ msgid "Title: FAQ - Apps"
179#~ msgstr "Title: FAQ - Apps"
180
181#~ msgid "Title: Get in touch"
182#~ msgstr "Title: Kontakt"
170183
=== modified file 'edit-here/po/fr.po'
--- edit-here/po/fr.po 2015-02-28 06:41:48 +0000
+++ edit-here/po/fr.po 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 20152# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-devices-help package.3# This file is distributed under the same license as the ubuntu-devices-help package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#5#
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: ubuntu-devices-help\n"8"Project-Id-Version: ubuntu-devices-help\n"
@@ -14,13 +14,8 @@
14"MIME-Version: 1.0\n"14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"16"Content-Transfer-Encoding: 8bit\n"
17"X-Generator: Launchpad (build 17361)\n"
17"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"18"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"
18"X-Generator: Launchpad (build 17361)\n"
19
20#. type: Plain text
21#: content/pages/faq.md:2
22msgid "Title: Get your questions answered."
23msgstr ""
2419
25#. type: Plain text20#. type: Plain text
26#: content/pages/faq.md:521#: content/pages/faq.md:5
@@ -32,7 +27,7 @@
32#. type: Bullet: ' * '27#. type: Bullet: ' * '
33#: content/pages/faq.md:728#: content/pages/faq.md:7
34msgid "[Apps]({filename}apps.md)"29msgid "[Apps]({filename}apps.md)"
35msgstr ""30msgstr "[Apps]({filename}apps.fr.md)"
3631
37#. type: Bullet: ' * '32#. type: Bullet: ' * '
38#: content/pages/faq.md:733#: content/pages/faq.md:7
@@ -40,11 +35,6 @@
40msgstr ""35msgstr ""
4136
42#. type: Plain text37#. type: Plain text
43#: content/pages/index.md:2
44msgid "Title: Welcome to Help for Ubuntu for devices!"
45msgstr ""
46
47#. type: Plain text
48#: content/pages/index.md:538#: content/pages/index.md:5
49msgid ""39msgid ""
50"The world-wide Ubuntu community wants to give you the best possible "40"The world-wide Ubuntu community wants to give you the best possible "
@@ -75,17 +65,12 @@
75#: content/pages/index.md:1265#: content/pages/index.md:12
76#, no-wrap66#, no-wrap
77msgid "[Take me to the FAQ!]({filename}faq.md) \n"67msgid "[Take me to the FAQ!]({filename}faq.md) \n"
78msgstr ""68msgstr "[Take me to the FAQ!]({filename}faq.fr.md) \n"
7969
80#. type: Plain text70#. type: Plain text
81#: content/pages/index.md:1471#: content/pages/index.md:14
82msgid "[Get in touch]({filename}get-in-touch.md)"72msgid "[Get in touch]({filename}get-in-touch.md)"
83msgstr ""73msgstr "[Get in touch]({filename}get-in-touch.fr.md)"
84
85#. type: Plain text
86#: content/pages/apps.md:2
87msgid "Title: FAQ - Apps"
88msgstr ""
8974
90#. type: Plain text75#. type: Plain text
91#: content/pages/apps.md:576#: content/pages/apps.md:5
@@ -124,11 +109,6 @@
124msgstr ""109msgstr ""
125110
126#. type: Plain text111#. type: Plain text
127#: content/pages/get-in-touch.md:2
128msgid "Title: Get in touch"
129msgstr ""
130
131#. type: Plain text
132#: content/pages/get-in-touch.md:7112#: content/pages/get-in-touch.md:7
133#, no-wrap113#, no-wrap
134msgid ""114msgid ""
@@ -147,3 +127,35 @@
147"out about all the individual teams in Ubuntu, what they do, where they hang "127"out about all the individual teams in Ubuntu, what they do, where they hang "
148"out and how to get involved."128"out and how to get involved."
149msgstr ""129msgstr ""
130
131#. type: Plain text
132#: content/pages/faq.md:2
133msgid "Get your questions answered."
134msgstr ""
135
136#. type: Plain text
137#: content/pages/index.md:2
138msgid "Welcome to Help for Ubuntu for devices!"
139msgstr ""
140
141#. type: Plain text
142#: content/pages/apps.md:2
143msgid "FAQ - Apps"
144msgstr ""
145
146#. type: Plain text
147#: content/pages/get-in-touch.md:2
148msgid "Get in touch"
149msgstr ""
150
151#~ msgid "Title: Get your questions answered."
152#~ msgstr ""
153
154#~ msgid "Title: Welcome to Help for Ubuntu for devices!"
155#~ msgstr ""
156
157#~ msgid "Title: FAQ - Apps"
158#~ msgstr ""
159
160#~ msgid "Title: Get in touch"
161#~ msgstr ""
150162
=== modified file 'edit-here/po/help.pot'
--- edit-here/po/help.pot 2015-02-26 14:28:46 +0000
+++ edit-here/po/help.pot 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (C) YEAR Free Software Foundation, Inc.2# Copyright (C) YEAR Free Software Foundation, Inc.
3# This file is distributed under the same license as the PACKAGE package.3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#5#
6#, fuzzy6#, fuzzy
7msgid ""7msgid ""
8msgstr ""8msgstr ""
@@ -18,7 +18,7 @@
1818
19#. type: Plain text19#. type: Plain text
20#: content/pages/faq.md:220#: content/pages/faq.md:2
21msgid "Title: Get your questions answered."21msgid "Get your questions answered."
22msgstr ""22msgstr ""
2323
24#. type: Plain text24#. type: Plain text
@@ -40,7 +40,7 @@
4040
41#. type: Plain text41#. type: Plain text
42#: content/pages/index.md:242#: content/pages/index.md:2
43msgid "Title: Welcome to Help for Ubuntu for devices!"43msgid "Welcome to Help for Ubuntu for devices!"
44msgstr ""44msgstr ""
4545
46#. type: Plain text46#. type: Plain text
@@ -83,7 +83,7 @@
8383
84#. type: Plain text84#. type: Plain text
85#: content/pages/apps.md:285#: content/pages/apps.md:2
86msgid "Title: FAQ - Apps"86msgid "FAQ - Apps"
87msgstr ""87msgstr ""
8888
89#. type: Plain text89#. type: Plain text
@@ -124,7 +124,7 @@
124124
125#. type: Plain text125#. type: Plain text
126#: content/pages/get-in-touch.md:2126#: content/pages/get-in-touch.md:2
127msgid "Title: Get in touch"127msgid "Get in touch"
128msgstr ""128msgstr ""
129129
130#. type: Plain text130#. type: Plain text
131131
=== modified file 'edit-here/po/it.po'
--- edit-here/po/it.po 2015-03-02 06:02:11 +0000
+++ edit-here/po/it.po 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 20152# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-devices-help package.3# This file is distributed under the same license as the ubuntu-devices-help package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#5#
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: ubuntu-devices-help\n"8"Project-Id-Version: ubuntu-devices-help\n"
@@ -14,13 +14,8 @@
14"MIME-Version: 1.0\n"14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"16"Content-Transfer-Encoding: 8bit\n"
17"X-Generator: Launchpad (build 17361)\n"
17"X-Launchpad-Export-Date: 2015-03-02 06:02+0000\n"18"X-Launchpad-Export-Date: 2015-03-02 06:02+0000\n"
18"X-Generator: Launchpad (build 17361)\n"
19
20#. type: Plain text
21#: content/pages/faq.md:2
22msgid "Title: Get your questions answered."
23msgstr ""
2419
25#. type: Plain text20#. type: Plain text
26#: content/pages/faq.md:521#: content/pages/faq.md:5
@@ -32,7 +27,7 @@
32#. type: Bullet: ' * '27#. type: Bullet: ' * '
33#: content/pages/faq.md:728#: content/pages/faq.md:7
34msgid "[Apps]({filename}apps.md)"29msgid "[Apps]({filename}apps.md)"
35msgstr ""30msgstr "[Apps]({filename}apps.it.md)"
3631
37#. type: Bullet: ' * '32#. type: Bullet: ' * '
38#: content/pages/faq.md:733#: content/pages/faq.md:7
@@ -40,11 +35,6 @@
40msgstr ""35msgstr ""
4136
42#. type: Plain text37#. type: Plain text
43#: content/pages/index.md:2
44msgid "Title: Welcome to Help for Ubuntu for devices!"
45msgstr ""
46
47#. type: Plain text
48#: content/pages/index.md:538#: content/pages/index.md:5
49msgid ""39msgid ""
50"The world-wide Ubuntu community wants to give you the best possible "40"The world-wide Ubuntu community wants to give you the best possible "
@@ -75,17 +65,12 @@
75#: content/pages/index.md:1265#: content/pages/index.md:12
76#, no-wrap66#, no-wrap
77msgid "[Take me to the FAQ!]({filename}faq.md) \n"67msgid "[Take me to the FAQ!]({filename}faq.md) \n"
78msgstr ""68msgstr "[Take me to the FAQ!]({filename}faq.it.md) \n"
7969
80#. type: Plain text70#. type: Plain text
81#: content/pages/index.md:1471#: content/pages/index.md:14
82msgid "[Get in touch]({filename}get-in-touch.md)"72msgid "[Get in touch]({filename}get-in-touch.md)"
83msgstr ""73msgstr "[Get in touch]({filename}get-in-touch.it.md)"
84
85#. type: Plain text
86#: content/pages/apps.md:2
87msgid "Title: FAQ - Apps"
88msgstr ""
8974
90#. type: Plain text75#. type: Plain text
91#: content/pages/apps.md:576#: content/pages/apps.md:5
@@ -124,11 +109,6 @@
124msgstr ""109msgstr ""
125110
126#. type: Plain text111#. type: Plain text
127#: content/pages/get-in-touch.md:2
128msgid "Title: Get in touch"
129msgstr ""
130
131#. type: Plain text
132#: content/pages/get-in-touch.md:7112#: content/pages/get-in-touch.md:7
133#, no-wrap113#, no-wrap
134msgid ""114msgid ""
@@ -147,3 +127,35 @@
147"out about all the individual teams in Ubuntu, what they do, where they hang "127"out about all the individual teams in Ubuntu, what they do, where they hang "
148"out and how to get involved."128"out and how to get involved."
149msgstr ""129msgstr ""
130
131#. type: Plain text
132#: content/pages/faq.md:2
133msgid "Get your questions answered."
134msgstr ""
135
136#. type: Plain text
137#: content/pages/index.md:2
138msgid "Welcome to Help for Ubuntu for devices!"
139msgstr ""
140
141#. type: Plain text
142#: content/pages/apps.md:2
143msgid "FAQ - Apps"
144msgstr ""
145
146#. type: Plain text
147#: content/pages/get-in-touch.md:2
148msgid "Get in touch"
149msgstr ""
150
151#~ msgid "Title: Get your questions answered."
152#~ msgstr ""
153
154#~ msgid "Title: Welcome to Help for Ubuntu for devices!"
155#~ msgstr ""
156
157#~ msgid "Title: FAQ - Apps"
158#~ msgstr ""
159
160#~ msgid "Title: Get in touch"
161#~ msgstr ""
150162
=== modified file 'edit-here/po/pt.po'
--- edit-here/po/pt.po 2015-03-02 16:56:02 +0000
+++ edit-here/po/pt.po 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 20152# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-devices-help package.3# This file is distributed under the same license as the ubuntu-devices-help package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#5#
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: ubuntu-devices-help\n"8"Project-Id-Version: ubuntu-devices-help\n"
@@ -14,13 +14,8 @@
14"MIME-Version: 1.0\n"14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"16"Content-Transfer-Encoding: 8bit\n"
17"X-Generator: Launchpad (build 17361)\n"
17"X-Launchpad-Export-Date: 2015-03-01 05:48+0000\n"18"X-Launchpad-Export-Date: 2015-03-01 05:48+0000\n"
18"X-Generator: Launchpad (build 17361)\n"
19
20#. type: Plain text
21#: content/pages/faq.md:2
22msgid "Title: Get your questions answered."
23msgstr "Title: Ter resposta para as suas questões."
2419
25#. type: Plain text20#. type: Plain text
26#: content/pages/faq.md:521#: content/pages/faq.md:5
@@ -34,7 +29,7 @@
34#. type: Bullet: ' * '29#. type: Bullet: ' * '
35#: content/pages/faq.md:730#: content/pages/faq.md:7
36msgid "[Apps]({filename}apps.md)"31msgid "[Apps]({filename}apps.md)"
37msgstr "[Apps]({filename}apps.md)"32msgstr "[Apps]({filename}apps.pt.md)"
3833
39#. type: Bullet: ' * '34#. type: Bullet: ' * '
40#: content/pages/faq.md:735#: content/pages/faq.md:7
@@ -42,11 +37,6 @@
42msgstr "..."37msgstr "..."
4338
44#. type: Plain text39#. type: Plain text
45#: content/pages/index.md:2
46msgid "Title: Welcome to Help for Ubuntu for devices!"
47msgstr "Title: Bem-vindo à Ajuda de Ubuntu para dispositivos!"
48
49#. type: Plain text
50#: content/pages/index.md:540#: content/pages/index.md:5
51msgid ""41msgid ""
52"The world-wide Ubuntu community wants to give you the best possible "42"The world-wide Ubuntu community wants to give you the best possible "
@@ -80,17 +70,12 @@
80#: content/pages/index.md:1270#: content/pages/index.md:12
81#, no-wrap71#, no-wrap
82msgid "[Take me to the FAQ!]({filename}faq.md) \n"72msgid "[Take me to the FAQ!]({filename}faq.md) \n"
83msgstr "[Ir para perguntas mais frequentes!]({filename}faq.md) \n"73msgstr "[Ir para perguntas mais frequentes!]({filename}faq.pt.md) \n"
8474
85#. type: Plain text75#. type: Plain text
86#: content/pages/index.md:1476#: content/pages/index.md:14
87msgid "[Get in touch]({filename}get-in-touch.md)"77msgid "[Get in touch]({filename}get-in-touch.md)"
88msgstr "[Entrar em contacto]({filename}get-in-touch.md)"78msgstr "[Entrar em contacto]({filename}get-in-touch.pt.md)"
89
90#. type: Plain text
91#: content/pages/apps.md:2
92msgid "Title: FAQ - Apps"
93msgstr "Title: Perguntas mais frequentes - Aplicações"
9479
95#. type: Plain text80#. type: Plain text
96#: content/pages/apps.md:581#: content/pages/apps.md:5
@@ -136,11 +121,6 @@
136"---\n"121"---\n"
137122
138#. type: Plain text123#. type: Plain text
139#: content/pages/get-in-touch.md:2
140msgid "Title: Get in touch"
141msgstr "Title: Entre em contacto"
142
143#. type: Plain text
144#: content/pages/get-in-touch.md:7124#: content/pages/get-in-touch.md:7
145#, no-wrap125#, no-wrap
146msgid ""126msgid ""
@@ -150,8 +130,7 @@
150"collaboratively-edited question and answer site for Ubuntu users and \n"130"collaboratively-edited question and answer site for Ubuntu users and \n"
151"developers. 100% free, no registration required. \n"131"developers. 100% free, no registration required. \n"
152msgstr ""132msgstr ""
153"O Ubuntu tem uma grande comunidade . Pode facilmente entrar em contacto com "133"O Ubuntu tem uma grande comunidade . Pode facilmente entrar em contacto com peritos e\n"
154"peritos e\n"
155"outros entusiastas. Um bom modo de o fazer, particularmente se**tiver \n"134"outros entusiastas. Um bom modo de o fazer, particularmente se**tiver \n"
156"questões**, é através [AskUbuntu](http://www.askubuntu.com). É uma \n"135"questões**, é através [AskUbuntu](http://www.askubuntu.com). É uma \n"
157" página de perguntas e respostas colaborativa para utilizadores Ubuntu e \n"136" página de perguntas e respostas colaborativa para utilizadores Ubuntu e \n"
@@ -169,3 +148,35 @@
169"Community Website](http://community.ubuntu.com/). Pode facilmente encontrar "148"Community Website](http://community.ubuntu.com/). Pode facilmente encontrar "
170"tudo sobre as equipas individuais no Ubuntu, o que fazem, onde se encontram "149"tudo sobre as equipas individuais no Ubuntu, o que fazem, onde se encontram "
171"e sobre como se envolver."150"e sobre como se envolver."
151
152#. type: Plain text
153#: content/pages/faq.md:2
154msgid "Get your questions answered."
155msgstr ""
156
157#. type: Plain text
158#: content/pages/index.md:2
159msgid "Welcome to Help for Ubuntu for devices!"
160msgstr ""
161
162#. type: Plain text
163#: content/pages/apps.md:2
164msgid "FAQ - Apps"
165msgstr ""
166
167#. type: Plain text
168#: content/pages/get-in-touch.md:2
169msgid "Get in touch"
170msgstr ""
171
172#~ msgid "Title: Get your questions answered."
173#~ msgstr "Título: Ter resposta para as suas questões."
174
175#~ msgid "Title: Welcome to Help for Ubuntu for devices!"
176#~ msgstr "Título: Bem-vindo à Ajuda de Ubuntu para dispositivos!"
177
178#~ msgid "Title: FAQ - Apps"
179#~ msgstr "Título: Perguntas mais frequentes - Aplicações"
180
181#~ msgid "Title: Get in touch"
182#~ msgstr "Título: Entre em contacto"
172183
=== modified file 'edit-here/po/ro.po'
--- edit-here/po/ro.po 2015-02-28 06:41:48 +0000
+++ edit-here/po/ro.po 2015-03-05 08:14:16 +0000
@@ -2,7 +2,7 @@
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 20152# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-devices-help package.3# This file is distributed under the same license as the ubuntu-devices-help package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#5#
6msgid ""6msgid ""
7msgstr ""7msgstr ""
8"Project-Id-Version: ubuntu-devices-help\n"8"Project-Id-Version: ubuntu-devices-help\n"
@@ -14,13 +14,8 @@
14"MIME-Version: 1.0\n"14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"16"Content-Transfer-Encoding: 8bit\n"
17"X-Generator: Launchpad (build 17361)\n"
17"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"18"X-Launchpad-Export-Date: 2015-02-28 06:41+0000\n"
18"X-Generator: Launchpad (build 17361)\n"
19
20#. type: Plain text
21#: content/pages/faq.md:2
22msgid "Title: Get your questions answered."
23msgstr ""
2419
25#. type: Plain text20#. type: Plain text
26#: content/pages/faq.md:521#: content/pages/faq.md:5
@@ -32,7 +27,7 @@
32#. type: Bullet: ' * '27#. type: Bullet: ' * '
33#: content/pages/faq.md:728#: content/pages/faq.md:7
34msgid "[Apps]({filename}apps.md)"29msgid "[Apps]({filename}apps.md)"
35msgstr ""30msgstr "[Apps]({filename}apps.ro.md)"
3631
37#. type: Bullet: ' * '32#. type: Bullet: ' * '
38#: content/pages/faq.md:733#: content/pages/faq.md:7
@@ -40,11 +35,6 @@
40msgstr ""35msgstr ""
4136
42#. type: Plain text37#. type: Plain text
43#: content/pages/index.md:2
44msgid "Title: Welcome to Help for Ubuntu for devices!"
45msgstr ""
46
47#. type: Plain text
48#: content/pages/index.md:538#: content/pages/index.md:5
49msgid ""39msgid ""
50"The world-wide Ubuntu community wants to give you the best possible "40"The world-wide Ubuntu community wants to give you the best possible "
@@ -75,17 +65,12 @@
75#: content/pages/index.md:1265#: content/pages/index.md:12
76#, no-wrap66#, no-wrap
77msgid "[Take me to the FAQ!]({filename}faq.md) \n"67msgid "[Take me to the FAQ!]({filename}faq.md) \n"
78msgstr ""68msgstr "[Take me to the FAQ!]({filename}faq.ro.md) \n"
7969
80#. type: Plain text70#. type: Plain text
81#: content/pages/index.md:1471#: content/pages/index.md:14
82msgid "[Get in touch]({filename}get-in-touch.md)"72msgid "[Get in touch]({filename}get-in-touch.md)"
83msgstr ""73msgstr "[Get in touch]({filename}get-in-touch.ro.md)"
84
85#. type: Plain text
86#: content/pages/apps.md:2
87msgid "Title: FAQ - Apps"
88msgstr ""
8974
90#. type: Plain text75#. type: Plain text
91#: content/pages/apps.md:576#: content/pages/apps.md:5
@@ -124,11 +109,6 @@
124msgstr ""109msgstr ""
125110
126#. type: Plain text111#. type: Plain text
127#: content/pages/get-in-touch.md:2
128msgid "Title: Get in touch"
129msgstr ""
130
131#. type: Plain text
132#: content/pages/get-in-touch.md:7112#: content/pages/get-in-touch.md:7
133#, no-wrap113#, no-wrap
134msgid ""114msgid ""
@@ -147,3 +127,35 @@
147"out about all the individual teams in Ubuntu, what they do, where they hang "127"out about all the individual teams in Ubuntu, what they do, where they hang "
148"out and how to get involved."128"out and how to get involved."
149msgstr ""129msgstr ""
130
131#. type: Plain text
132#: content/pages/faq.md:2
133msgid "Get your questions answered."
134msgstr ""
135
136#. type: Plain text
137#: content/pages/index.md:2
138msgid "Welcome to Help for Ubuntu for devices!"
139msgstr ""
140
141#. type: Plain text
142#: content/pages/apps.md:2
143msgid "FAQ - Apps"
144msgstr ""
145
146#. type: Plain text
147#: content/pages/get-in-touch.md:2
148msgid "Get in touch"
149msgstr ""
150
151#~ msgid "Title: Get your questions answered."
152#~ msgstr ""
153
154#~ msgid "Title: Welcome to Help for Ubuntu for devices!"
155#~ msgstr ""
156
157#~ msgid "Title: FAQ - Apps"
158#~ msgstr ""
159
160#~ msgid "Title: Get in touch"
161#~ msgstr ""
150162
=== modified file 'edit-here/translations.py'
--- edit-here/translations.py 2015-02-26 15:56:31 +0000
+++ edit-here/translations.py 2015-03-05 08:14:16 +0000
@@ -7,12 +7,16 @@
7import subprocess7import subprocess
8import sys8import sys
99
10
11def require(package):
12 print('Missing prerequisites. Please run: '
13 '"sudo apt install %s"' % package)
14 sys.exit(1)
15
10try:16try:
11 import polib17 import polib
12except ImportError:18except ImportError:
13 print('Missing prerequisites. Please run: '19 require('python3-polib')
14 '"sudo apt install python3-polib"')
15 sys.exit(1)
1620
17from pelicanconf import PATH21from pelicanconf import PATH
1822
@@ -26,17 +30,22 @@
26)30)
2731
2832
33def find_bcp47_code(gettext_code):
34 if gettext_code not in [c[0] for c in BCP47_OVERRIDES]:
35 return gettext_code.lower().replace('_', '-')
36 return [c[1] for c in BCP47_OVERRIDES
37 if c[0] == gettext_code][0]
38
39
29class PO4A(object):40class PO4A(object):
30 def __init__(self, pot_file):41 def __init__(self):
31 self.default_args = [42 self.default_args = [
32 '-f', 'text',43 '-f', 'text',
33 '-o', 'markdown',44 '-o', 'markdown',
34 '-M', 'utf-8',45 '-M', 'utf-8',
35 ]46 ]
36 self.pot_file = pot_file
37 if not shutil.which('po4a'):47 if not shutil.which('po4a'):
38 print('Missing prerequisites. Please run: "sudo apt install po4a"')48 require('po4a')
39 sys.exit(1)
4049
41 def run(self, po4a_command, additional_args, with_output=False):50 def run(self, po4a_command, additional_args, with_output=False):
42 args = copy.copy(self.default_args)51 args = copy.copy(self.default_args)
@@ -47,163 +56,217 @@
47 ret = subprocess.call([po4a_command]+args)56 ret = subprocess.call([po4a_command]+args)
48 return ret57 return ret
4958
50 def gettextize(self, documents):59 def gettextize(self, document_fns, pot_file):
51 args = []60 args = []
52 for document in documents:61 for document_fn in document_fns:
53 args += ['-m', document]62 args += ['-m', document_fn]
54 args += [63 args += [
55 '-p', self.pot_file,64 '-p', pot_file,
56 '-L', 'utf-8',65 '-L', 'utf-8',
57 ]66 ]
58 return self.run('po4a-gettextize', args)67 ret = self.run('po4a-gettextize', args)
5968 return (not ret)
60 def updatepo(self, langs, documents):69
61 for lang in langs:70 def translate(self, doc, po_fn):
62 args = []
63 for document in documents:
64 args += ['-m', document]
65 args += ['-p', lang.file_name]
66 ret = self.run('po4a-updatepo', args)
67 if ret:
68 return False
69 return True
70
71 def translate(self, doc, lang):
72 args = [71 args = [
73 '-k', TRANSLATION_COMPLETION_PERCENTAGE,72 '-k', TRANSLATION_COMPLETION_PERCENTAGE,
74 '-m', doc,73 '-m', doc,
75 '-p', lang.file_name,74 '-p', po_fn,
76 '-L', 'utf-8',75 '-L', 'utf-8',
77 ]76 ]
78 return self.run('po4a-translate', args, with_output=True)77 return self.run('po4a-translate', args, with_output=True)
7978
8079
80class POFile(object):
81 def __init__(self, po_fn):
82 self.po_fn = po_fn
83 self.pofile = polib.pofile(po_fn)
84
85 def merge(self, pot_file_ob):
86 self.pofile.merge(pot_file_ob)
87
88 def save(self):
89 self.pofile.save(self.po_fn)
90
91 def find_in_msgid(self, find_str, translated=True, fuzzy=True,
92 untranslated=True):
93 entries = []
94 if translated:
95 entries += self.pofile.translated_entries()
96 if fuzzy:
97 entries += self.pofile.fuzzy_entries()
98 if untranslated:
99 entries += self.pofile.untranslated_entries()
100 results = []
101 for entry in entries:
102 if find_str in entry.msgid:
103 results += [entry]
104 return results
105
106 def replace_title_lines(self):
107 results = {}
108 for entry in self.find_in_msgid('Title: '):
109 if entry.msgid.startswith('Title: '):
110 if entry.linenum != 1:
111 print('Title line "%s" found, but at linenum "%s", '
112 'not 1.' % (entry.msgid, entry.linenum))
113 return False
114 entry.msgid = entry.msgid.replace('Title: ', '')
115 fn = entry.occurrences[0][0]
116 results[fn] = entry.msgid
117 if self.po_fn.endswith('.po'):
118 entry.msgstr = ''
119 self.save()
120 return True
121
122 def rewrite_links(self, documents, bcp47):
123 link_regex = r'\[.+?\]\(\{filename\}(.+?)\)'
124 for entry in self.find_in_msgid('{filename}'):
125 link_msgid = re.findall(link_regex, entry.msgid)[0]
126 link_msgstr = list(re.findall(link_regex, entry.msgstr))
127 translated_doc_fn = os.path.basename(
128 documents.translated_doc_fn(link_msgid, bcp47))
129 if not link_msgstr:
130 entry.msgstr = entry.msgid
131 link_msgstr = [link_msgid]
132 entry.msgstr = entry.msgstr.replace(link_msgstr[0],
133 translated_doc_fn)
134 self.save()
135
136 def find_translated_title_line(self, original_title):
137 for entry in self.find_in_msgid(original_title):
138 if entry.msgid == original_title:
139 if entry.msgstr:
140 return entry.msgstr
141 return entry.msgid
142
143
144class PO(object):
145 def __init__(self, po4a):
146 self.translations_dir = os.path.abspath(os.path.join(PATH, '../po'))
147 self.fake_lang_code = 'en_US'
148 self.fake_po_fn = os.path.join(self.translations_dir,
149 '%s.po' % self.fake_lang_code)
150 self.pot_fn = os.path.join(self.translations_dir, 'help.pot')
151 self.pot_file_ob = POFile(self.pot_fn)
152 self.po4a = po4a
153 self.langs = {}
154 for po_fn in glob.glob(self.translations_dir+'/*.po'):
155 self.add_language(po_fn)
156
157 def add_language(self, po_fn):
158 gettext_code = os.path.basename(po_fn).split('.po')[0]
159 self.langs[po_fn] = {
160 'bcp47': find_bcp47_code(gettext_code),
161 'gettext_code': gettext_code,
162 'pofile': None,
163 }
164
165 def _remove_fake_po_file(self):
166 if os.path.exists(self.fake_po_fn):
167 os.remove(self.fake_po_fn)
168
169 def __del__(self):
170 self._remove_fake_po_file()
171
172 def load_pofile(self, po_fn):
173 if not self.langs[po_fn]['pofile']:
174 self.langs[po_fn]['pofile'] = POFile(po_fn)
175
176 def generate_pot_file(self, documents):
177 if not self.po4a.gettextize(documents.docs, self.pot_fn):
178 return False
179 if not self.pot_file_ob.replace_title_lines():
180 return False
181 for po_fn in self.langs:
182 self.load_pofile(po_fn)
183 self.langs[po_fn]['pofile'].merge(self.pot_file_ob.pofile)
184 if not self.langs[po_fn]['pofile'].replace_title_lines():
185 return False
186 return True
187
188 # we generate a fake translation for en-US which is going to be
189 # the default
190 def generate_fake_pofile(self):
191 self._remove_fake_po_file()
192 shutil.copy(self.pot_fn, self.fake_po_fn)
193 self.add_language(self.fake_po_fn)
194
195 def find_translated_title_line(self, original_title, po_fn):
196 return self.langs[po_fn]['pofile'].find_translated_title_line(
197 original_title)
198
199 def rewrite_links(self, documents):
200 for po_fn in self.langs:
201 self.load_pofile(po_fn)
202 self.langs[po_fn]['pofile'].rewrite_links(
203 documents, self.langs[po_fn]['bcp47'])
204
205
81class Documents(object):206class Documents(object):
82 def __init__(self):207 def __init__(self):
83 self.docs = []208 self.docs = []
84 for dirpath, dirnames, filenames in os.walk(PATH):209 for dirpath, dirnames, fns in os.walk(PATH):
85 for filename in filenames:210 for fn in fns:
86 self.docs += [os.path.join(dirpath, filename)]211 fn = os.path.relpath(os.path.join(dirpath, fn),
212 os.path.join(PATH, '..'))
213 self.docs += [fn]
87214
88 def translated_doc(self, file_name, lang):215 def translated_doc_fn(self, fn, bcp47_code):
89 match = [doc for doc in self.docs216 match = [doc for doc in self.docs
90 if os.path.basename(doc) == os.path.basename(file_name)]217 if os.path.basename(doc) == os.path.basename(fn)]
91 if not match:218 if not match:
92 return None219 return None
93 return '%s.%s.md' % (match[0].split('.md')[0],220 return '%s.%s.md' % (match[0].split('.md')[0],
94 lang.bcp47_code)221 bcp47_code)
95222
96 def _call_po4a_translate(self, doc, lang, po4a):223 def _call_po4a_translate(self, doc, po_fn, po4a):
97 res = po4a.translate(doc, lang)224 res = po4a.translate(doc, po_fn)
98 output = codecs.decode(res.communicate()[0])225 return codecs.decode(res.communicate()[0])
99 broken_title_line = [line for line in output.split('\n')226
100 if line.lower().startswith('title:')][0]227 def write_translated_markdown(self, po, po4a):
101 rest = [line for line in output.split('\n')228 for po_fn in po.langs:
102 if not line.lower().startswith('title')]229 for doc_fn in self.docs:
103 output = '\n'.join(rest)230 output = self._call_po4a_translate(doc_fn, po_fn, po4a)
104 return (broken_title_line, output)231 title_line = output.split('\n')[0].split('Title: ')[1]
105232 translated_title_line = po.find_translated_title_line(
106 def write_translated_markdown(self, lang, po4a):233 title_line, po_fn)
107 for doc in self.docs:234 output = '\n'.join([line for line in output.split('\n')][1:])
108 (broken_title_line, output) = \235 new_path = self.translated_doc_fn(doc_fn,
109 self._call_po4a_translate(doc, lang, po4a)236 po.langs[po_fn]['bcp47'])
110 new_path = self.translated_doc(doc, lang)237 text = "Title: %s\nDate:\n\n" % (translated_title_line)
111 text = "%s\nDate:\n\n" % (broken_title_line)238 text += output
112 text += output239 if os.path.exists(new_path):
113 if os.path.exists(new_path):240 os.remove(new_path)
114 os.remove(new_path)241 if not os.path.exists(os.path.dirname(new_path)):
115 if not os.path.exists(os.path.dirname(new_path)):242 os.makedirs(os.path.dirname(new_path))
116 os.makedirs(os.path.dirname(new_path))243 with open(new_path, 'w', encoding='utf-8') as f:
117 with open(new_path, 'w', encoding='utf-8') as f:244 f.write(text)
118 f.write(text)
119
120
121class Language(object):
122 def __init__(self, po_file, documents):
123 self.file_name = po_file
124 self.gettext_code = os.path.basename(po_file).split('.po')[0]
125 self.bcp47_code = self._find_bcp47_code()
126 self.documents = documents
127
128 def _find_bcp47_code(self):
129 if self.gettext_code not in [c[0] for c in BCP47_OVERRIDES]:
130 return self.gettext_code.lower().replace('_', '-')
131 return [c[1] for c in BCP47_OVERRIDES
132 if c[0] == self.gettext_code][0]
133
134 def rewrite_links(self):
135 po_file = polib.pofile(self.file_name)
136 link_regex = r'\[.+?\]\(\{filename\}(.+?)\)'
137 for entry_group in [po_file.translated_entries(),
138 po_file.fuzzy_entries(),
139 po_file.untranslated_entries()]:
140 for entry in entry_group:
141 if '{filename}' in entry.msgid:
142 link_msgid = re.findall(link_regex, entry.msgid)[0]
143 link_msgstr = list(re.findall(link_regex, entry.msgstr))
144 translated_doc = os.path.basename(
145 self.documents.translated_doc(
146 link_msgid, self))
147 if not link_msgstr:
148 entry.msgstr = entry.msgid
149 link_msgstr = [link_msgid]
150 entry.msgstr = entry.msgstr.replace(link_msgstr[0],
151 translated_doc)
152 po_file.save(self.file_name)
153245
154246
155class Translations(object):247class Translations(object):
156 def __init__(self):248 def __init__(self):
157 self._cleanup()249 self._cleanup()
158 self.translations_dir = os.path.abspath(os.path.join(PATH, '../po'))
159 self.available_languages = []
160 self.documents = Documents()250 self.documents = Documents()
161 for po_filename in glob.glob(self.translations_dir+'/*.po'):251 self.po4a = PO4A()
162 self.available_languages += [Language(po_filename, self.documents)]252 self.po = PO(self.po4a)
163 self.fake_lang_code = 'en_US'
164 self.fake_po_file = os.path.join(self.translations_dir,
165 '%s.po' % self.fake_lang_code)
166 self.pot_file = os.path.join(self.translations_dir,
167 "help.pot")
168 self.po4a = PO4A(self.pot_file)
169
170 def __del__(self):
171 if os.path.exists(self.fake_po_file):
172 os.remove(self.fake_po_file)
173253
174 def _cleanup(self):254 def _cleanup(self):
175 r = subprocess.Popen(['bzr', 'ignored'], stdout=subprocess.PIPE)255 r = subprocess.Popen(['bzr', 'ignored'], stdout=subprocess.PIPE)
176 files = [os.path.join(PATH, '../..', f.split(' ')[0])256 fns = [os.path.join(PATH, '../..', f.split(' ')[0])
177 for f in codecs.decode(r.communicate()[0]).split('\n')257 for f in codecs.decode(r.communicate()[0]).split('\n')
178 if f.strip() != '']258 if f.strip() != '']
179 files = [f for f in files if os.path.exists(f)]259 fns = [f for f in fns if os.path.exists(f)]
180 for f in files:260 for f in fns:
181 try:261 try:
182 shutil.rmtree(f)262 shutil.rmtree(f)
183 except NotADirectoryError:263 except NotADirectoryError:
184 os.remove(f)264 os.remove(f)
185265
186 def generate_pot_file(self):266 def generate_pot_file(self):
187 return self.po4a.gettextize(self.documents.docs)267 return self.po.generate_pot_file(self.documents)
188
189 def update_po_files(self):
190 return self.po4a.updatepo(self.available_languages,
191 self.documents.docs)
192
193 def rewrite_links(self):
194 self._generate_fake_pofile()
195 for lang in self.available_languages:
196 lang.rewrite_links()
197
198 # we generate a fake translation for en-US which is going to be
199 # the default
200 def _generate_fake_pofile(self):
201 if os.path.exists(self.fake_po_file):
202 os.remove(self.fake_po_file)
203 shutil.copy(self.pot_file, self.fake_po_file)
204 self.available_languages += [Language(self.fake_po_file,
205 self.documents)]
206268
207 def generate_translations(self):269 def generate_translations(self):
208 for lang in self.available_languages:270 self.po.generate_fake_pofile()
209 self.documents.write_translated_markdown(lang, self.po4a)271 self.po.rewrite_links(self.documents)
272 self.documents.write_translated_markdown(self.po, self.po4a)

Subscribers

People subscribed via source and target branches