Bug 89095

Summary: scripts don't work in non-english language because the arguments are translated
Product: [Applications] kstars Reporter: Ludovic Grossard <grossard>
Component: generalAssignee: Jasem Mutlaq <mutlaqja>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: akarsh.simha, lueck, mboquien, nicolasg
Priority: NOR    
Version: 1.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ludovic Grossard 2004-09-08 17:07:28 UTC
Version:           1.0 (using KDE 3.3.0, compiled sources)
Compiler:          gcc version 3.3.4 (Debian 1:3.3.4-9)
OS:                Linux (i686) release 2.4.20-xfs

As an example, if I ask kstars to find the Sun with a script, the following line is saved in the .kstars file:
dcop $KSTARS $MAIN  lookTowards Soleil
instead of
dcop $KSTARS $MAIN  lookTowards Sun

The script does not work because the argument is translated!
Comment 1 kstars 2004-09-18 16:39:49 UTC
CVS commit by harris: 

Fixing bug #89095 (scripts don't work in non-english language because
the arguments are translated).  Fixed in both HEAD and 3_3_BRANCH.
Thanks for the report.
CCMAIL: 89095-done@bugs.kde.org


  M +1 -1      scriptbuilder.cpp   1.37


--- kdeedu/kstars/kstars/tools/scriptbuilder.cpp  #1.36:1.37
@@ -1058,5 +1058,5 @@ void ScriptBuilder::slotFindObject() {
                 setUnsavedChanges( true );
 
-                argLookToward->FocusEdit->setCurrentText( fd.currentItem()->objName()->translatedText() );
+                argLookToward->FocusEdit->setCurrentText( fd.currentItem()->objName()->text() );
         }
 }


Comment 2 Ludovic Grossard 2005-01-18 07:30:40 UTC
I tried again with kstars cvs HEAD and it does not work, objects are translated in the script file. I've checked that the above fix is applied in the sources I've compiled.
Moreover, even with english language, lookTowards does not work for some objects, for example:

KSTARS=`dcopfind -a 'kstars*'`
MAIN=KStarsInterface
CLOCK=clock#1
dcop $KSTARS $MAIN  defaultZoom
dcop $KSTARS $MAIN  lookTowards "Machholz (2004 Q2)"
Comment 3 kstars 2006-01-23 03:31:35 UTC
I'm sorry it's been so long since you reopened this bug.

Can you try the following patch?

Index: tools/scriptbuilder.cpp
===================================================================
--- tools/scriptbuilder.cpp     (revision 500731)
+++ tools/scriptbuilder.cpp     (working copy)
@@ -1832,7 +1832,7 @@
        if ( fd.exec() == QDialog::Accepted && fd.currentItem() ) {
                setUnsavedChanges( true );

-               argLookToward->FocusEdit->setCurrentText( fd.currentItem()->objName()->text() );
+               argLookToward->FocusEdit->setCurrentText( fd.currentItem()->objName()->skyObject()->name() );
        }
 }

Comment 4 Soenke Dibbern 2007-02-08 01:52:39 UTC
More than one year later, this still doesn't work. Neither with localized directions, as per .po file, nor with localized object names. I've the directions now left untranslated in my .po file, to keep up the dialog's usability for the user. Could you please drop a note on kde-i18n-doc once you fixed this, to notify translators that it's now worthwhile to complete the translation of kstars.po? TIA
Comment 5 Jasem Mutlaq 2010-08-29 23:26:43 UTC
DCOP is not longer used in KStars.