18027
|
1 |
/*
|
18039
|
2 |
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
18027
|
3 |
*
|
|
4 |
* Permission is hereby granted, free of charge, to any person obtaining a
|
18039
|
5 |
* copy of this software and associated documentation files (the "Software"),
|
|
6 |
* to deal in the Software without restriction, including without limitation
|
|
7 |
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
8 |
* and/or sell copies of the Software, and to permit persons to whom the
|
|
9 |
* Software is furnished to do so, subject to the following conditions:
|
18027
|
10 |
*
|
18039
|
11 |
* The above copyright notice and this permission notice (including the next
|
|
12 |
* paragraph) shall be included in all copies or substantial portions of the
|
|
13 |
* Software.
|
18027
|
14 |
*
|
18039
|
15 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
18 |
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20 |
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21 |
* DEALINGS IN THE SOFTWARE.
|
18027
|
22 |
*/
|
|
23 |
|
|
24 |
Fixes for bugs that cause problems localizing xscreensaver:
|
|
25 |
6203951 xscreensaver-lock was not properly l10ned
|
|
26 |
|
18061
|
27 |
diff --git xscreensaver-5.11/driver/xscreensaver.c xscreensaver-5.11/driver/xscreensaver.c
|
|
28 |
--- xscreensaver-5.11/driver/xscreensaver.c
|
|
29 |
+++ xscreensaver-5.11/driver/xscreensaver.c
|
18027
|
30 |
@@ -144,6 +144,9 @@
|
|
31 |
#include <ctype.h>
|
|
32 |
#include <X11/Xlib.h>
|
|
33 |
|
|
34 |
+#include <locale.h>
|
|
35 |
+#include <libintl.h>
|
|
36 |
+
|
|
37 |
#include <X11/Xlibint.h>
|
|
38 |
|
|
39 |
#include <X11/Xatom.h>
|
18061
|
40 |
@@ -1465,6 +1468,15 @@ main (int argc, char **argv)
|
18027
|
41 |
struct passwd *spasswd;
|
|
42 |
int i;
|
|
43 |
|
|
44 |
+#ifdef ENABLE_NLS
|
|
45 |
+ if (!setlocale (LC_ALL, ""))
|
|
46 |
+ fprintf (stderr, "locale not supported by C library\n");
|
|
47 |
+
|
|
48 |
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
|
|
49 |
+ textdomain (GETTEXT_PACKAGE);
|
|
50 |
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
|
|
51 |
+#endif /* ENABLE_NLS */
|
|
52 |
+
|
|
53 |
memset(si, 0, sizeof(*si));
|
|
54 |
|
18061
|
55 |
#ifdef HAVE_XSCREENSAVER_LOCK
|
|
56 |
|