Subject: Bug#1424: x2gomatebindings breaks caja locale in MATE

From: Иван <[email-masked]>
Date: Wed, 11 Dec 2019 11:50:43 +0300

Package: x2gomatebindings
Version: 0.0.1.6

When logging with any client some MATE desktop icons and menu entries 
appear in default English language, instead of language set by system 
locale (see included screenshot).

Reason: libcaja-x2goumount.so overrides previously loaded by caja locale 
file with it's own nearly empty file (that is even not existing for many 
languages). This behavior also can be discovered on older versions.

Possible found workarounds:

0. Remove libcaja-x2goumount.so (fixes bug but you lack the umount 
function).

1. Take contents of caja package locale file for your language from 
https://github.com/mate-desktop/caja/tree/master/po and put it into the 
x2gousbmount locale file x2goumount.po in 
/usr/local/share/locale/<your_locale>/. (Best for now)

2. Build x2gomatebindings without locale file support (that is not 
really necessary, due to only one added menu entry). This is done by 
commenting out bindtextdomain strings in 
extension/caja-x2goumount-module.c.

As addition to this, default system locale folder for Debian is 
/usr/share/locale and x2gomatebindings package founds its locale files 
only in /usr/local/share/locale. Workaround: symlink in /usr/local/share 
pointing to /usr/share/locale

Server machine: Debian GNU/Linux 10 (buster) 4.19.0-6-amd64 #1 SMP 
Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux

Package versions: libx2go-config-perl 4.1.0.3-4
libx2go-log-perl 4.1.0.3-4
libx2go-server-db-perl 4.1.0.3-4
libx2go-server-perl 4.1.0.3-4
libx2go-utils-perl 4.1.0.3-4
x2go-keyring 2019.08.20+git20190820.118+10.main.1
x2gomatebindings 0.0.1.6-0~x2go1+git20181121.212+10.main.1
x2goserver 4.1.0.3-4
x2goserver-common 4.1.0.3-4
x2goserver-extensions 4.1.0.3-4
x2goserver-fmbindings 4.1.0.3-4
x2goserver-printing 4.1.0.3-4
x2goserver-x2goagent 4.1.0.3-4
x2goserver-xsession 4.1.0.3-4
x2gothinclient-management 1.5.0.1-0x2go2+git20191129.725+10.main.1
x2gothinclientmanagement 1.5.0.0-0x2go1+git20181202.691+10.main.1

mate-desktop 1.20.4-2
mate-desktop-common 1.20.4-2

caja 1.20.3-1+b1
caja-common 1.20.3-1
caja-extensions-common 1.20.2-1
caja-sendto 1.20.2-1
libcaja-extension1:amd64 1.20.3-1+b1

---

From: Иван <[email-masked]>
Date: Wed, 11 Dec 2019 14:35:42 +0300

Tag: patch

This happens due to incorrect usage of gettext for library (see 
https://www.gnu.org/software/gettext/manual/gettext.html 4.10 Preparing 
Library Sources)

This patch fixes broken behaviour. However, I don't know how to fix 
debian locale files search path issue.

Thank you.

diff --git a/extension/caja-x2goumount-module.c b/extension/caja-x2goumount-module.c
index 9b31584..e32bc32 100644
--- a/extension/caja-x2goumount-module.c
+++ b/extension/caja-x2goumount-module.c
@@ -33,7 +33,6 @@ void caja_module_initialize (GTypeModule*module)
 	      printf("failed bind domain %s %s\n",GETTEXT_PACKAGE, LOCALEDIR);
 	}
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-	textdomain(GETTEXT_PACKAGE);
 }
 
 void caja_module_shutdown (void)
diff --git a/extension/caja-x2goumount.c b/extension/caja-x2goumount.c
index 714cda6..f60dde3 100644
--- a/extension/caja-x2goumount.c
+++ b/extension/caja-x2goumount.c
@@ -22,7 +22,7 @@
  */
 
 #include <config.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 #include <string.h>
 #include <caja/libcaja-extension/caja-extension-types.h>
 #include <caja/libcaja-extension/caja-file-info.h>

---

From: Mike Gabriel <[email-masked]>
Date: Fri, 13 Dec 2019 07:03:16 +0100 (CET)

tag #1424 pending
fixed #1424 0.0.1.7
thanks

Hello,

X2Go issue #1424 (src:x2gomatebindings) reported by you has been
fixed in X2Go Git. You can see the changelog below, and you can
check the diff of the fix at:

    http://code.x2go.org/gitweb?p=x2gomatebindings.git;a=commitdiff;h=8a7cf36

The issue will most likely be fixed in src:x2gomatebindings (0.0.1.7).

light+love
X2Go Git Admin (on behalf of the sender of this mail)

---
commit 8a7cf3610ade26cd6fdc337868007e878e720c9b
Author: Иван <[email-masked]>
Date:   Fri Dec 13 07:02:45 2019 +0100

    Fix incorrect usage of gettext and stop breaking locales of caja. (Fixes: 1424).

diff --git a/debian/changelog b/debian/changelog
index 5f3794e..0b87794 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,13 @@
 x2gomatebindings (0.0.1.7-0~x2go1) UNRELEASED; urgency=medium
 
+  [ X2Go Release Manager ]
   * Continue development
 
+  [ Иван ]
+  * New upstream version (0.0.1.7):
+    - Fix incorrect usage of gettext and stop breaking locales of caja.
+      (Fixes: 1424).
+
  -- X2Go Release Manager <[email-masked]>  Wed, 21 Nov 2018 03:58:12 +0100
 
 x2gomatebindings (0.0.1.6-0~x2go1) unstable; urgency=medium