Bug 71829

Summary: star is not i18n
Product: [Applications] kstars Reporter: gerard
Component: generalAssignee: kstars
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description gerard 2004-01-04 16:34:33 UTC
Version:           1.0 (using KDE 3.1.94 (CVS >= 20031206), compiled sources)
Compiler:          gcc version 3.3.1 (Mandrake Linux 9.2 3.3.1-2mdk)
OS:          Linux (i686) release 2.4.22-10mdk

Many stars are called "star" in non english languages (eg : star (v Tauri))

Gerard
Comment 1 kstars 2004-01-07 22:49:05 UTC
Subject: kdeedu/kstars/kstars

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@bugs.kde.org
CCMAIL: kstars-devel@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)