You need to have the msgfmt program installed. That is the program that takes the .po file and generates the .mo file that is actually used for the lookup. The tools/gen_i18_mo.lua script finds the .po files and runs msgfmt against them automatically to generate the .mo files and installs them in the correct place.
Unfortunately I believe that script translation is in a sad state right now. There is an open issue, German script translation: charset UTF-8 deficient on Windows 10 which documents some of the problems. Some of the scripts don’t have translation enabled. Some have it enabled, but the strings aren’t coded to be translated (I’m guilty, script_manager is one of them). Some scripts have the po files generated and a translation completed, but most don’t have the po file generated. There is also the question of where the .mo files need to be (de vs de_DE).
If you are willing to do the testing and the translating I can do the coding and directory manipulation if we need to move things around.
Bill, that sounds good
Scripting isn’t everyone’s beer so most of the users won’t be bothered by our topic … The nice thing is some extensions are very useful, sometimes
Umlauts? I see, the usual limitations using German strings, happens in other script languages as well…
BTW, it’s possible to replace Umlauts simply by:
ä-ae, ö-oe, ü-ue, ß-ss
It would be OK
I think you’ve done an awesome job altogether, so I hope it doesn’t bother you to add some adjustments if it creates not more problems as it solves. Maybe scripting for Dt gets more popular after this.
I think we should pick one script and figure out how to get it working correctly, then bring the other scripts into line with that. Any certain one you want to start with?
Since darktable mostly uses language for the identifier instead of language_country maybe that’s what we should be using. Anyway, here’s a version of contrib/autostyle.lua that has translation enabled and the resulting po file, locale/de/LC_MESSAGES/autostyle.po. It’s in the attached zip file. You can unzip it in ~/.config/darktable/lua and it should work. Add the translated strings, run gen_i18_mo and see if we have translation.
I generated the po file from the lua directory with the command xgettext -L lua contrib/autostyle.lua -o ./locale/de/LC_MESSAGES/autostyle.po autostyle.zip (3.3 KB)
Thanks for your quick response and interest in this matter,
My test result,
If I start DT from dock, then autostyle is gonna be registered but won’t load if I try to activate it, the error is : “autostyle failed to load”
I installed your *.po file in its Lua path, "lua/locale/de/LC_MESSAGES/"
But Dt built instead a folder called “de_DE” alongside the “de” folder which should contain the *.po files.
So I moved the “LC_MESSAGES/” with its content back to “de_DE” to see if the translation would be accepted.
Unluckily I got the same error as described above.
Then I tried to load DT from command line but DT doesn’t launch anymore as expected with versions below 3.0
The command -d is still there in the options but seems not to work for me
I used "/Applications/darktable.app/Contents/MacOs/darktable -d"
But I think this issue doesn’t bother right now.
I deviate,
I guess it’s less the translation file *.po, than the modified script to cause problems.
Later today I wanna inspect your modifications in an attempt to see if I can be useful to our discussion here
I translated the msgstr values of the *.po file , and hoped to see changes.
The tooltip of the script button “Disable autostyle” of the script manager menu should use the translated line 165 or line 167 of the *.po file, instead to say
“no documentation available”
I tried to change paths as well :
Home/.config/darktable/lua/locale/de/LC_MESSAGES/
Should be fine,
Moreover, I’ve yet another lua script “gimp.lua” with its translation file “gimp.po” and line 313 in there should translate “Edit with gimp” with “Bearbeite mit Gimp” in the export dialog module of light table.
Whether I use de_DE or de as directory for the LC_MESSAGES containing the translation files, it doesn’t replace the language…
Today I figured out how to make my computer speak German while running darktable. I realized at that point that autostyle.lua probably wasn’t the best choice to test with. I too tried gimp.lua. The drop down in the exporter didn’t show in German. I selected an image, then pressed export and got some messages in German. I was at work and that was as far as I got before I had to do some real work . I’ll play some more tonight and see what I can figure out.
Playing some more. I added translation to the dtutils library. I tried specifying for the translations to be looked up in the dtutils.mo file. Nothing worked. Then I thought about how darktable does translations. There is just one mo file per language. So, I created a scripts.po file to hold all of the translations. I pulled the translations from the other files. I removed the duplicates. I compiled just the scripts.po file. I pointed the dtutils library, a test script I wrote, and gimp.lua all at the scripts.mo file. Everything worked, including Edit with GIMP in the exporter menu was in German and the starting GIMP message was also translated.
So, it appears that lumping all the translations into one file and just translating that works. Now I just have to figure out a good way to assemble that file, keep the good translations and weed out the duplicates.