Bug 316924 - Alternate translations path relativeness
Summary: Alternate translations path relativeness
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (other bugs)
Version First Reported In: 1.5
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Nick Shaforostoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-17 18:04 UTC by Karl Ove Hufthammer
Modified: 2019-10-19 14:25 UTC (History)
0 users

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 Karl Ove Hufthammer 2013-03-17 18:04:47 UTC
Alternate translations doesn’t seem to work anymore. The pane for alternate translations is completely empty, even though I’ve set the correct path in the project settings (and the corresponding files do contain translations).

Example:
Root folder set to: /home/huftis/utvikling/skolelinux/i18n/kde4/summit/nn/summit/messages
Alternate translation folder: /home/huftis/utvikling/skolelinux/i18n/kde4/summit/nb/summit/messages

Here is the directory structure: http://svn.skolelinux.no/websvn/listing.php?repname=skolelinux&path=%2Ftrunk%2Fi18n%2Fkde4%2Fsummit%2F&

Reproducible: Always
Comment 1 Karl Ove Hufthammer 2013-03-17 18:22:42 UTC
Note that this is on KDE 4.10, not 4.9 (the version dropdown didn’t have 4.10 as an option).
Comment 2 Nick Shaforostoff 2013-03-18 00:41:35 UTC
Git commit c8b6a9f49f6678887a5c2d7a1080981b1655e40d by Nick Shaforostoff.
Committed on 18/03/2013 at 01:37.
Pushed by shaforo into branch 'KDE/4.10'.

print a warn message if alttrans file was not found

i cannot repro the bug, however i have added a debug message
that can be seen if you run lokalize from konsole

M  +2    -0    src/alttransview.cpp

http://commits.kde.org/lokalize/c8b6a9f49f6678887a5c2d7a1080981b1655e40d
Comment 3 Karl Ove Hufthammer 2013-03-22 18:22:09 UTC
I get this debug message:

  alt trans file doesn't exist: ""
Comment 4 Karl Ove Hufthammer 2014-06-29 12:29:27 UTC
This bug is still present in Lokalize 1.5 from KDE 4.13.1. When I open a file which should have an alternate translation file, I get this debug message:

alt trans file doesn't exist: ""
Comment 5 Karl Ove Hufthammer 2014-08-03 13:13:09 UTC
I think I have found what the problem is. Changing your patch like this:

-        qWarning()<<"alt trans file doesn't exist:"<<info.canonicalFilePath();
+        qWarning()<<"alt trans file doesn't exist:"<<Project::instance()->altTransDir()+'/'+relPath;

(since canonicalFilePath() returns an empty string if the file isn’t found)

it turns out that Lokalize is looking the wrong folder. Example: I have the following:

Root folder: /home/huftis/utvikling/skolelinux/i18n/kde4/summit/nn/summit/messages
Template folder: /home/huftis/utvikling/skolelinux/i18n/kde4/summit/templates/summit/messages

The “What’s this?” help for the alternative translation folder says that it should have a similar structure as the root folder. So I set it to

Alt trans. folder: /home/huftis/utvikling/skolelinux/i18n/kde4/summit/nb/summit/messages

In other words, both the root, template and alternative translations folders are identical except the language code (= ‘templates’ for the template folder).

But the console message says that Lokalize looks into

/home/huftis/utvikling/skolelinux/i18n/kde4/summit/nb/summit/messages/./summit/messages/kdelibs/kdelibs4.po

Change the folder for alternative translations to /home/huftis/utvikling/skolelinux/i18n/kde4/summit/nb fixes things. But I don’t understand how (and why) Lokalize decides to use a path relative to /home/huftis/utvikling/skolelinux/i18n/kde4/summit/‘??’, instead of relative to the root folder, which would be the natural choice (and which is used for the templates settings).
Comment 6 Adrián Chaves (Gallaecio) 2019-10-19 14:25:30 UTC
Git commit ab20f9318e59d463cfd0213fa49409bc6ef92ed6 by Adrián Chaves.
Committed on 19/10/2019 at 14:24.
Pushed by adrianchavesfernandez into branch 'master'.

Fix alternative translation path building

Test Plan: Tested manually

Differential Revision: https://phabricator.kde.org/D24296

M  +1    -1    src/alttransview.cpp

https://commits.kde.org/lokalize/ab20f9318e59d463cfd0213fa49409bc6ef92ed6