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
$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)
$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 kstars_i18n.cpp
rm -f rc.cpp
......@@ -95,7 +95,7 @@ double ObsConditions::getTrueMagLim()
* The calculation is just based on the calculation of the
* 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);
}
......
......@@ -806,7 +806,7 @@ Rectangle {
id: backButton
x: container.width + 10
y: 493
width: 114
width: leftArrow.width + goBackText.width + 18
height: 49
color: "#00000000"
radius: 5
......@@ -820,26 +820,28 @@ Rectangle {
Text {
id: goBackText
x: 45
y: 12
color: "#f7e808"
text: "Go back"
anchors.leftMargin: 45
text: qsTr("Go back")
anchors.verticalCenterOffset: 0
anchors.horizontalCenterOffset: 53
anchors.horizontalCenter: leftArrow.horizontalCenter
anchors.verticalCenter: leftArrow.verticalCenter
font.family: "Cantarell"
font.pointSize: 13
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
anchors.fill: parent
}
Image {
id: leftArrow
anchors.right: parent.right
anchors.rightMargin: 74
anchors.left: parent.left
anchors.leftMargin: 8
anchors.top: parent.top
anchors.topMargin: 8
anchors.bottom: parent.bottom
anchors.bottomMargin: 9
x: 5
y: 9
anchors.verticalCenterOffset: 0
anchors.horizontalCenterOffset: -36
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
source: "leftArrow.png"
}
......
......@@ -93,7 +93,7 @@ void SkyObjItem::setPosition(SkyObject* so)
double rounded_altitude = (int)(sp.alt().Degrees()/5.0)*5.0;
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
......@@ -113,11 +113,11 @@ QString SkyObjItem::getDesc() const
}
else if (m_Type == Star)
{
return "Bright Star";
return i18n("Bright Star");
}
else if (m_Type == Constellation)
{
return "Constellation";
return i18n("Constellation");
}
return getTypeName();
......@@ -139,7 +139,7 @@ QString SkyObjItem::getSurfaceBrightness() const
{
case Galaxy:
case Nebula:
return KGlobal::locale()->formatNumber(SB) + " mag/arcmin^2";
return KGlobal::locale()->formatNumber(SB, 2) + " mag/arcmin^2";
default:
return QString(" --"); // Not applicable for other sky-objects
}
......@@ -152,9 +152,9 @@ QString SkyObjItem::getSize() const
case Galaxy:
case Cluster:
case Nebula:
return QString::number(((DeepSkyObject *)m_So)->a()) + " arcminutes";
return KGlobal::locale()->formatNumber(((DeepSkyObject *)m_So)->a(), 2) + " arcminutes";
case Planet:
return QString::number(((KSPlanetBase *)m_So)->angSize()) + " arcseconds";
return KGlobal::locale()->formatNumber(((KSPlanetBase *)m_So)->angSize(), 2) + " arcseconds";
default:
return QString(" --");
}
......
......@@ -114,15 +114,15 @@ void WIView::loadDetailsView(SkyObjItem *soitem, int index)
QString magText;
if (soitem->getType() == SkyObjItem::Constellation)
magText = QString("Magnitude: --");
magText = i18n("Magnitude: --");
else
magText = QString("Magnitude: ") + QString::number(soitem->getMagnitude()) + " mag";
magText = i18n("Magnitude: %1 %2", soitem->getMagnitude(), " mag");
magTextObj->setProperty("text", magText);
QString sbText = QString("Surface Brightness: ") + soitem->getSurfaceBrightness();
QString sbText = i18n("Surface Brightness: %1", soitem->getSurfaceBrightness());
sbTextObj->setProperty("text", sbText);
QString sizeText = QString("Size: ") + soitem->getSize();
QString sizeText = i18n("Size: %1", soitem->getSize());
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