kconfig: gettext support for lxdialog
authorEGRY Gabor <gaboregry1@t-online.hu>
Fri, 11 Jan 2008 22:42:54 +0000 (23:42 +0100)
committerSam Ravnborg <sam@ravnborg.org>
Mon, 28 Jan 2008 22:14:39 +0000 (23:14 +0100)
Gettext support for lxdialog.

Signed-off-by: Egry Gabor <gaboregry1@t-online.hu>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>
scripts/kconfig/POTFILES.in
scripts/kconfig/lxdialog/checklist.c
scripts/kconfig/lxdialog/dialog.h
scripts/kconfig/lxdialog/inputbox.c
scripts/kconfig/lxdialog/menubox.c
scripts/kconfig/lxdialog/textbox.c
scripts/kconfig/lxdialog/yesno.c

index 19d0e63fb7babcff758d3d625773d5e2663cf2e4..9674573969902fab7bc90a3875f653d5bae6ba20 100644 (file)
@@ -1,3 +1,9 @@
+scripts/kconfig/lxdialog/checklist.c
+scripts/kconfig/lxdialog/inputbox.c
+scripts/kconfig/lxdialog/menubox.c
+scripts/kconfig/lxdialog/textbox.c
+scripts/kconfig/lxdialog/util.c
+scripts/kconfig/lxdialog/yesno.c
 scripts/kconfig/mconf.c
 scripts/kconfig/conf.c
 scripts/kconfig/confdata.c
index cf697080ddddd4bf47df0057f860ef681255ea29..b2a878c936d63c793bca031b9b5d52f62b9e2e19 100644 (file)
@@ -97,8 +97,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
        int x = width / 2 - 11;
        int y = height - 2;
 
-       print_button(dialog, "Select", y, x, selected == 0);
-       print_button(dialog, " Help ", y, x + 14, selected == 1);
+       print_button(dialog, gettext("Select"), y, x, selected == 0);
+       print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
 
        wmove(dialog, y, x + 1 + 14 * selected);
        wrefresh(dialog);
index c4ad37fd922c53d83ef3cd908e7872c6fb831eda..b5211fce0d946ab90eaf1ba239f3b20b40039b11 100644 (file)
 #include <string.h>
 #include <stdbool.h>
 
+#ifndef KBUILD_NO_NLS
+# include <libintl.h>
+#else
+# define gettext(Msgid) ((const char *) (Msgid))
+#endif
+
 #ifdef __sun__
 #define CURS_MACROS
 #endif
index 05e72066b35987dfe7037f6abd2fe29a03cb016a..4946bd02b46d4324939b8ba7e03db1174359d645 100644 (file)
@@ -31,8 +31,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
        int x = width / 2 - 11;
        int y = height - 2;
 
-       print_button(dialog, "  Ok  ", y, x, selected == 0);
-       print_button(dialog, " Help ", y, x + 14, selected == 1);
+       print_button(dialog, gettext("  Ok  "), y, x, selected == 0);
+       print_button(dialog, gettext(" Help "), y, x + 14, selected == 1);
 
        wmove(dialog, y, x + 1 + 14 * selected);
        wrefresh(dialog);
index 0d83159d90127a1dad38be99edff1a0973353a33..fa9d633f293c7c3a107b956e15774afd27560b12 100644 (file)
@@ -157,9 +157,9 @@ static void print_buttons(WINDOW * win, int height, int width, int selected)
        int x = width / 2 - 16;
        int y = height - 2;
 
-       print_button(win, "Select", y, x, selected == 0);
-       print_button(win, " Exit ", y, x + 12, selected == 1);
-       print_button(win, " Help ", y, x + 24, selected == 2);
+       print_button(win, gettext("Select"), y, x, selected == 0);
+       print_button(win, gettext(" Exit "), y, x + 12, selected == 1);
+       print_button(win, gettext(" Help "), y, x + 24, selected == 2);
 
        wmove(win, y, x + 1 + 12 * selected);
        wrefresh(win);
index fabfc1ad789d674f5f91637cba70cbfc335431d0..c704712d02271431fa9c42d0cd95be9c2ab9d988 100644 (file)
@@ -114,7 +114,7 @@ do_resize:
 
        print_title(dialog, title, width);
 
-       print_button(dialog, " Exit ", height - 2, width / 2 - 4, TRUE);
+       print_button(dialog, gettext(" Exit "), height - 2, width / 2 - 4, TRUE);
        wnoutrefresh(dialog);
        getyx(dialog, cur_y, cur_x);    /* Save cursor position */
 
index ee0a04e3e012ecd4ba119cd153d96a08ded7b2a2..4e6e8090c20b573868e3cfe15015a6b6f54b2f69 100644 (file)
@@ -29,8 +29,8 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
        int x = width / 2 - 10;
        int y = height - 2;
 
-       print_button(dialog, " Yes ", y, x, selected == 0);
-       print_button(dialog, "  No  ", y, x + 13, selected == 1);
+       print_button(dialog, gettext(" Yes "), y, x, selected == 0);
+       print_button(dialog, gettext("  No  "), y, x + 13, selected == 1);
 
        wmove(dialog, y, x + 1 + 13 * selected);
        wrefresh(dialog);