I tried the examples/gettextExample.lua script, but it doesn´t work for me. I followed the documentation within the script. I created the .mo file and copied it to .config/darktable/lua/de_DE/LC_MESSAGES
msgfmt -v gettextExample.po -o gettextExample.mo
darktable => preferences => general => interface language = Deutsch (de)
After starting the script using the script manager it should output this three lines, but it doesn´t translate the last line to “Hallo Welt!”.
LUA ERROR Hello World!
LUA ERROR Bild
LUA ERROR Hallo Welt!
I would need to install additional language packs in order to do i18n. I tried just setting LANG and LOCALE, but they both went back to C since I didn’t have the other language packs.
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