Merge lp:~alexwolf/stellarium/applanguage into lp:stellarium

Proposed by Alexander Wolf
Status: Merged
Approved by: treaves
Approved revision: 4958
Merged at revision: 4968
Proposed branch: lp:~alexwolf/stellarium/applanguage
Merge into: lp:stellarium
Diff against target: 34 lines (+11/-2)
2 files modified
src/core/modules/LandscapeMgr.cpp (+5/-1)
src/gui/ViewDialog.cpp (+6/-1)
To merge this branch: bzr merge lp:~alexwolf/stellarium/applanguage
Reviewer Review Type Date Requested Status
treaves Approve
Review via email: mp+77471@code.launchpad.net

This proposal supersedes a proposal from 2011-09-10.

To post a comment you must log in.
Revision history for this message
treaves (treaves) wrote : Posted in a previous version of this proposal

Please use braces with the if/else's, even with one line of code.

review: Needs Fixing
Revision history for this message
Alexander Wolf (alexwolf) wrote :

Fixed

Revision history for this message
treaves (treaves) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/core/modules/LandscapeMgr.cpp'
2--- src/core/modules/LandscapeMgr.cpp 2011-08-27 13:37:21 +0000
3+++ src/core/modules/LandscapeMgr.cpp 2011-09-29 07:33:29 +0000
4@@ -962,7 +962,11 @@
5
6 QString LandscapeMgr::getDescription() const
7 {
8- QString lang = StelApp::getInstance().getLocaleMgr().getAppLanguage();
9+ QString lang = StelApp::getInstance().getLocaleMgr().getAppLanguage();
10+ if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang))
11+ {
12+ lang = lang.split("_").at(0);
13+ }
14 QString descriptionFile = StelFileMgr::findFile("landscapes/" + getCurrentLandscapeID(), StelFileMgr::Directory) + "/description." + lang + ".utf8";
15 QString desc;
16
17
18=== modified file 'src/gui/ViewDialog.cpp'
19--- src/gui/ViewDialog.cpp 2011-06-20 09:01:49 +0000
20+++ src/gui/ViewDialog.cpp 2011-09-29 07:33:29 +0000
21@@ -391,7 +391,12 @@
22 QString descPath;
23 try
24 {
25- descPath = StelFileMgr::findFile("skycultures/" + StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description."+StelApp::getInstance().getLocaleMgr().getAppLanguage()+".utf8");
26+ QString lang = StelApp::getInstance().getLocaleMgr().getAppLanguage();
27+ if (!QString("pt_BR zh_CN zh_HK zh_TW").contains(lang))
28+ {
29+ lang = lang.split("_").at(0);
30+ }
31+ descPath = StelFileMgr::findFile("skycultures/" + StelApp::getInstance().getSkyCultureMgr().getCurrentSkyCultureID() + "/description."+lang+".utf8");
32 }
33 catch (std::runtime_error& e)
34 {