Commit b70e325c authored by Sam Ravnborg's avatar Sam Ravnborg

kconfig: fix update-po-config

Massimo Maiurana <maiurana@gmail.com> reported that
update-po-config was broken:
1) spelling errors in Makefile so arch/um failed
2) UTF-8 was not supported

The following patch address the above problems.
kxgettext now append the output to the .pot file
generated by xgettext - so we have a header.
In all places UFT-8 is specifed so we now flawlessly
support UTF-8.
The Kconfig files had an empty string in a few cases -
these are now supressed in kxgettext.

With this the translators can now pick up where they left
and get it all translated.
There are ~11000 strings to be translated...
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc:  Massimo Maiurana <maiurana@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
parent 4c6f2eb9
...@@ -22,24 +22,25 @@ oldconfig: $(obj)/conf ...@@ -22,24 +22,25 @@ oldconfig: $(obj)/conf
silentoldconfig: $(obj)/conf silentoldconfig: $(obj)/conf
$< -s arch/$(ARCH)/Kconfig $< -s arch/$(ARCH)/Kconfig
# Create new linux.po file
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
# The symlink is used to repair a deficiency in arch/um
update-po-config: $(obj)/kxgettext update-po-config: $(obj)/kxgettext
xgettext --default-domain=linux \ xgettext --default-domain=linux \
--add-comments --keyword=_ --keyword=N_ \ --add-comments --keyword=_ --keyword=N_ \
--files-from=scripts/kconfig/POTFILES.in \ --from-code=UTF-8 \
--output scripts/kconfig/config.pot --files-from=scripts/kconfig/POTFILES.in \
$(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch --output $(obj)/config.pot
$(Q)for i in `ls arch/`; \ $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
do \ $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch
scripts/kconfig/kxgettext arch/$$i/Kconfig \ (for i in `ls arch/`; \
| msguniq -o scripts/kconfig/linux_$${i}.pot; \ do \
done $(obj)/kxgettext arch/$$i/Kconfig; \
$(Q)msgcat scripts/kconfig/config.pot \ done ) >> $(obj)/config.pot
`find scripts/kconfig/ -type f -name linux_*.pot` \ msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
--output scripts/kconfig/linux_raw.pot --output $(obj)/linux.pot
$(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \ $(Q)rm -f arch/um/Kconfig.arch
--output scripts/kconfig/linux.pot $(Q)rm -f $(obj)/config.pot
$(Q)rm -f arch/um/Kconfig_arch
$(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
......
...@@ -212,7 +212,9 @@ void menu__xgettext(void) ...@@ -212,7 +212,9 @@ void menu__xgettext(void)
struct message *m = message__list; struct message *m = message__list;
while (m != NULL) { while (m != NULL) {
message__print_gettext_msgid_msgstr(m); /* skip empty lines ("") */
if (strlen(m->msg) > sizeof("\"\""))
message__print_gettext_msgid_msgstr(m);
m = m->next; m = m->next;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment