Merge lp:~alexwolf/stellarium/MeteorShowers-translations-patches into lp:~cardinot/stellarium/MeteorShowers

Proposed by Alexander Wolf
Status: Merged
Merged at revision: 6423
Proposed branch: lp:~alexwolf/stellarium/MeteorShowers-translations-patches
Merge into: lp:~cardinot/stellarium/MeteorShowers
Diff against target: 309 lines (+136/-91)
6 files modified
plugins/MeteorShowers/src/CMakeLists.txt (+0/-1)
plugins/MeteorShowers/src/MeteorShowers.cpp (+124/-9)
plugins/MeteorShowers/src/MeteorShowers.hpp (+6/-0)
plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp (+2/-2)
plugins/MeteorShowers/src/translations.h (+0/-79)
po/stellarium/POTFILES.in (+4/-0)
To merge this branch: bzr merge lp:~alexwolf/stellarium/MeteorShowers-translations-patches
Reviewer Review Type Date Requested Status
Marcos Cardinot Approve
Review via email: mp+199917@code.launchpad.net

Description of the change

Few patches for improvement search tool and translations

To post a comment you must log in.
Revision history for this message
Marcos Cardinot (cardinot) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/MeteorShowers/src/CMakeLists.txt'
2--- plugins/MeteorShowers/src/CMakeLists.txt 2013-12-05 23:32:18 +0000
3+++ plugins/MeteorShowers/src/CMakeLists.txt 2013-12-22 09:51:09 +0000
4@@ -16,7 +16,6 @@
5 MeteorStream.cpp
6 gui/MeteorShowerDialog.hpp
7 gui/MeteorShowerDialog.cpp
8- translations.h
9 )
10
11 SET(MeteorShowersDialog_UIS
12
13=== modified file 'plugins/MeteorShowers/src/MeteorShowers.cpp'
14--- plugins/MeteorShowers/src/MeteorShowers.cpp 2013-12-16 16:46:13 +0000
15+++ plugins/MeteorShowers/src/MeteorShowers.cpp 2013-12-22 09:51:09 +0000
16@@ -569,10 +569,9 @@
17 if(!flagShowMS)
18 return NULL;
19
20- QString objw = englishName.toUpper();
21 foreach(const MeteorShowerP& ms, mShowers)
22 {
23- if(ms->getEnglishName().toUpper() == englishName)
24+ if(ms->getEnglishName().toUpper() == englishName.toUpper())
25 return qSharedPointerCast<StelObject>(ms);
26 }
27
28@@ -586,7 +585,7 @@
29
30 foreach(const MeteorShowerP& ms, mShowers)
31 {
32- if(ms->getNameI18n().toUpper() == nameI18n)
33+ if(ms->getNameI18n().toUpper() == nameI18n.toUpper())
34 return qSharedPointerCast<StelObject>(ms);
35 }
36
37@@ -602,18 +601,33 @@
38 if(maxNbItem==0)
39 return result;
40
41- QString objw = objPrefix.toUpper();
42+ QString sn;
43+ bool find;
44
45 foreach(const MeteorShowerP& ms, mShowers)
46 {
47- if(ms->getNameI18n().toUpper().left(objw.length()) == objw)
48- {
49- result << ms->getNameI18n().toUpper();
50- }
51+ sn = ms->getNameI18n();
52+ find = false;
53+ if (useStartOfWords)
54+ {
55+ if (sn.toUpper().left(objPrefix.length()) == objPrefix.toUpper())
56+ find = true;
57+ }
58+ else
59+ {
60+ if (sn.contains(objPrefix, Qt::CaseInsensitive))
61+ find = true;
62+ }
63+ if (find)
64+ result << sn;
65+
66+
67 }
68
69 result.sort();
70- if(result.size()>maxNbItem) result.erase(result.begin()+maxNbItem, result.end());
71+
72+ if(result.size()>maxNbItem)
73+ result.erase(result.begin()+maxNbItem, result.end());
74
75 return result;
76 }
77@@ -992,3 +1006,104 @@
78 GETSTELMODULE(LabelMgr)->deleteLabel(i);
79 }
80 }
81+
82+void MeteorShowers::translations()
83+{
84+#if 0
85+ // Meteor showers
86+ // TRANSLATORS: Name of meteor shower
87+ N_("Quadrantids");
88+ // TRANSLATORS: Name of meteor shower
89+ N_("Lyrids");
90+ // TRANSLATORS: Name of meteor shower
91+ N_("α-Centaurids");
92+ // TRANSLATORS: Name of meteor shower
93+ N_("γ-Normids");
94+ // TRANSLATORS: Name of meteor shower
95+ N_("η-Aquariids");
96+ // TRANSLATORS: Name of meteor shower
97+ N_("June Bootids");
98+ // TRANSLATORS: Name of meteor shower
99+ N_("Piscis Austrinids");
100+ // TRANSLATORS: Name of meteor shower
101+ N_("Southern δ-Aquariids");
102+ // TRANSLATORS: Name of meteor shower
103+ N_("α-Capricornids");
104+ // TRANSLATORS: Name of meteor shower
105+ N_("α-Aurigids");
106+ // TRANSLATORS: Name of meteor shower
107+ N_("September ε-Perseids");
108+ // TRANSLATORS: Name of meteor shower
109+ N_("Draconids");
110+ // TRANSLATORS: Name of meteor shower
111+ N_("Leonids");
112+ // TRANSLATORS: Name of meteor shower
113+ N_("Phoenicids");
114+ // TRANSLATORS: Name of meteor shower
115+ N_("Puppid-Velids");
116+ // TRANSLATORS: Name of meteor shower
117+ N_("Ursids");
118+ // TRANSLATORS: Name of meteor shower
119+ N_("Perseids");
120+ // TRANSLATORS: Name of meteor shower
121+ N_("δ-Leonids");
122+ // TRANSLATORS: Name of meteor shower
123+ N_("π-Puppids");
124+ // TRANSLATORS: Name of meteor shower
125+ N_("June Lyrids");
126+ // TRANSLATORS: Name of meteor shower
127+ N_("κ-Cygnids");
128+ // TRANSLATORS: Name of meteor shower
129+ N_("ε-Lyrids");
130+ // TRANSLATORS: Name of meteor shower
131+ N_("δ-Aurigids");
132+ // TRANSLATORS: Name of meteor shower
133+ N_("ε-Geminids");
134+ // TRANSLATORS: Name of meteor shower
135+ N_("Southern Taurids");
136+ // TRANSLATORS: Name of meteor shower
137+ N_("Northern Taurids");
138+ // TRANSLATORS: Name of meteor shower
139+ N_("Monocerotids");
140+ // TRANSLATORS: Name of meteor shower
141+ N_("σ-Hydrids");
142+ // TRANSLATORS: Name of meteor shower
143+ N_("Geminids");
144+ // TRANSLATORS: Name of meteor shower
145+ N_("Leonis Minorids");
146+ // TRANSLATORS: Name of meteor shower
147+ N_("December Leonis Minorids");
148+ // TRANSLATORS: Name of meteor shower
149+ N_("Comae Berenicids");
150+ // TRANSLATORS: Name of meteor shower
151+ N_("Orionids");
152+
153+ // List of parent objects for meteor showers
154+ // TRANSLATORS: Name of parent object for meteor shower
155+ N_("Asteroid 2003 EH1");
156+ // TRANSLATORS: Name of parent object for meteor shower
157+ N_("Comet 1P/Halley");
158+ // TRANSLATORS: Name of parent object for meteor shower
159+ N_("Comet 7P/Pons-Winnecke");
160+ // TRANSLATORS: Name of parent object for meteor shower
161+ N_("Comet 55P/Tempel-Tuttle");
162+ // TRANSLATORS: Name of parent object for meteor shower
163+ N_("Comet 96P/Machholz");
164+ // TRANSLATORS: Name of parent object for meteor shower
165+ N_("Comet 109P/Swift-Tuttle");
166+ // TRANSLATORS: Name of parent object for meteor shower
167+ N_("Comet Thatcher (1861 I)");
168+ // TRANSLATORS: Name of parent object for meteor shower
169+ N_("Asteroid (4450) Pan");
170+ // TRANSLATORS: Name of parent object for meteor shower
171+ N_("Comet 26P/Grigg-Skjellerup");
172+ // TRANSLATORS: Name of parent object for meteor shower
173+ N_("Comet 21P/Giacobini-Zinner");
174+
175+ /* For copy/paste:
176+ // TRANSLATORS: Name of meteor shower
177+ N_("");
178+ */
179+
180+#endif
181+}
182
183=== modified file 'plugins/MeteorShowers/src/MeteorShowers.hpp'
184--- plugins/MeteorShowers/src/MeteorShowers.hpp 2013-12-15 06:30:02 +0000
185+++ plugins/MeteorShowers/src/MeteorShowers.hpp 2013-12-22 09:51:09 +0000
186@@ -243,6 +243,12 @@
187 //! Set items for list of struct from data map
188 void setShowersMap(const QVariantMap& map);
189
190+ //! A fake method for strings marked for translation.
191+ //! Use it instead of translations.h for N_() strings, except perhaps for
192+ //! keyboard action descriptions. (It's better for them to be in a single
193+ //! place.)
194+ static void translations();
195+
196 //! Font used for displaying our text
197 QFont font;
198
199
200=== modified file 'plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp'
201--- plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp 2013-12-11 21:08:30 +0000
202+++ plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp 2013-12-22 09:51:09 +0000
203@@ -68,8 +68,8 @@
204 void MeteorShowerDialog::createDialogContent()
205 {
206 ui->setupUi(dialog);
207- ui->tabs->setCurrentIndex(0);
208- connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(languageChanged()));
209+ ui->tabs->setCurrentIndex(0);
210+ connect(&StelApp::getInstance(), SIGNAL(languageChanged()), this, SLOT(retranslate()));
211
212 // Settings tab / updates group
213 ui->displayModeCheckBox->setChecked(GETSTELMODULE(MeteorShowers)->getFlagShowMS());
214
215=== removed file 'plugins/MeteorShowers/src/translations.h'
216--- plugins/MeteorShowers/src/translations.h 2013-12-14 12:02:59 +0000
217+++ plugins/MeteorShowers/src/translations.h 1970-01-01 00:00:00 +0000
218@@ -1,79 +0,0 @@
219-/*
220- * Stellarium
221- * Copyright (C) 2013 Marcos Cardinot
222- * Copyright (C) 2011 Alexander Wolf
223- *
224- * This program is free software; you can redistribute it and/or
225- * modify it under the terms of the GNU General Public License
226- * as published by the Free Software Foundation; either version 2
227- * of the License, or (at your option) any later version.
228- *
229- * This program is distributed in the hope that it will be useful,
230- * but WITHOUT ANY WARRANTY; without even the implied warranty of
231- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
232- * GNU General Public License for more details.
233- *
234- * You should have received a copy of the GNU General Public License
235- * along with this program; if not, write to the Free Software
236- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
237- */
238-
239-class MeteorShowerTranslations
240-{
241- void MeteorShowerTranslations()
242- {
243- ;
244- }
245-
246- static translationShowerList()
247- {
248- // Generate Gettext strings for traduction
249- Q_ASSERT(0);
250-
251- // Meteor showers from catalog (showers.json)
252- N_("Quadrantids");
253- N_("Lyrids");
254- N_("α-Centaurids");
255- N_("γ-Normids");
256- N_("η-Aquariids");
257- N_("June Bootids");
258- N_("Piscis Austrinids");
259- N_("Southern δ-Aquariids");
260- N_("α-Capricornids");
261- N_("α-Aurigids");
262- N_("September ε-Perseids");
263- N_("Draconids");
264- N_("Leonids");
265- N_("Phoenicids");
266- N_("Puppid-Velids");
267- N_("Ursids");
268- N_("Perseids");
269- N_("δ-Leonids");
270- N_("π-Puppids");
271- N_("June Lyrids");
272- N_("κ-Cygnids");
273- N_("ε-Lyrids");
274- N_("δ-Aurigids");
275- N_("ε-Geminids");
276- N_("Southern Taurids");
277- N_("Northern Taurids");
278- N_("Monocerotids");
279- N_("σ-Hydrids");
280- N_("Geminids");
281- N_("Leonis Minorids");
282- N_("December Leonis Minorids");
283- N_("Comae Berenicids");
284- N_("Orionids");
285-
286- // List of parent objects for meteor showers
287- N_("Asteroid 2003 EH1");
288- N_("Comet 1P/Halley");
289- N_("Comet 7P/Pons-Winnecke");
290- N_("Comet 55P/Tempel-Tuttle");
291- N_("Comet 96P/Machholz");
292- N_("Comet 109P/Swift-Tuttle");
293- N_("Comet Thatcher (1861 I)");
294- N_("Asteroid (4450) Pan");
295- N_("Comet 26P/Grigg-Skjellerup");
296- }
297-};
298
299=== modified file 'po/stellarium/POTFILES.in'
300--- po/stellarium/POTFILES.in 2013-10-26 09:16:43 +0000
301+++ po/stellarium/POTFILES.in 2013-12-22 09:51:09 +0000
302@@ -107,3 +107,7 @@
303 plugins/Observability/src/Observability.cpp
304 plugins/Observability/src/gui/ObservabilityDialog.cpp
305 plugins/Observability/src/ui_ObservabilityDialog.h
306+plugins/MeteorShowers/src/MeteorShowers.cpp
307+plugins/MeteorShowers/src/MeteorShower.cpp
308+plugins/MeteorShowers/src/gui/MeteorShowerDialog.cpp
309+plugins/MeteorShowers/src/ui_meteorShowerDialog.h

Subscribers

People subscribed via source and target branches