I figured it out. The translation files have to be converted from text to binary (.po files to .mo files) using msgfmt.
To get examples/gettextExample.lua to work you need to go to <your lua scripts directory>/locale/de_DE/LC_MESSAGES and run the command msgfmt -v ../../../examples/de_DE/LC_MESSAGES/gettextExample.po -o gettextExample.mo
Then try running the script and you should see the correct output.
For me, it is okay now. It works even outside the darktable config folder, in a separate folder below the script file (if I extend the package.path in the luarc file). It works on Arch based EndeavourOS and Windows 10 (VM).
The .po file is quite simple, it refers to de_DE and UTF-8 and it must be transformed to .mo as described:
No error messages with -d lua startup
The require is in luarc correctly
and the 1.2.0 module sits in the examples
It shows correctly in the scripts
… simply fails to load
My Error:
Now shows the folllowing:
34.4903 LUA ERROR: script_manager.lua: activate: 367: Error loading examples/InitialWorkflowModule
34.4904 LUA ERROR: script_manager.lua: activate: 368: Error message: module ‘examples/Darktable-Initial-Workflow-Module-1.2.0/InitialWorkflowModule’ not found:
no field package.preload[‘examples/Darktable-Initial-Workflow-Module-1.2.0/InitialWorkflowModule’]
no file ‘/usr/share/lua/5.4/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.lua’
no file ‘/usr/share/lua/5.4/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule/init.lua’
no file ‘/usr/lib/lua/5.4/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.lua’
no file ‘/usr/lib/lua/5.4/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule/init.lua’
no file ‘./examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.lua’
no file ‘./examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule/init.lua’
no file ‘/usr/share/darktable/lua/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.lua’
no file ‘/home/david/.config/darktable/lua/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.lua’
no file ‘/usr/lib/lua/5.4/examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.so’
no file ‘/usr/lib/lua/5.4/loadall.so’
no file ‘./examples/Darktable-Initial-Workflow-Module-1/2/0/InitialWorkflowModule.so’
no file ‘/usr/lib/lua/5.4/examples/Darktable-Initial-Workflow-Module-1.so’
no file ‘/usr/lib/lua/5.4/loadall.so’
no file ‘./examples/Darktable-Initial-Workflow-Module-1.so’
Looks like no files correctly placed in /usr/share or /usr/lib areas … only files in /.config location
I guess I need to manually install as needed … bit strange
My luarc now contains
require “tools/script_manager”
require “examples/Darktable-Initial-Workflow-Module-1.2.0/InitialWorkflowModule”
The script manager is not displaying …
If I remove the old item it makes no difference.