Version: (using KDE 4.3.0) Installed from: Unlisted Binary Package Click the source file references (e.g., kcm/kcmdolphingeneral.cpp:56) in Lokalize does nothing at all, even though they are shown as links. A suggestion for what it should do: Use http://lxr.kde.org/ to search for the file. Provide the results as a list of links to source code view of the files (or jump directly to the source code view if there’s only one search result). The line number should be appended to the links, e.g., "http://.../file.cpp#37", so that they take you directly to the relevant line. It would be nice if the results could be displayed in a pane *inside* Lokalize, instead of launched in a separate browser. Using the alternate stylesheet ‘Flat’ on the lxr.kde.org side could be useful to get rid of the margins.
thank you for the suggestion, i'll implement it. right now only opening local files is implemented. For it to work you need to checkout http://websvn.kde.org/trunk/l10n-kde4/scripts/lokalize/ (retaining SVN folder layout) and put http://websvn.kde.org/trunk/l10n-kde4/ru/lokalize-scripts/opensrc.rc to YOUR_LANG/lokalize-scripts and restart Lokalize
oh, and also you need to checkout KDE source, also retaining SVN folder layout ))
What's the state of this report ?
Nick, what about asking users for a root path when they click this and Lokalize is unable to show the file? After the user chooses the sources root folder, all source paths in the PO file can be considered relative to the path that the user specified.
Adrián: una idea buena
I see three possible scenarios here: - Projects where translation files show paths relative to the translation file paths. Most projects that I know do this. I’ve just opened a review request for a patch that would handle opening the source files of these projects. - Projects where translation files show paths relative to some root source path. For these projects, the solution would be to ask for a root source folder path, as I suggested in my previous comment. This root source folder path would have to be stored on the project configuration, so it is not as trivial as my patch for the previous scenario. It would be easy enought to do, though. - Complex projects, like KDE, where paths are neither relative to the translation file nor relative to a common root source folder path. These projects require a project script to handle them. The first scenario is solved with my patch. The second scenario has not been reported here, so a different bug should be reported for it, assuming there is people interested in having it solved. It would be a feature request, not a bug per se. The third scenario is the one reported here, and I personally think that this is an invalid bug. There is no simple way to deal with these paths in projects like KDE, a project script is necessary. And it should be the KDE documentation the one explaining translators how to deal with this issue, not Lokalize. Lokalize should is not a tool to translate KDE, is a tool to translate any project. I think Lokalize already does its job here by pointing users to the chapter of the manual that explains how to write a script to deal with opening source files for a complex project.
thanks for notifying me. i'll review the patch now...
For KDE I use my script opensrc_generate_list.rb (trunk/l10n-kde4/scripts/lokalize/opensrc_generate_list.rb) to scan the whole $HOME folder and generate opensrc_list.py and then the script "opensrc" works perfectly well.
Git commit 70c340bfb316767e81ce6058bd19305913e924d7 by Nick Shaforostoff. Committed on 21/02/2016 at 23:07. Pushed by shaforo into branch 'master'. CHANGELOG: handle source file links found in po files nicely: either open lxr.kde.org lookup or search files locally Related: bug 244686 M +86 -3 src/editortab.cpp M +4 -0 src/lokalize.notifyrc M +115 -0 src/project/project.cpp M +9 -0 src/project/project.h M +3 -0 src/project/projectlocal.kcfg M +1 -1 src/tm/jobs.cpp http://commits.kde.org/lokalize/70c340bfb316767e81ce6058bd19305913e924d7