Closed v1993 closed 5 years ago
Yup, it does call init when you load GTK:
https://github.com/pavouk/lgi/blob/ff50e59e85fe808a3bf6783005041449ec2a6bb8/lgi/override/Gtk.lua#L22-L26
So, require("lgi")
does not, but require("lgi").GTK
does call the init functions.
So basically adding translations is very possible. To properly use them, user would have to
lgi
os.setlocale()
, bindtextdomain
and textdomain
Thank you. I'll work on adding basic gettext support in next few weeks (I'm very busy right now so even simple job will take quite some time). Speaking of which, many GLib-specific translation functions are already here bridged using proper bindings, so I see no need to manually bind their original inferior versions (take a look at https://developer.gnome.org/glib/stable/glib-I18N.html for information on differences).
What would be the best location for translation-related functions, by the way? Would lgi.gettext.funcname
be fine?
What would be the best location for translation-related functions, by the way?
Sorry, no idea. This kind of thing would need input from @pavouk, I think.
I'm thinking about adding gettext support into lgi (I think it is appropriate as it is used by GTK internally). However, it seems that one should call a bunch of functions before
gtk_init
(not so clear about ) to make UI properly localized, so ifrequire 'lgi'
already calls it, there is no way to add localization functions in lgi.