diff options
author | EGRY Gabor <gaboregry1@t-online.hu> | 2008-01-11 17:50:37 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2008-01-28 17:14:39 -0500 |
commit | 413f006bab3845f12d7b2338a9b548aaf7808548 (patch) | |
tree | d67543e33f5a75a6354b28609973ea7286c8b472 /scripts/kconfig | |
parent | c21a2d9589faa5599c9876bf0e0f48e81ee90284 (diff) |
kconfig: gettext support for menuconfig
Full gettext support for menuconfig.
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>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r-- | scripts/kconfig/mconf.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c index ee9ed3059472..50e61c411bc0 100644 --- a/scripts/kconfig/mconf.c +++ b/scripts/kconfig/mconf.c | |||
@@ -289,11 +289,11 @@ static void get_prompt_str(struct gstr *r, struct property *prop) | |||
289 | int i, j; | 289 | int i, j; |
290 | struct menu *submenu[8], *menu; | 290 | struct menu *submenu[8], *menu; |
291 | 291 | ||
292 | str_printf(r, "Prompt: %s\n", prop->text); | 292 | str_printf(r, _("Prompt: %s\n"), _(prop->text)); |
293 | str_printf(r, " Defined at %s:%d\n", prop->menu->file->name, | 293 | str_printf(r, _(" Defined at %s:%d\n"), prop->menu->file->name, |
294 | prop->menu->lineno); | 294 | prop->menu->lineno); |
295 | if (!expr_is_yes(prop->visible.expr)) { | 295 | if (!expr_is_yes(prop->visible.expr)) { |
296 | str_append(r, " Depends on: "); | 296 | str_append(r, _(" Depends on: ")); |
297 | expr_gstr_print(prop->visible.expr, r); | 297 | expr_gstr_print(prop->visible.expr, r); |
298 | str_append(r, "\n"); | 298 | str_append(r, "\n"); |
299 | } | 299 | } |
@@ -301,13 +301,13 @@ static void get_prompt_str(struct gstr *r, struct property *prop) | |||
301 | for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) | 301 | for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) |
302 | submenu[i++] = menu; | 302 | submenu[i++] = menu; |
303 | if (i > 0) { | 303 | if (i > 0) { |
304 | str_printf(r, " Location:\n"); | 304 | str_printf(r, _(" Location:\n")); |
305 | for (j = 4; --i >= 0; j += 2) { | 305 | for (j = 4; --i >= 0; j += 2) { |
306 | menu = submenu[i]; | 306 | menu = submenu[i]; |
307 | str_printf(r, "%*c-> %s", j, ' ', menu_get_prompt(menu)); | 307 | str_printf(r, "%*c-> %s", j, ' ', _(menu_get_prompt(menu))); |
308 | if (menu->sym) { | 308 | if (menu->sym) { |
309 | str_printf(r, " (%s [=%s])", menu->sym->name ? | 309 | str_printf(r, " (%s [=%s])", menu->sym->name ? |
310 | menu->sym->name : "<choice>", | 310 | menu->sym->name : _("<choice>"), |
311 | sym_get_string_value(menu->sym)); | 311 | sym_get_string_value(menu->sym)); |
312 | } | 312 | } |
313 | str_append(r, "\n"); | 313 | str_append(r, "\n"); |
@@ -337,7 +337,7 @@ static void get_symbol_str(struct gstr *r, struct symbol *sym) | |||
337 | if (hit) | 337 | if (hit) |
338 | str_append(r, "\n"); | 338 | str_append(r, "\n"); |
339 | if (sym->rev_dep.expr) { | 339 | if (sym->rev_dep.expr) { |
340 | str_append(r, " Selected by: "); | 340 | str_append(r, _(" Selected by: ")); |
341 | expr_gstr_print(sym->rev_dep.expr, r); | 341 | expr_gstr_print(sym->rev_dep.expr, r); |
342 | str_append(r, "\n"); | 342 | str_append(r, "\n"); |
343 | } | 343 | } |
@@ -353,7 +353,7 @@ static struct gstr get_relations_str(struct symbol **sym_arr) | |||
353 | for (i = 0; sym_arr && (sym = sym_arr[i]); i++) | 353 | for (i = 0; sym_arr && (sym = sym_arr[i]); i++) |
354 | get_symbol_str(&res, sym); | 354 | get_symbol_str(&res, sym); |
355 | if (!i) | 355 | if (!i) |
356 | str_append(&res, "No matches found.\n"); | 356 | str_append(&res, _("No matches found.\n")); |
357 | return res; | 357 | return res; |
358 | } | 358 | } |
359 | 359 | ||
@@ -433,6 +433,7 @@ static void build_conf(struct menu *menu) | |||
433 | switch (prop->type) { | 433 | switch (prop->type) { |
434 | case P_MENU: | 434 | case P_MENU: |
435 | child_count++; | 435 | child_count++; |
436 | prompt = _(prompt); | ||
436 | if (single_menu_mode) { | 437 | if (single_menu_mode) { |
437 | item_make("%s%*c%s", | 438 | item_make("%s%*c%s", |
438 | menu->data ? "-->" : "++>", | 439 | menu->data ? "-->" : "++>", |
@@ -448,7 +449,7 @@ static void build_conf(struct menu *menu) | |||
448 | case P_COMMENT: | 449 | case P_COMMENT: |
449 | if (prompt) { | 450 | if (prompt) { |
450 | child_count++; | 451 | child_count++; |
451 | item_make(" %*c*** %s ***", indent + 1, ' ', prompt); | 452 | item_make(" %*c*** %s ***", indent + 1, ' ', _(prompt)); |
452 | item_set_tag(':'); | 453 | item_set_tag(':'); |
453 | item_set_data(menu); | 454 | item_set_data(menu); |
454 | } | 455 | } |
@@ -456,7 +457,7 @@ static void build_conf(struct menu *menu) | |||
456 | default: | 457 | default: |
457 | if (prompt) { | 458 | if (prompt) { |
458 | child_count++; | 459 | child_count++; |
459 | item_make("---%*c%s", indent + 1, ' ', prompt); | 460 | item_make("---%*c%s", indent + 1, ' ', _(prompt)); |
460 | item_set_tag(':'); | 461 | item_set_tag(':'); |
461 | item_set_data(menu); | 462 | item_set_data(menu); |
462 | } | 463 | } |
@@ -500,10 +501,10 @@ static void build_conf(struct menu *menu) | |||
500 | item_set_data(menu); | 501 | item_set_data(menu); |
501 | } | 502 | } |
502 | 503 | ||
503 | item_add_str("%*c%s", indent + 1, ' ', menu_get_prompt(menu)); | 504 | item_add_str("%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); |
504 | if (val == yes) { | 505 | if (val == yes) { |
505 | if (def_menu) { | 506 | if (def_menu) { |
506 | item_add_str(" (%s)", menu_get_prompt(def_menu)); | 507 | item_add_str(" (%s)", _(menu_get_prompt(def_menu))); |
507 | item_add_str(" --->"); | 508 | item_add_str(" --->"); |
508 | if (def_menu->list) { | 509 | if (def_menu->list) { |
509 | indent += 2; | 510 | indent += 2; |
@@ -515,7 +516,7 @@ static void build_conf(struct menu *menu) | |||
515 | } | 516 | } |
516 | } else { | 517 | } else { |
517 | if (menu == current_menu) { | 518 | if (menu == current_menu) { |
518 | item_make("---%*c%s", indent + 1, ' ', menu_get_prompt(menu)); | 519 | item_make("---%*c%s", indent + 1, ' ', _(menu_get_prompt(menu))); |
519 | item_set_tag(':'); | 520 | item_set_tag(':'); |
520 | item_set_data(menu); | 521 | item_set_data(menu); |
521 | goto conf_childs; | 522 | goto conf_childs; |
@@ -558,17 +559,17 @@ static void build_conf(struct menu *menu) | |||
558 | tmp = indent - tmp + 4; | 559 | tmp = indent - tmp + 4; |
559 | if (tmp < 0) | 560 | if (tmp < 0) |
560 | tmp = 0; | 561 | tmp = 0; |
561 | item_add_str("%*c%s%s", tmp, ' ', menu_get_prompt(menu), | 562 | item_add_str("%*c%s%s", tmp, ' ', _(menu_get_prompt(menu)), |
562 | (sym_has_value(sym) || !sym_is_changable(sym)) ? | 563 | (sym_has_value(sym) || !sym_is_changable(sym)) ? |
563 | "" : " (NEW)"); | 564 | "" : _(" (NEW)")); |
564 | item_set_tag('s'); | 565 | item_set_tag('s'); |
565 | item_set_data(menu); | 566 | item_set_data(menu); |
566 | goto conf_childs; | 567 | goto conf_childs; |
567 | } | 568 | } |
568 | } | 569 | } |
569 | item_add_str("%*c%s%s", indent + 1, ' ', menu_get_prompt(menu), | 570 | item_add_str("%*c%s%s", indent + 1, ' ', _(menu_get_prompt(menu)), |
570 | (sym_has_value(sym) || !sym_is_changable(sym)) ? | 571 | (sym_has_value(sym) || !sym_is_changable(sym)) ? |
571 | "" : " (NEW)"); | 572 | "" : _(" (NEW)")); |
572 | if (menu->prompt->type == P_MENU) { | 573 | if (menu->prompt->type == P_MENU) { |
573 | item_add_str(" --->"); | 574 | item_add_str(" --->"); |
574 | return; | 575 | return; |
@@ -606,7 +607,7 @@ static void conf(struct menu *menu) | |||
606 | item_set_tag('S'); | 607 | item_set_tag('S'); |
607 | } | 608 | } |
608 | dialog_clear(); | 609 | dialog_clear(); |
609 | res = dialog_menu(prompt ? prompt : _("Main Menu"), | 610 | res = dialog_menu(prompt ? _(prompt) : _("Main Menu"), |
610 | _(menu_instructions), | 611 | _(menu_instructions), |
611 | active_menu, &s_scroll); | 612 | active_menu, &s_scroll); |
612 | if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) | 613 | if (res == 1 || res == KEY_ESC || res == -ERRDISPLAYTOOSMALL) |
@@ -653,7 +654,7 @@ static void conf(struct menu *menu) | |||
653 | if (sym) | 654 | if (sym) |
654 | show_help(submenu); | 655 | show_help(submenu); |
655 | else | 656 | else |
656 | show_helptext("README", _(mconf_readme)); | 657 | show_helptext(_("README"), _(mconf_readme)); |
657 | break; | 658 | break; |
658 | case 3: | 659 | case 3: |
659 | if (item_is_tag('t')) { | 660 | if (item_is_tag('t')) { |
@@ -711,13 +712,13 @@ static void show_help(struct menu *menu) | |||
711 | str_append(&help, nohelp_text); | 712 | str_append(&help, nohelp_text); |
712 | } | 713 | } |
713 | get_symbol_str(&help, sym); | 714 | get_symbol_str(&help, sym); |
714 | show_helptext(menu_get_prompt(menu), str_get(&help)); | 715 | show_helptext(_(menu_get_prompt(menu)), str_get(&help)); |
715 | str_free(&help); | 716 | str_free(&help); |
716 | } | 717 | } |
717 | 718 | ||
718 | static void conf_choice(struct menu *menu) | 719 | static void conf_choice(struct menu *menu) |
719 | { | 720 | { |
720 | const char *prompt = menu_get_prompt(menu); | 721 | const char *prompt = _(menu_get_prompt(menu)); |
721 | struct menu *child; | 722 | struct menu *child; |
722 | struct symbol *active; | 723 | struct symbol *active; |
723 | 724 | ||
@@ -731,7 +732,7 @@ static void conf_choice(struct menu *menu) | |||
731 | for (child = menu->list; child; child = child->next) { | 732 | for (child = menu->list; child; child = child->next) { |
732 | if (!menu_is_visible(child)) | 733 | if (!menu_is_visible(child)) |
733 | continue; | 734 | continue; |
734 | item_make("%s", menu_get_prompt(child)); | 735 | item_make("%s", _(menu_get_prompt(child))); |
735 | item_set_data(child); | 736 | item_set_data(child); |
736 | if (child->sym == active) | 737 | if (child->sym == active) |
737 | item_set_selected(1); | 738 | item_set_selected(1); |
@@ -739,7 +740,7 @@ static void conf_choice(struct menu *menu) | |||
739 | item_set_tag('X'); | 740 | item_set_tag('X'); |
740 | } | 741 | } |
741 | dialog_clear(); | 742 | dialog_clear(); |
742 | res = dialog_checklist(prompt ? prompt : _("Main Menu"), | 743 | res = dialog_checklist(prompt ? _(prompt) : _("Main Menu"), |
743 | _(radiolist_instructions), | 744 | _(radiolist_instructions), |
744 | 15, 70, 6); | 745 | 15, 70, 6); |
745 | selected = item_activate_selected(); | 746 | selected = item_activate_selected(); |
@@ -785,10 +786,10 @@ static void conf_string(struct menu *menu) | |||
785 | heading = _(inputbox_instructions_string); | 786 | heading = _(inputbox_instructions_string); |
786 | break; | 787 | break; |
787 | default: | 788 | default: |
788 | heading = "Internal mconf error!"; | 789 | heading = _("Internal mconf error!"); |
789 | } | 790 | } |
790 | dialog_clear(); | 791 | dialog_clear(); |
791 | res = dialog_inputbox(prompt ? prompt : _("Main Menu"), | 792 | res = dialog_inputbox(prompt ? _(prompt) : _("Main Menu"), |
792 | heading, 10, 75, | 793 | heading, 10, 75, |
793 | sym_get_string_value(menu->sym)); | 794 | sym_get_string_value(menu->sym)); |
794 | switch (res) { | 795 | switch (res) { |