Commit 9e15e164 authored by Samikshan Bairagya's avatar Samikshan Bairagya

Internationalized the WI feature. Made the size of the "Go Back" button...

Internationalized the WI feature. Made the size of the "Go Back" button dependent on the size of the text so that the button-text do not overshoot the button boundaries.
parent c09e17bd
...@@ -69,7 +69,7 @@ rm -f tips.cpp ...@@ -69,7 +69,7 @@ rm -f tips.cpp
$EXTRACTRC xplanet/*.ui *.ui printing/*.ui tools/*.ui dialogs/*.ui fitsviewer/*.ui indi/*.ui options/*.ui oal/*.ui *.rc *.kcfg >> rc.cpp || exit 11 $EXTRACTRC xplanet/*.ui *.ui printing/*.ui tools/*.ui dialogs/*.ui fitsviewer/*.ui indi/*.ui options/*.ui oal/*.ui *.rc *.kcfg >> rc.cpp || exit 11
(cd data && $PREPARETIPS > ../tips.cpp) (cd data && $PREPARETIPS > ../tips.cpp)
$XGETTEXT *.cpp *.h printing/*.cpp tools/*.cpp tools/*.h skycomponents/*.cpp widgets/*.cpp dialogs/*.cpp dialogs/*.h fitsviewer/*.cpp fitsviewer/*.h indi/*.cpp indi/*.h options/*.cpp options/*.h skyobjects/*.cpp skyobjects/*.h xplanet/*.cpp oal/*.h oal/*.cpp -o $podir/kstars.pot $XGETTEXT *.cpp *.h printing/*.cpp tools/*.cpp tools/*.h tools/whatsinteresting/*.h tools/whatsinteresting/*.cpp skycomponents/*.cpp widgets/*.cpp dialogs/*.cpp dialogs/*.h fitsviewer/*.cpp fitsviewer/*.h indi/*.cpp indi/*.h options/*.cpp options/*.h skyobjects/*.cpp skyobjects/*.h xplanet/*.cpp oal/*.h oal/*.cpp -o $podir/kstars.pot
rm -f tips.cpp rm -f tips.cpp
rm -f kstars_i18n.cpp rm -f kstars_i18n.cpp
rm -f rc.cpp rm -f rc.cpp
...@@ -95,7 +95,7 @@ double ObsConditions::getTrueMagLim() ...@@ -95,7 +95,7 @@ double ObsConditions::getTrueMagLim()
* The calculation is just based on the calculation of the * The calculation is just based on the calculation of the
* telescope's aperture to eye's pupil surface ratio. * telescope's aperture to eye's pupil surface ratio.
*/ */
//kDebug() << (LM + 5*log10(aperture/7.5));
return m_LM + 5 * log10(m_Aperture / 7.5); return m_LM + 5 * log10(m_Aperture / 7.5);
} }
......
...@@ -806,7 +806,7 @@ Rectangle { ...@@ -806,7 +806,7 @@ Rectangle {
id: backButton id: backButton
x: container.width + 10 x: container.width + 10
y: 493 y: 493
width: 114 width: leftArrow.width + goBackText.width + 18
height: 49 height: 49
color: "#00000000" color: "#00000000"
radius: 5 radius: 5
...@@ -820,26 +820,28 @@ Rectangle { ...@@ -820,26 +820,28 @@ Rectangle {
Text { Text {
id: goBackText id: goBackText
x: 45
y: 12
color: "#f7e808" color: "#f7e808"
text: "Go back" text: qsTr("Go back")
anchors.leftMargin: 45 anchors.verticalCenterOffset: 0
anchors.horizontalCenterOffset: 53
anchors.horizontalCenter: leftArrow.horizontalCenter
anchors.verticalCenter: leftArrow.verticalCenter
font.family: "Cantarell" font.family: "Cantarell"
font.pointSize: 13 font.pointSize: 13
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
} }
Image { Image {
id: leftArrow id: leftArrow
anchors.right: parent.right x: 5
anchors.rightMargin: 74 y: 9
anchors.left: parent.left anchors.verticalCenterOffset: 0
anchors.leftMargin: 8 anchors.horizontalCenterOffset: -36
anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 8 anchors.verticalCenter: parent.verticalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: 9
source: "leftArrow.png" source: "leftArrow.png"
} }
......
...@@ -93,7 +93,7 @@ void SkyObjItem::setPosition(SkyObject* so) ...@@ -93,7 +93,7 @@ void SkyObjItem::setPosition(SkyObject* so)
double rounded_altitude = (int)(sp.alt().Degrees()/5.0)*5.0; double rounded_altitude = (int)(sp.alt().Degrees()/5.0)*5.0;
int rounded_azimuth = (int)(sp.az().Degrees()/22.5); int rounded_azimuth = (int)(sp.az().Degrees()/22.5);
m_Position = QString("Now visible: About ") + (QString::number(rounded_altitude)) + (" degrees above the ") + (cardinals[rounded_azimuth]) + (" horizon "); m_Position = i18n("Now visible: About %1 degrees above the %2 horizon", rounded_altitude, cardinals[rounded_azimuth]);
} }
QString SkyObjItem::getDesc() const QString SkyObjItem::getDesc() const
...@@ -113,11 +113,11 @@ QString SkyObjItem::getDesc() const ...@@ -113,11 +113,11 @@ QString SkyObjItem::getDesc() const
} }
else if (m_Type == Star) else if (m_Type == Star)
{ {
return "Bright Star"; return i18n("Bright Star");
} }
else if (m_Type == Constellation) else if (m_Type == Constellation)
{ {
return "Constellation"; return i18n("Constellation");
} }
return getTypeName(); return getTypeName();
...@@ -139,7 +139,7 @@ QString SkyObjItem::getSurfaceBrightness() const ...@@ -139,7 +139,7 @@ QString SkyObjItem::getSurfaceBrightness() const
{ {
case Galaxy: case Galaxy:
case Nebula: case Nebula:
return KGlobal::locale()->formatNumber(SB) + " mag/arcmin^2"; return KGlobal::locale()->formatNumber(SB, 2) + " mag/arcmin^2";
default: default:
return QString(" --"); // Not applicable for other sky-objects return QString(" --"); // Not applicable for other sky-objects
} }
...@@ -152,9 +152,9 @@ QString SkyObjItem::getSize() const ...@@ -152,9 +152,9 @@ QString SkyObjItem::getSize() const
case Galaxy: case Galaxy:
case Cluster: case Cluster:
case Nebula: case Nebula:
return QString::number(((DeepSkyObject *)m_So)->a()) + " arcminutes"; return KGlobal::locale()->formatNumber(((DeepSkyObject *)m_So)->a(), 2) + " arcminutes";
case Planet: case Planet:
return QString::number(((KSPlanetBase *)m_So)->angSize()) + " arcseconds"; return KGlobal::locale()->formatNumber(((KSPlanetBase *)m_So)->angSize(), 2) + " arcseconds";
default: default:
return QString(" --"); return QString(" --");
} }
......
...@@ -114,15 +114,15 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index) ...@@ -114,15 +114,15 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index)
QString magText; QString magText;
if (soitem->getType() == SkyObjItem::Constellation) if (soitem->getType() == SkyObjItem::Constellation)
magText = QString("Magnitude: --"); magText = i18n("Magnitude: --");
else else
magText = QString("Magnitude: ") + QString::number(soitem->getMagnitude()) + " mag"; magText = i18n("Magnitude: %1 %2", soitem->getMagnitude(), " mag");
magTextObj->setProperty("text", magText); magTextObj->setProperty("text", magText);
QString sbText = QString("Surface Brightness: ") + soitem->getSurfaceBrightness(); QString sbText = i18n("Surface Brightness: %1", soitem->getSurfaceBrightness());
sbTextObj->setProperty("text", sbText); sbTextObj->setProperty("text", sbText);
QString sizeText = QString("Size: ") + soitem->getSize(); QString sizeText = i18n("Size: %1", soitem->getSize());
sizeTextObj->setProperty("text", sizeText); sizeTextObj->setProperty("text", sizeText);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment