Skip to content

Commit

Permalink
kconfig: gettext support for lxdialog
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
EGRY Gabor authored and Sam Ravnborg committed Jan 28, 2008
1 parent 413f006 commit 75c0a8a
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
6 changes: 6 additions & 0 deletions scripts/kconfig/POTFILES.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/checklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions scripts/kconfig/lxdialog/dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@
#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
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/inputbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions scripts/kconfig/lxdialog/menubox.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/lxdialog/textbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int dialog_textbox(const char *title, const char *tbuf,

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 */

Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/lxdialog/yesno.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 75c0a8a

Please sign in to comment.