Make LUA-Scripts translateble
LUA-Scripts need a system to make the UI visible strings translatable.
#1 Updated by Tobias Jakobs about 6 years ago
I've looked a little bit around an VLC uses Lua too and has gettext support:
An VLC Lua-Script, that uses gettext:
And I think this is the git commit:
Perhaps that helps.
#2 Updated by Jérémy Rosen about 6 years ago
a little, but taht's just exporting "_" and "_N" to lua.
That would replace a string with its translated version, but it wouldn't help getting the strings translated in the first place. The hard part is integrating lua source code with gettext to add the lua strings to the .po files.
#4 Updated by Tobias Jakobs about 6 years ago
Localization of third-party plug-ins
Third-party plug-ins (plug-ins that are not distributed with GIMP)
can't have their messages in the gimp-std-plugins textdomain. We
have therefore provided a mechanism that allows plug-ins to install
their own message catalogs and tell GIMP to bind to that
textdomain. This is necessary so that GIMP can correctly translate
the menu paths the plug-in registers. Basically the plug-in has to
call gimp_plugin_domain_add() or gimp_domain_plugin_add_with_path()
before it registers any functions. Have a look at the script-fu
plug-in to see how this is done in detail.
#6 Updated by Tobias Ellinghaus over 4 years ago
- bitness set to 64-bit
- System set to all
- Affected Version set to 2.0.0
- % Done changed from 0 to 50
- Status changed from New to In Progress
You can now use darktable.gettext to translate strings that are also used in darktable itself. If you ship your own .mo you can even use that, I never tried it myself though.
#7 Updated by Tobias Jakobs over 4 years ago
I've tested darktable.gettext and it works fine with darktable 2.0
Next on my list is to figure out how to create and use .mo files.
If everyone else is interested, the documentation is here:
#9 Updated by Tobias Jakobs over 4 years ago
I've tested it and created an example script:
It works fine.