[Kstars-devel] kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Wed Jan 7 22:48:34 CET 2004


CVS commit by harris: 

Fixing Bug #71829: star is not i18n

It's a bit complicated, but essentially:  We keep several name-strings for 
each object, including the untranslated English Name [name()], the 
translated name [translatedName()], and a long name [longName()].

We display the "long name" of sky objects in the status bar and the 
popup menu.  In the case of unnamed stars, the "long name" was being 
assigned the non-localized name "star".  We now are using 
"translatedName()" in SkyObject::setLongName(), so it 
should work.  Please test.

Incidental fixes: Fixed three instances where we compare the untranslated 
name to "i18n("star")" instead of just "star" in starobject.cpp and 
kspopupmenu.cpp.
 
CCMAIL: 71829-done at bugs.kde.org
CCMAIL: kstars-devel at kde.org


  M +1 -1      kspopupmenu.cpp   1.14
  M +2 -2      skyobject.cpp   1.36
  M +2 -2      starobject.cpp   1.16


--- kdeedu/kstars/kstars/kspopupmenu.cpp  #1.13:1.14
@@ -49,5 +49,5 @@ void KSPopupMenu::createStarMenu( StarOb
 
 //If the star is named, add custom items to popup menu based on object's ImageList and InfoList
-        if ( star->name() != i18n("star") ) {
+        if ( star->name() != "star" ) {
                 addLinksToMenu( star );
         } else {

--- kdeedu/kstars/kstars/skyobject.cpp  #1.35:1.36
@@ -59,6 +59,6 @@ SkyObject::SkyObject( int t, double r, d
 void SkyObject::setLongName( const QString &longname ) {
         if ( longname.isEmpty() ) {
-                if ( Name.length() )
-                        LongName = Name;
+                if ( translatedName().length() )
+                        LongName = translatedName();
                 else if ( Name2.length() )
                         LongName = Name2;

--- kdeedu/kstars/kstars/starobject.cpp  #1.15:1.16
@@ -41,5 +41,5 @@ StarObject::StarObject( dms r, dms d, fl
 {
         QString lname = "";
-        if ( n.length() && n != i18n("star") ) {
+        if ( n.length() && n != "star" ) {
                 if ( n2.length() )
                         lname = n + " (" + gname() + ")";
@@ -50,5 +50,5 @@ StarObject::StarObject( dms r, dms d, fl
 
         //If genetive name exists, but no primary name, set primary name = genetive name.
-        if ( n2.length() && n == i18n( "star" ) ) {
+        if ( n2.length() && n == "star" ) {
                 setName( gname() );
                 setName2(); //no secondary name (it is now primary)




More information about the Kstars-devel mailing list