diff options
| author | Arnaldo Carvalho de Melo <acme@ghostprotocols.net> | 2005-05-05 18:09:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-05 18:24:00 -0400 |
| commit | 3b9fa0931dd86a1fe5507311ee8031650f5d0e8c (patch) | |
| tree | b40a8a09aca2b52f40d548b34c48ea46ba10b90f /scripts | |
| parent | f403b7f452e4347f6af14c1f3c47bce758eb6337 (diff) | |
[PATCH] Kconfig i18n support
This patch adds i18n support for make *config, allowing users to have the
config process in their own language.
No printk was harmed in the process, don't worry, so all the bug reports,
kernel messages, etc, remain in english, just the user tools to configure
the kernel are internationalized.
Users not interested in translations can just unset the related LANG,
LC_ALL, etc env variables and have the config process in plain english,
something like:
LANG= make menuconfig
is enough for having the whole config process in english. Or just don't
install any translation file.
Translations for brazilian portuguese are being done by a team of
volunteers at:
http://www.visionflex.inf.br/kernel_ptbr/pmwiki.php/Principal/Traducoes
To start the translation process:
make update-po-config
This will generate the pot template named scripts/kconfig/linux.pot,
copy it to, say, ~/es.po, to start the translation for spanish.
To test your translation, as root issue this command:
msgfmt -o /usr/share/locale/es/LC_MESSAGES/linux.mo ~/es.po
Replace "es" with your language code.
Then execute, for instance:
make menuconfig
The current patch doesn't use any optimization to reduce the size of the
generated .mo file, it is possible to use the config option as a key, but
this doesn't prevent the current patch from being used or the translations
done under the current scheme to be in any way lost if we chose to do any
kind of keying.
Thanks to Fabricio Vaccari for starting the pt_BR (brazilian portuguese)
translation effort, Thiago Maciera for helping me with the gconf.cc (QT
frontent) i18n coding and to all the volunteers that are already working on
the first translation, to pt_BR.
I left the question on whether to ship the translations with the stock kernel
sources to be discussed here, please share your suggestions.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org
Signed-off-by: Andrew Morton <akpm@osdl.org>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/kconfig/Makefile | 14 | ||||
| -rw-r--r-- | scripts/kconfig/POTFILES.in | 5 | ||||
| -rw-r--r-- | scripts/kconfig/conf.c | 20 | ||||
| -rw-r--r-- | scripts/kconfig/confdata.c | 16 | ||||
| -rw-r--r-- | scripts/kconfig/gconf.c | 52 | ||||
| -rw-r--r-- | scripts/kconfig/kxgettext.c | 221 | ||||
| -rw-r--r-- | scripts/kconfig/lkc.h | 8 | ||||
| -rw-r--r-- | scripts/kconfig/mconf.c | 120 | ||||
| -rw-r--r-- | scripts/kconfig/menu.c | 4 | ||||
| -rw-r--r-- | scripts/kconfig/qconf.cc | 59 |
10 files changed, 395 insertions, 124 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 5a5ddc40f36c..09abb891d11f 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Kernel configuration targets | 2 | # Kernel configuration targets |
| 3 | # These targets are used from top-level makefile | 3 | # These targets are used from top-level makefile |
| 4 | 4 | ||
| 5 | .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig | 5 | .PHONY: oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config |
| 6 | 6 | ||
| 7 | xconfig: $(obj)/qconf | 7 | xconfig: $(obj)/qconf |
| 8 | $< arch/$(ARCH)/Kconfig | 8 | $< arch/$(ARCH)/Kconfig |
| @@ -23,6 +23,13 @@ oldconfig: $(obj)/conf | |||
| 23 | silentoldconfig: $(obj)/conf | 23 | silentoldconfig: $(obj)/conf |
| 24 | $< -s arch/$(ARCH)/Kconfig | 24 | $< -s arch/$(ARCH)/Kconfig |
| 25 | 25 | ||
| 26 | update-po-config: $(obj)/kxgettext | ||
| 27 | xgettext --default-domain=linux \ | ||
| 28 | --add-comments --keyword=_ --keyword=N_ \ | ||
| 29 | --files-from=scripts/kconfig/POTFILES.in \ | ||
| 30 | -o scripts/kconfig/linux.pot | ||
| 31 | scripts/kconfig/kxgettext arch/$(ARCH)/Kconfig >> scripts/kconfig/linux.pot | ||
| 32 | |||
| 26 | .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig | 33 | .PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig |
| 27 | 34 | ||
| 28 | randconfig: $(obj)/conf | 35 | randconfig: $(obj)/conf |
| @@ -72,9 +79,10 @@ help: | |||
| 72 | # Based on GTK which needs to be installed to compile it | 79 | # Based on GTK which needs to be installed to compile it |
| 73 | # object files used by all kconfig flavours | 80 | # object files used by all kconfig flavours |
| 74 | 81 | ||
| 75 | hostprogs-y := conf mconf qconf gconf | 82 | hostprogs-y := conf mconf qconf gconf kxgettext |
| 76 | conf-objs := conf.o zconf.tab.o | 83 | conf-objs := conf.o zconf.tab.o |
| 77 | mconf-objs := mconf.o zconf.tab.o | 84 | mconf-objs := mconf.o zconf.tab.o |
| 85 | kxgettext-objs := kxgettext.o zconf.tab.o | ||
| 78 | 86 | ||
| 79 | ifeq ($(MAKECMDGOALS),xconfig) | 87 | ifeq ($(MAKECMDGOALS),xconfig) |
| 80 | qconf-target := 1 | 88 | qconf-target := 1 |
| @@ -107,7 +115,7 @@ HOSTLOADLIBES_gconf = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --libs` | |||
| 107 | HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ | 115 | HOSTCFLAGS_gconf.o = `pkg-config gtk+-2.0 gmodule-2.0 libglade-2.0 --cflags` \ |
| 108 | -D LKC_DIRECT_LINK | 116 | -D LKC_DIRECT_LINK |
| 109 | 117 | ||
| 110 | $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o: $(obj)/zconf.tab.h | 118 | $(obj)/conf.o $(obj)/mconf.o $(obj)/qconf.o $(obj)/gconf.o $(obj)/kxgettext: $(obj)/zconf.tab.h |
| 111 | 119 | ||
| 112 | $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped | 120 | $(obj)/zconf.tab.h: $(src)/zconf.tab.h_shipped |
| 113 | $(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped | 121 | $(obj)/zconf.tab.c: $(src)/zconf.tab.c_shipped |
diff --git a/scripts/kconfig/POTFILES.in b/scripts/kconfig/POTFILES.in new file mode 100644 index 000000000000..cc94e46a79e8 --- /dev/null +++ b/scripts/kconfig/POTFILES.in | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | scripts/kconfig/mconf.c | ||
| 2 | scripts/kconfig/conf.c | ||
| 3 | scripts/kconfig/confdata.c | ||
| 4 | scripts/kconfig/gconf.c | ||
| 5 | scripts/kconfig/qconf.cc | ||
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index a494d1aeb9f9..70e7264c6942 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c | |||
| @@ -34,7 +34,7 @@ static int conf_cnt; | |||
| 34 | static signed char line[128]; | 34 | static signed char line[128]; |
| 35 | static struct menu *rootEntry; | 35 | static struct menu *rootEntry; |
| 36 | 36 | ||
| 37 | static char nohelp_text[] = "Sorry, no help available for this option yet.\n"; | 37 | static char nohelp_text[] = N_("Sorry, no help available for this option yet.\n"); |
| 38 | 38 | ||
| 39 | static void strip(signed char *str) | 39 | static void strip(signed char *str) |
| 40 | { | 40 | { |
| @@ -56,9 +56,9 @@ static void strip(signed char *str) | |||
| 56 | static void check_stdin(void) | 56 | static void check_stdin(void) |
| 57 | { | 57 | { |
| 58 | if (!valid_stdin && input_mode == ask_silent) { | 58 | if (!valid_stdin && input_mode == ask_silent) { |
| 59 | printf("aborted!\n\n"); | 59 | printf(_("aborted!\n\n")); |
| 60 | printf("Console input/output is redirected. "); | 60 | printf(_("Console input/output is redirected. ")); |
| 61 | printf("Run 'make oldconfig' to update configuration.\n\n"); | 61 | printf(_("Run 'make oldconfig' to update configuration.\n\n")); |
| 62 | exit(1); | 62 | exit(1); |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| @@ -470,7 +470,7 @@ static void check_conf(struct menu *menu) | |||
| 470 | if (sym) { | 470 | if (sym) { |
| 471 | if (sym_is_changable(sym) && !sym_has_value(sym)) { | 471 | if (sym_is_changable(sym) && !sym_has_value(sym)) { |
| 472 | if (!conf_cnt++) | 472 | if (!conf_cnt++) |
| 473 | printf("*\n* Restart config...\n*\n"); | 473 | printf(_("*\n* Restart config...\n*\n")); |
| 474 | rootEntry = menu_get_parent_menu(menu); | 474 | rootEntry = menu_get_parent_menu(menu); |
| 475 | conf(rootEntry); | 475 | conf(rootEntry); |
| 476 | } | 476 | } |
| @@ -504,7 +504,7 @@ int main(int ac, char **av) | |||
| 504 | input_mode = set_default; | 504 | input_mode = set_default; |
| 505 | defconfig_file = av[i++]; | 505 | defconfig_file = av[i++]; |
| 506 | if (!defconfig_file) { | 506 | if (!defconfig_file) { |
| 507 | printf("%s: No default config file specified\n", | 507 | printf(_("%s: No default config file specified\n"), |
| 508 | av[0]); | 508 | av[0]); |
| 509 | exit(1); | 509 | exit(1); |
| 510 | } | 510 | } |
| @@ -530,7 +530,7 @@ int main(int ac, char **av) | |||
| 530 | } | 530 | } |
| 531 | name = av[i]; | 531 | name = av[i]; |
| 532 | if (!name) { | 532 | if (!name) { |
| 533 | printf("%s: Kconfig file missing\n", av[0]); | 533 | printf(_("%s: Kconfig file missing\n"), av[0]); |
| 534 | } | 534 | } |
| 535 | conf_parse(name); | 535 | conf_parse(name); |
| 536 | //zconfdump(stdout); | 536 | //zconfdump(stdout); |
| @@ -547,12 +547,12 @@ int main(int ac, char **av) | |||
| 547 | break; | 547 | break; |
| 548 | case ask_silent: | 548 | case ask_silent: |
| 549 | if (stat(".config", &tmpstat)) { | 549 | if (stat(".config", &tmpstat)) { |
| 550 | printf("***\n" | 550 | printf(_("***\n" |
| 551 | "*** You have not yet configured your kernel!\n" | 551 | "*** You have not yet configured your kernel!\n" |
| 552 | "***\n" | 552 | "***\n" |
| 553 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" | 553 | "*** Please run some configurator (e.g. \"make oldconfig\" or\n" |
| 554 | "*** \"make menuconfig\" or \"make xconfig\").\n" | 554 | "*** \"make menuconfig\" or \"make xconfig\").\n" |
| 555 | "***\n"); | 555 | "***\n")); |
| 556 | exit(1); | 556 | exit(1); |
| 557 | } | 557 | } |
| 558 | case ask_all: | 558 | case ask_all: |
| @@ -576,7 +576,7 @@ int main(int ac, char **av) | |||
| 576 | check_conf(&rootmenu); | 576 | check_conf(&rootmenu); |
| 577 | } while (conf_cnt); | 577 | } while (conf_cnt); |
| 578 | if (conf_write(NULL)) { | 578 | if (conf_write(NULL)) { |
| 579 | fprintf(stderr, "\n*** Error during writing of the kernel configuration.\n\n"); | 579 | fprintf(stderr, _("\n*** Error during writing of the kernel configuration.\n\n")); |
| 580 | return 1; | 580 | return 1; |
| 581 | } | 581 | } |
| 582 | return 0; | 582 | return 0; |
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c index 1e82ae390a69..2755c459d780 100644 --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c | |||
| @@ -88,9 +88,9 @@ int conf_read(const char *name) | |||
| 88 | name = conf_expand_value(name); | 88 | name = conf_expand_value(name); |
| 89 | in = zconf_fopen(name); | 89 | in = zconf_fopen(name); |
| 90 | if (in) { | 90 | if (in) { |
| 91 | printf("#\n" | 91 | printf(_("#\n" |
| 92 | "# using defaults found in %s\n" | 92 | "# using defaults found in %s\n" |
| 93 | "#\n", name); | 93 | "#\n"), name); |
| 94 | break; | 94 | break; |
| 95 | } | 95 | } |
| 96 | } | 96< | |
