Localisation with debian provided wx3.0 packages

38 views
Skip to first unread message

Kornel Benko

unread,
Mar 19, 2015, 11:08:25 AM3/19/15
to hugi...@googlegroups.com

Hi,
all of no translations are were found by hugin.
After some googling I found this page:
https://code.google.com/p/dolphin-emu/issues/detail?id=6883

Apparently the same thing happened here, because I removed my self compiled wx3.0
and installed the appropriate debian packages like libwxbase3.0-0, ... wx3.0-headers etc.

I am installing into /usr/local, so for instance slovak hugin.mo goes to
/usr/local/share/locale/sk/LC_MESSAGES/hugin.mo

Through strace one can see the stat messages like
25708 stat("/usr/share/locale/sk/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/share/locale/sk/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/share/locale/sk_SK/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/share/locale/sk_SK/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/share/locale/sk_SK.UTF-8/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/share/locale/sk_SK.UTF-8/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk_SK/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk_SK/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk_SK.UTF-8/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory)
25708 stat("/usr/local/share/hugin/sk_SK.UTF-8/LC_MESSAGES/hugin.mo", 0x7fff5c65bad0) = -1 ENOENT (No such file or directory


Easy to change the CMakeLists.txt
diff -r 7dbb6ab5bcfb CMakeLists.txt
--- a/CMakeLists.txt Thu Mar 19 15:40:47 2015 +0100
+++ b/CMakeLists.txt Thu Mar 19 16:02:29 2015 +0100
@@ -496,7 +496,7 @@
SET (MANDIR "share/man")
ENDIF(NOT MANDIR AND NOT $ENV{MANDIR} STREQUAL "")

-SET(LOCALEDIR share/locale)
+SET(LOCALEDIR share/hugin)
SET(ICONDIR share/icons)
SET(LINKDIR share/applications)
SET(LIBDIR lib${LIB_SUFFIX})


OK, this works for me, but I am sure, it is not portable enough.

Someone with better solution?

Kornel
signature.asc

T. Modes

unread,
Mar 19, 2015, 1:19:04 PM3/19/15
to hugi...@googlegroups.com
Hi Kornel,


Am Donnerstag, 19. März 2015 16:08:25 UTC+1 schrieb kornel:
Easy to change the CMakeLists.txt

Does it also works with wx2.8 after applying your patch?

Otherwise have a look at the variable INSTALL_LOCALE_DIR.
It is used by the code like
   locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR));
but not correctly set in CMake.
The variable is defined in hugin_config.h.in.cmake
    #define INSTALL_LOCALE_DIR "${INSTALL_LOCALE_DIR}"

Maybe playing with this variable can help.

Thomas

Kornel Benko

unread,
Mar 19, 2015, 2:19:25 PM3/19/15
to hugi...@googlegroups.com
Am Donnerstag, 19. März 2015 um 10:19:04, schrieb T. Modes <Thomas...@gmx.de>
> Hi Kornel,
>
> Am Donnerstag, 19. März 2015 16:08:25 UTC+1 schrieb kornel:
> >
> > Easy to change the CMakeLists.txt
> >
>
> Does it also works with wx2.8 after applying your patch?

I expect, it will not work with the patch. (I was not proposing to adopt the patch)

> Otherwise have a look at the variable INSTALL_LOCALE_DIR.
> It is used by the code like
> locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR));
> but not correctly set in CMake.
> The variable is defined in hugin_config.h.in.cmake
> #define INSTALL_LOCALE_DIR "${INSTALL_LOCALE_DIR}"
>
> Maybe playing with this variable can help.

Unfortunately this seems not the problem, Hugin _correctly_ places 'hugin.mo'.
It is only, that wx3.0 does search in
1.) /usr/share/locale
2.) /usr/local/share/hugin, but this is wrong.
It should be /usr/local/share/locale.

In the mean time I am installing into /usr (instead of /usr/local). This works without changes in source.

> Thomas

Kornel

signature.asc

T. Modes

unread,
Mar 19, 2015, 2:42:55 PM3/19/15
to hugi...@googlegroups.com


Am Donnerstag, 19. März 2015 19:19:25 UTC+1 schrieb kornel:
> Otherwise have a look at the variable INSTALL_LOCALE_DIR.
> It is used by the code like
>    locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR));
> but not correctly set in CMake.
> The variable is defined in hugin_config.h.in.cmake
>     #define INSTALL_LOCALE_DIR "${INSTALL_LOCALE_DIR}"
>
> Maybe playing with this variable can help.

Unfortunately this seems not the problem, Hugin _correctly_ places 'hugin.mo'.
It is only, that wx3.0 does search in
        1.) /usr/share/locale
        2.) /usr/local/share/hugin, but this is wrong.
                It should be /usr/local/share/locale.

Have you checked this variable?
What value is set to INSTALL_LOCALE_DIR in hugin_config.h?
 
Thomas

Kornel Benko

unread,
Mar 19, 2015, 3:47:07 PM3/19/15
to hugi...@googlegroups.com, T. Modes
Am Donnerstag, 19. März 2015 um 11:42:55, schrieb T. Modes <Thomas...@gmx.de>
>
> Am Donnerstag, 19. März 2015 19:19:25 UTC+1 schrieb kornel:
> >
> > > Otherwise have a look at the variable INSTALL_LOCALE_DIR.
> > > It is used by the code like
> > > locale.AddCatalogLookupPathPrefix(wxT(INSTALL_LOCALE_DIR));
> > > but not correctly set in CMake.
> > > The variable is defined in hugin_config.h.in.cmake
> > > #define INSTALL_LOCALE_DIR "${INSTALL_LOCALE_DIR}"
> > >
> > > Maybe playing with this variable can help.
> >
> > Unfortunately this seems not the problem, Hugin _correctly_ places
> > 'hugin.mo'.

As expected, no problems with wx2.8.

> > It is only, that wx3.0 does search in
> > 1.) /usr/share/locale
> > 2.) /usr/local/share/hugin, but this is wrong.
> > It should be /usr/local/share/locale.
> >
> Have you checked this variable?
> What value is set to INSTALL_LOCALE_DIR in hugin_config.h?

It was empty. And you are right. If set, it searches there from start on now.

So, why don't we set this variable automatically?
Like:
set(INSTALL_LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/${LOCALEDIR})
before calling
configure_file(src/hugin_config.h.in.cmake ${CMAKE_BINARY_DIR}/src/hugin_config.h)


> Thomas

Kornel
>
signature.asc

T. Modes

unread,
Mar 20, 2015, 12:08:02 PM3/20/15
to hugi...@googlegroups.com
Hi Kornel,


Am Donnerstag, 19. März 2015 20:47:07 UTC+1 schrieb kornel:
> Have you checked this variable?
> What value is set to INSTALL_LOCALE_DIR in hugin_config.h?

It was empty. And you are right. If set, it searches there from start on now.

So, why don't we set this variable automatically?

I don't know. The line in the source code is there for a long time. But it seems it was not needed for wxWidgets 2.8. So it makes problems with wxWidgets 3.x.
 
Like:
        set(INSTALL_LOCALE_DIR ${CMAKE_INSTALL_PREFIX}/${LOCALEDIR})
before calling
        configure_file(src/hugin_config.h.in.cmake ${CMAKE_BINARY_DIR}/src/hugin_config.h)

I committed that change. Hopefully that fixes the issue and does not introduce other problems. Please test.

Thanks

Thomas

Kornel Benko

unread,
Mar 20, 2015, 12:24:34 PM3/20/15
to hugi...@googlegroups.com
Am Freitag, 20. März 2015 um 09:08:02, schrieb T. Modes <Thomas...@gmx.de>
Already tested. Works for me (with both wx 2.8 and 3.0).
Not needed on wx2.8, but also not disturbing.

> Thanks
>
> Thomas

Thanks

Kornel

signature.asc
Reply all
Reply to author
Forward
0 new messages