Package: enigma / 1.20-dfsg.1-2

localedir.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
Index: enigma-1.20/src/Makefile.am
===================================================================
--- enigma-1.20.orig/src/Makefile.am	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/src/Makefile.am	2014-01-23 18:58:10.000000000 +0100
@@ -12,12 +12,12 @@
 CXXFLAGS = @CXXFLAGS@\
 	-DSYSTEM_DATA_DIR=\"$(datadir)/enigma\" \
 	-DDOCDIR=\"$(docdir)\" \
-	-DLOCALEDIR=\"$(localedir_enigma)\" \
+	-DLOCALEDIR=\"$(localedir)\" \
 	-I$(top_srcdir)/lib-src/lua \
 	-I$(top_srcdir)/lib-src/enigma-core \
 	-I$(top_srcdir)/lib-src/enet/include \
 	-I$(top_srcdir)/lib-src \
-	-I$(top_builddir)/intl @SDL_CFLAGS@
+	@SDL_CFLAGS@
 
 
 enigma_SOURCES = 		\
@@ -431,7 +431,7 @@
 
 else # not MINGW32
 
-  localedir_enigma := $(datadir)/locale
+  localedir_enigma := $(localedir)
   mingw_ldadd =
 
 endif
Index: enigma-1.20/src/Makefile.in
===================================================================
--- enigma-1.20.orig/src/Makefile.in	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/src/Makefile.in	2014-01-23 18:58:10.000000000 +0100
@@ -192,12 +192,12 @@
 CXXFLAGS = @CXXFLAGS@\
 	-DSYSTEM_DATA_DIR=\"$(datadir)/enigma\" \
 	-DDOCDIR=\"$(docdir)\" \
-	-DLOCALEDIR=\"$(localedir_enigma)\" \
+	-DLOCALEDIR=\"$(localedir)\" \
 	-I$(top_srcdir)/lib-src/lua \
 	-I$(top_srcdir)/lib-src/enigma-core \
 	-I$(top_srcdir)/lib-src/enet/include \
 	-I$(top_srcdir)/lib-src \
-	-I$(top_builddir)/intl @SDL_CFLAGS@
+	@SDL_CFLAGS@
 
 CYGPATH_W = @CYGPATH_W@
 DATADIRNAME = @DATADIRNAME@
@@ -724,7 +724,7 @@
 	stones/YieldingStone.cc	\
 	stones/YieldingStone.hh
 
-@MINGW32_FALSE@localedir_enigma := $(datadir)/locale
+@MINGW32_FALSE@localedir_enigma := $(localedir)
 @MINGW32_TRUE@localedir_enigma := data/locale
 @MINGW32_FALSE@mingw_ldadd = 
 @MINGW32_TRUE@mingw_ldadd := enigma_ico.o -lws2_32 -lSDL_image -ltiff -llzma -ljpeg -lpng15 -lSDL_mixer -lmikmod -lsmpeg -lstdc++ -lvorbisfile -lvorbis -logg -lSDL_ttf -lcurl -lidn -lwldap32 -lgnutls -lhogweed -lgmp -lz -lnettle -lssh2 -lgcrypt -lgpg-error -lws2_32 -lfreetype -lintl
Index: enigma-1.20/configure
===================================================================
--- enigma-1.20.orig/configure	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/configure	2014-01-23 18:58:10.000000000 +0100
@@ -825,7 +825,7 @@
 pdfdir='${docdir}'
 psdir='${docdir}'
 libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
+localedir='${localedir}'
 mandir='${datarootdir}/man'
 
 ac_prev=
Index: enigma-1.20/Makefile.am
===================================================================
--- enigma-1.20.orig/Makefile.am	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/Makefile.am	2014-01-23 18:58:10.000000000 +0100
@@ -3,13 +3,13 @@
 #   tools -> lib-src/lua
 #   src   -> tools, lib-src
 #
-SUBDIRS = m4 lib-src tools intl src data doc po etc
+SUBDIRS = lib-src tools src data doc po etc
 EXTRA_DIST = enigma CHANGES ACKNOWLEDGEMENTS
 
 docdir = @datadir@/doc/enigma
 doc_DATA = README CHANGES COPYING ACKNOWLEDGEMENTS
 
-ACLOCAL_AMFLAGS = -I m4
+#ACLOCAL_AMFLAGS = -I m4
 
 .PHONY: tolua
 tolua:
Index: enigma-1.20/Makefile.in
===================================================================
--- enigma-1.20.orig/Makefile.in	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/Makefile.in	2014-01-23 18:58:10.000000000 +0100
@@ -288,10 +288,10 @@
 #   tools -> lib-src/lua
 #   src   -> tools, lib-src
 #
-SUBDIRS = m4 lib-src tools intl src data doc po etc
+SUBDIRS = lib-src tools src data doc po etc
 EXTRA_DIST = enigma CHANGES ACKNOWLEDGEMENTS
 doc_DATA = README CHANGES COPYING ACKNOWLEDGEMENTS
-ACLOCAL_AMFLAGS = -I m4
+# ACLOCAL_AMFLAGS = -I m4
 all: all-recursive
 
 .SUFFIXES:
Index: enigma-1.20/src/nls.cc
===================================================================
--- enigma-1.20.orig/src/nls.cc	2014-01-23 18:58:10.000000000 +0100
+++ enigma-1.20/src/nls.cc	2014-01-23 19:01:44.000000000 +0100
@@ -2,6 +2,7 @@
 #include "main.hh"
 #include "ecl_system.hh"
 
+#include <locale.h>
 #include <iostream>
 #include <string>
 #include <cstdlib>
@@ -14,26 +15,38 @@
 static char lang_env[256];
 #endif
 
-static void my_setenv (const std::string &var, const std::string &val)
+static char localeutf[256];
+
+static void my_setenv (const char* var, const char* val)
 {
 #if defined (HAVE_SETENV)
-    setenv(var.c_str(), val.c_str(), 1);
+    setenv(var, val, 1);
 #elif defined (HAVE_PUTENV)
-    snprintf (lang_env, sizeof(lang_env), "%s=%s", var.c_str(), val.c_str());
+    snprintf (lang_env, sizeof(lang_env), "%s=%s", var, val);
     putenv(lang_env);
 #endif
 }
 
 void nls::SetMessageLocale (const std::string &language)
 {
-    if (language != "")
-        my_setenv ("LANG", language);
+    if (language != "") {
+        if (setlocale (LC_MESSAGES, language.c_str()) != NULL) {
+            my_setenv ("LANG", language.c_str());
+        } else {
+            // Second attempt: lang + .UTF-8
+            snprintf(localeutf, sizeof(localeutf), "%s.UTF-8", language.c_str());
+            if (setlocale (LC_MESSAGES, localeutf) != NULL) {
+                my_setenv ("LANG", localeutf);
+            }
+        }
+    }
 
 #if defined(ENABLE_NLS) && defined(HAVE_LC_MESSAGES)
     // Hack to fool libintl into changing the message locale more than
     // once
     setlocale (LC_MESSAGES, "C");
     setlocale (LC_MESSAGES, ""); //language.c_str());
+
 #endif
 
     std::string li = ecl::SysMessageLocaleName();
Index: enigma-1.20/src/nls.hh
===================================================================
--- enigma-1.20.orig/src/nls.hh	2014-01-23 18:43:25.000000000 +0100
+++ enigma-1.20/src/nls.hh	2014-01-23 19:00:51.000000000 +0100
@@ -27,7 +27,7 @@
     const Language languages[] = {
         { "default",    "",      "par" },
         { "Deutsch",    "de_DE", "flags25x15/de" },
-        { "English",    "en_EN", "flags25x15/gb" },
+        { "English",    "en_GB", "flags25x15/gb" },
         { "Español",    "es_ES", "flags25x15/es" },
         { "Français",   "fr_FR", "flags25x15/fr" },
         { "Italiano",   "it_IT", "flags25x15/it" },