Bug 86713 - source context not shown - usability bug?
Summary: source context not shown - usability bug?
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kbabel
Classification: Miscellaneous
Component: general (show other bugs)
Version: 1.9
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Stanislav Visnovsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-06 18:01 UTC by Manuel Fierlbeck
Modified: 2011-06-26 14:10 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Fierlbeck 2004-08-06 18:01:45 UTC
Version:           1.9 (using KDE KDE 3.2.92)
Installed from:    Compiled From Sources
Compiler:          gcc-3.3.1 
OS:                Linux

I can't make kbabel show the source context of a message string in the source view tab. All I get is "Corresponding source file not found". I tried many variations on the source paths in the project configuration dialog, but none works. Unfortunately, this very part of the configuration dialog is not documented in the manual, and there's no "what's this" help available. The variable names and the terms "path patterns" and "base folder for source code" are not at all clear to me - at least, they didn't mean what I thought.

So, I don't know if source file lookup actually doesn't work or if configuration is documented poorly / presented in a misleading way. If it's a configuration issue, how do I correctly set the source paths? The file I want to translate is "/home/manuel/entw/orthanc/po/de.po". The corresponding sources are in "/home/manuel/entw/orthanc/src". The "src" directory contains some subprojects. Message locations appear in the form e.g. "orproject/charactereditpanel.cpp", referring to "/home/manuel/entw/orthanc/src/orproject/charactereditpanel.cpp". Which paths do I have to enter in the project configuration dialog?
Comment 1 Stanislav Visnovsky 2004-10-05 07:53:40 UTC
Do you have any idea how to ease the configuration?

The current one is aimed at flexibility - because
sources can be structured very differently.
Comment 2 Konrad Twardowski 2005-03-19 20:35:12 UTC
Hi,
Use KURLRequester class as a directory chooser for "Base folder for source code".
The KURLRequester mode should be KFile::Directory|KFile::ExistingOnly.

Currently KBabel does not check if the typed directory actually exists.
Comment 3 Nicolas Goutte 2005-10-01 11:59:21 UTC
SVN commit 465925 by goutte:

Use a URL requester instead of a simple line edit widget for the
base path of the source code
CCBUG:86713
(This does not close the bug, as the bug reporter wnats some more help,
but we are in message freeze.)


 M  +7 -4      projectprefwidgets.cpp  
 M  +2 -1      projectprefwidgets.h  


--- branches/KDE/3.5/kdesdk/kbabel/commonui/projectprefwidgets.cpp #465924:465925
@@ -890,7 +890,7 @@
     QHBox* hbox = new QHBox(box);
     hbox->setSpacing(KDialog::spacingHint());
 
-    KFile::Mode mode = static_cast<KFile::Mode>( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+    const KFile::Mode mode = static_cast<KFile::Mode>( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
 	
 												
     _poDirEdit = new KURLRequester(hbox, "kcfg_PoBaseDir");
@@ -1141,10 +1141,13 @@
     box->setSpacing(KDialog::spacingHint());
     QLabel* tempLabel=new QLabel(i18n("&Base folder for source code:"),box);
 
-    _coderootEdit = new QLineEdit(box, "kcfg_CodeRoot");
-    tempLabel->setBuddy(_coderootEdit);
+    const KFile::Mode mode = static_cast<KFile::Mode>( KFile::Directory | KFile::ExistingOnly | KFile::LocalOnly );
+    _coderootEdit = new KURLRequester ( box, "kcfg_CodeRoot" );
+    _coderootEdit->setMode( mode );
+    _coderootEdit->setMinimumSize( 250, _coderootEdit->sizeHint().height() );
+    tempLabel->setBuddy( _coderootEdit );
     layout->addWidget(box);
-
+												
     // FIXME: use KConfigXT    
     _pathsEditor = new KListEditor(page);
     _pathsEditor->setTitle(i18n("Path Patterns"));
--- branches/KDE/3.5/kdesdk/kbabel/commonui/projectprefwidgets.h #465924:465925
@@ -58,6 +58,7 @@
 class KListEditor;
 class ToolSelectionWidget;
 class KIntNumInput;
+class KURLRequester;
 
 struct ModuleInfo;
 
@@ -276,7 +277,7 @@
     void itemsChanged ();
 
 private:
-    QLineEdit* _coderootEdit;
+    KURLRequester* _coderootEdit;
     KListEditor* _pathsEditor;
 };
 
Comment 4 Daniel Hahler 2005-11-15 02:26:11 UTC
Manuel, try setting the base source folder to: /home/manuel/entw/orthanc/ and add "@CODEROOT@/src/" to the list of "Path Patterns" - actually it should be enough if it's the only one. But not that you lose the only "documentation" there by removing the other @KEYWORDS@.. ;)

HTH.
Comment 5 Nicolas Goutte 2005-12-26 11:50:34 UTC
I have fixed a few problems with the source references, including the bugs #114041 and #116393.

As your project seems to be GNU-like, you could add following rule (however only in the current development version, which will be KBabel 1.11.1 of KDE 3.5.1):
@POFILEDIR@/../@COMMENTPATH@

(This new rule is now part of the default rules for new projects.)

Have a nice day!
Comment 6 Nicolas Goutte 2005-12-26 12:50:27 UTC
On Monday 26 December 2005 11:50, Nicolas Goutte wrote:
(...)
> POFILEDIR /  / COMMENTPATH@


As the KDE Bugs' censor has passed here, please read:

(at)POFILEDIR(at)/(dot)(dot)/(at)COMMENTPATH(at)

>
> (This new rule is now part of the default rules for new projects.)
>
> Have a nice day!

Comment 7 Nicolas Goutte 2005-12-26 17:29:03 UTC
See also bug #85885 which asks for a full documentation of the "source" configuration dialog.
Comment 8 Nicolas Goutte 2005-12-29 13:12:04 UTC
For older KBabel versions, you can use:
(at)PACKAGEDIR(at)/(dot)(dot)/(at)COMMENTPATH(at) 

Ad for a GNU(-like) project, you cannot use the catalog manager, it will not make a difference.

Meanwhile, the documentation has been updated. (It will be released with KDE 3.5.1.)

Have a nice day!
Comment 9 Christoph Feck 2011-06-26 14:10:17 UTC
KBabel is no longer maintained, please use the KDE 4 translator's tool called
"Lokalize" instead. For more information, please visit
http://userbase.kde.org/Lokalize

If this is a request for a feature which is also missing in Lokalize, please add a comment so that I can reassign the request to the Lokalize authors. You could also file a new request for Lokalize.