Bug 428465 - Lokalize opens the source file only once
Summary: Lokalize opens the source file only once
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (show other bugs)
Version: 20.08
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: wojnilowicz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-30 10:15 UTC by Valdas
Modified: 2023-03-09 23:08 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valdas 2020-10-30 10:15:28 UTC
> STEPS TO REPRODUCE
1. Download the source code of any program to a separate folder (in my case, maser branch of Inkscape);
2. Create a translation project in a separate folder;
3. Copy the language file from the source to the project folder (in my case, file "lt.po");
4. Open a copied file in Lokalize;
5. In a window "Unit metadata" section "File:" click on link to source code (for the first time, a dialog box asks where the source code resides) -> file opens in external editor;
6. Close external editor;
7. Click on a link again -> nothing happens;

When I restart Lokalize, I can only open the source file once.

> EXPECTED RESULT
The link must be opened every time.

> ADDITIONAL INFORMATION
In "Settings/General" the option "Use custom editor to open source files" is set and command line for that is "kate %1:%2".

> LOG from konsole:
----- Loaklize started ------
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kf.sonnet.clients.hspell: HSpellDict::HSpellDict: Init failed
QStatusBar::insertWidget: Index out of range (5), appending widget
org.kde.lokalize: db "default140416171112000" opened 1 "lt_LT"
kf.kross.core: Action::setInterpreter: interpreter not found:  "python"
org.kde.lokalize: db "Vertimas-Inkscape140416171112000" opened 24 "lt"
org.kde.lokalize: alt trans file doesn't exist: "/home/senbuvis/Mano_popieriai/Vertimas/Inkscape/lt.po"
org.kde.lokalize: indexed "/home/senbuvis/Mano_popieriai/Vertimas/Inkscape/lt.po" for word completion in 23 msecs
------ clicked on a link ------
org.kde.lokalize: Starting SourceFilesSearchJob on  "/home/senbuvis/Git/inkscape/po"
Hspell: can't open /usr/share/hspell/hebrew.wgz.sizes.
kf.sonnet.clients.hspell: HSpellDict::HSpellDict: Init failed
kf.kio.widgets.kdirmodel: protocol mismatch: "" vs "file"
------ again clicked on a link -> no additional text appears ------

> SOFTWARE/OS VERSIONS
Linux: 5.8.0-26, 64 bit
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Comment 1 wojnilowicz 2023-02-07 17:36:42 UTC
I cannot reproduce the bug in Lokalize 23.03.70. I use Lokalize instead of Inkscape for testing and opening source file works many times. Is it still an issue for you?
Comment 2 Valdas 2023-02-08 16:54:16 UTC
I can only test the latest version 22.12.2 in the Arch repositories.
But now I can't open an external file from an Inkscape project, whenever I select a project folder, subfolder, or subsubfolder, Lokalize can't find that file.
I tried the Lokalize project and the external file only opens once. But I'm running into strange behavior: I click on the link -> a dialog opens "Do you want to select a source directory" -> I selected the wrong folder -> nothing happens -> I click the link again -> a dialog opens -> I choose the correct one folder -> external editor opens -> I close that editor -> external editor opens again.
Comment 3 wojnilowicz 2023-02-08 20:11:42 UTC
(In reply to Valdas from comment #2)
> I can only test the latest version 22.12.2 in the Arch repositories.
> But now I can't open an external file from an Inkscape project, whenever I
> select a project folder, subfolder, or subsubfolder, Lokalize can't find
> that file.
> I tried the Lokalize project and the external file only opens once. But I'm
> running into strange behavior: I click on the link -> a dialog opens "Do you
> want to select a source directory" -> I selected the wrong folder -> nothing
> happens -> I click the link again -> a dialog opens -> I choose the correct
> one folder -> external editor opens -> I close that editor -> external
> editor opens again.

Double opening of a file might be a second bug. The thing is to check if your original bug is still present. Does it work with Lokalize project then?
Comment 4 Valdas 2023-02-09 07:44:05 UTC
Yes I tried. Bug still present, the external file only opens once.
Comment 5 Bug Janitor Service 2023-02-19 16:01:14 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/33
Comment 6 Albert Astals Cid 2023-03-09 23:08:35 UTC
Git commit da1078cd684c9938e6d5d8de261888930f86c46d by Albert Astals Cid, on behalf of Łukasz Wojniłowicz.
Committed on 09/03/2023 at 23:01.
Pushed by aacid into branch 'master'.

Fix opening source files with relative paths

M  +10   -3    src/editortab.cpp
M  +7    -0    src/project/project.h

https://invent.kde.org/sdk/lokalize/commit/da1078cd684c9938e6d5d8de261888930f86c46d