Bug 502627 - There's documentation about "Scripting Lokalize", but that functionality seems to have been removed.
Summary: There's documentation about "Scripting Lokalize", but that functionality seem...
Status: RESOLVED FIXED
Alias: None
Product: lokalize
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.12.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Simon Depiets
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-09 22:22 UTC by Erik Näslund
Modified: 2025-05-03 20:25 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Näslund 2025-04-09 22:22:27 UTC
SUMMARY
There's documentation explaining how to script Localize. However I can't get it to work.

After seeing this commit - https://github.com/KDE/lokalize/commit/a0dc91ddc032485f850bc8fd5333e5a8a58024b6 - I'm drawn to believe that scripting functionality has been removed, and the docs never got updated.

I tried placing the scripts linked from "Chapter 7. Scripting Lokalize" in what I believe to be the right location, but can't get them to work. The script that gets shipped with Lokalize (/usr/share/lokalize/scripts/) doesn't seem to work either.

STEPS TO REPRODUCE
1. Start Lokalize
2. Press F1 och click Help -> Localize Handbook
3. Click Scripting Lokalize.

OBSERVED RESULT
The documentation states that scripting is possible, but I can't get it to work.

EXPECTED RESULT
- If there is no support for scripting any longer, it shouldn't say so in the manual.
- Example scripts (/usr/share/lokalize/scripts/) shouldn't be provided if there isn't any scripting functionality any more.

SOFTWARE/OS VERSIONS
KDE Plasma Version: 6.3.3
KDE Frameworks Version:  6.12.0
Qt Version: 6.8.2

ADDITIONAL INFORMATION
Comment 1 Finley Watson 2025-04-10 07:50:43 UTC
Thanks for reporting. I think Kross doesn't exist any more. There are things to do with DBus in the code still, but testing / maintaining scripting hasn't been a priority for a long time. I haven't looked into how it's supposed to work, but most likely  scripting just will be removed. The handbook is unmaintained at the moment and the example scripts are known to not work.
Comment 2 Erik Näslund 2025-04-10 09:20:19 UTC
(In reply to fin-w from comment #1)
> Thanks for reporting. I think Kross doesn't exist any more. There are things
> to do with DBus in the code still, but testing / maintaining scripting
> hasn't been a priority for a long time. I haven't looked into how it's
> supposed to work, but most likely  scripting just will be removed. The
> handbook is unmaintained at the moment and the example scripts are known to
> not work.

Thanks for confirming. At first I thought I was just being really dense, not being able to figure out how to make it work.
Comment 3 Bug Janitor Service 2025-04-11 01:41:42 UTC
A possibly relevant merge request was started @ https://invent.kde.org/sdk/lokalize/-/merge_requests/217
Comment 4 Albert Astals Cid 2025-04-13 09:16:52 UTC
> The handbook is unmaintained

There is nothing in KDE Gear that unmaintained
Comment 5 Erik Näslund 2025-04-17 00:43:43 UTC
Just as a note - I manage to solve my particular issue once I saw that Lokalize supported D-Bus.
Using `busctl` to call the `org.kde.Lokalize.Editor reloadFile` function was exactly what I needed.

I'm just mentioning this in case you decide to update the handbook.
It might be worth noting that Lokalize exposes a D-Bus interface that can be used to script behavior, if one is inclined to do so :).
Comment 6 Christoph Cullmann 2025-04-21 20:36:58 UTC
Git commit aaa29d78a81d2bc08c1d0efe715f819a0329e96e by Christoph Cullmann, on behalf of Finley Watson.
Committed on 21/04/2025 at 20:36.
Pushed by cullmann into branch 'master'.

Remove all Python scripting

The DBus code still exists in the codebase but hasn't been recently
tested to make sure it works. The Python code is old and does not work
any more because (among other things) Kross doesn't exist any more.

M  +0    -1    CMakeLists.txt
D  +0    -16   scripts/CMakeLists.txt
M  +0    -0    scripts/find-gui-text.sh
D  +0    -20   scripts/msgfmt.py
D  +0    -6    scripts/msgfmt.rc
D  +0    -124  scripts/msgmerge.py
D  +0    -10   scripts/msgmerge.rc
D  +0    -86   scripts/xliff2odf-standalone.py
D  +0    -50   scripts/xliff2odf.py
D  +0    -10   scripts/xliff2odf.rc
D  +0    -384  scripts/xliffmerge.py

https://invent.kde.org/sdk/lokalize/-/commit/aaa29d78a81d2bc08c1d0efe715f819a0329e96e
Comment 7 Albert Astals Cid 2025-04-21 23:17:52 UTC
That commit did not fix the documentation.
Comment 8 Albert Astals Cid 2025-05-03 20:25:45 UTC
Git commit 64a5c84ae80ba32d1b8ae5babb05ac1d625c680e by Albert Astals Cid.
Committed on 03/05/2025 at 20:21.
Pushed by aacid into branch 'master'.

Doc: Remove mention python/js scripting

It does not exist anymore.

M  +2    -43   doc/index.docbook

https://invent.kde.org/sdk/lokalize/-/commit/64a5c84ae80ba32d1b8ae5babb05ac1d625c680e