After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790569 - Translatable strings not extracted from nautilus module
Translatable strings not extracted from nautilus module
Status: RESOLVED FIXED
Product: file-roller
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: file-roller-maint
file-roller-maint
Depends on:
Blocks:
 
 
Reported: 2017-11-19 20:46 UTC by Iñigo Martínez
Modified: 2017-11-20 08:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nautilus-fileroller: Avoid the use of g_dgettext (1.79 KB, patch)
2017-11-19 20:55 UTC, Iñigo Martínez
none Details | Review
nautilus-fileroller: Avoid the use of g_dgettext (2.21 KB, patch)
2017-11-19 21:37 UTC, Iñigo Martínez
none Details | Review

Description Iñigo Martínez 2017-11-19 20:46:47 UTC
There are four strings in `nautilus-fileroller.c`[0] which are not translated:

- Extract Here
- Extract the selected archive to the current position
- Extract To…
- Extract the selected archive

These strings are not translated since the meson port. This is due to the `preset` list of options used in meson[1] which doesn't include `g_dgettext`. This list follows the `Migration from Intltool to Gettext` guide[2] that declares a `glib-approved` list.

[0] https://git.gnome.org/browse/file-roller/tree/nautilus/nautilus-fileroller.c
[1] https://github.com/mesonbuild/meson/blob/master/mesonbuild/modules/i18n.py#L25
[2] https://wiki.gnome.org/MigratingFromIntltoolToGettext
Comment 1 Iñigo Martínez 2017-11-19 20:55:26 UTC
Created attachment 364012 [details] [review]
nautilus-fileroller: Avoid the use of g_dgettext

nautilus-fileroller is using g_dgettext which may cause problems when extracting strings on some systems. As explained in the first comment, this is due to `g_dgettext` not being present in the meson `gettext` option list.

Although there are different solutions which can be applied here, I've chosen `_`, because is used in almost the entire source code.

It also changes the module behaviour, because `g_dgettext` is used only under some fixed conditions. However, I don't know if this behaviour change is that important.

Any comment would be very appreciated.
Comment 2 Paolo Bacchilega 2017-11-19 21:10:05 UTC
I think the domain is necessary because a nautilus module has 'nautilus' has default domain and without setting the domain to 'file-roller' you don't get the translated string.
Comment 3 Iñigo Martínez 2017-11-19 21:37:33 UTC
Created attachment 364013 [details] [review]
nautilus-fileroller: Avoid the use of g_dgettext

(In reply to Paolo Bacchilega from comment #2)
> I think the domain is necessary because a nautilus module has 'nautilus' has
> default domain and without setting the domain to 'file-roller' you don't get
> the translated string.

Thanks for the explanation. Here goes another approach, which uses `g_dcgettext` instead of `g_dgettext`, following the behaviour of `dgettext` and `dcgettext`, where the latter can be expressed in terms of the first by using:

  dcgettext (domain, string, LC_MESSAGES)

This shouldn't modify the original behaviour.

[0] https://www.gnu.org/software/libc/manual/html_node/Translation-with-gettext.html
Comment 4 Paolo Bacchilega 2017-11-20 08:35:36 UTC
Patch pushed to master, thank you.