From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932968AbXGQOKi (ORCPT ); Tue, 17 Jul 2007 10:10:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1762101AbXGQOH5 (ORCPT ); Tue, 17 Jul 2007 10:07:57 -0400 Received: from pasmtpb.tele.dk ([80.160.77.98]:35926 "EHLO pasmtpB.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760811AbXGQOHu (ORCPT ); Tue, 17 Jul 2007 10:07:50 -0400 From: Sam Ravnborg To: linux-kernel@vger.kernel.org Cc: Sam Ravnborg Subject: [PATCH 10/33] kconfig: fix update-po-config Date: Tue, 17 Jul 2007 16:08:39 +0200 Message-Id: <1184681343297-git-send-email-sam@ravnborg.org> X-Mailer: git-send-email 1.5.0.6 In-Reply-To: <11846813432249-git-send-email-sam@ravnborg.org> References: 20070717140622.GA25846@uranus.ravnborg.org <11846813423231-git-send-email-sam@ravnborg.org> <11846813432423-git-send-email-sam@ravnborg.org> <1184681343138-git-send-email-sam@ravnborg.org> <11846813433593-git-send-email-sam@ravnborg.org> <11846813432300-git-send-email-sam@ravnborg.org> <11846813432072-git-send-email-sam@ravnborg.org> <11846813431389-git-send-email-sam@ravnborg.org> <1184681343412-git-send-email-sam@ravnborg.org> <11846813432249-git-send-email-sam@ravnborg.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Massimo Maiurana 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: Sam Ravnborg Cc: Massimo Maiurana Cc: Arnaldo Carvalho de Melo --- scripts/kconfig/Makefile | 35 ++++++++++++++++++----------------- scripts/kconfig/kxgettext.c | 4 +++- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index fb2bb30..8986a48 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -22,24 +22,25 @@ oldconfig: $(obj)/conf silentoldconfig: $(obj)/conf $< -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 - xgettext --default-domain=linux \ - --add-comments --keyword=_ --keyword=N_ \ - --files-from=scripts/kconfig/POTFILES.in \ - --output scripts/kconfig/config.pot - $(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch - $(Q)for i in `ls arch/`; \ - do \ - scripts/kconfig/kxgettext arch/$$i/Kconfig \ - | msguniq -o scripts/kconfig/linux_$${i}.pot; \ - done - $(Q)msgcat scripts/kconfig/config.pot \ - `find scripts/kconfig/ -type f -name linux_*.pot` \ - --output scripts/kconfig/linux_raw.pot - $(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \ - --output scripts/kconfig/linux.pot - $(Q)rm -f arch/um/Kconfig_arch - $(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot + xgettext --default-domain=linux \ + --add-comments --keyword=_ --keyword=N_ \ + --from-code=UTF-8 \ + --files-from=scripts/kconfig/POTFILES.in \ + --output $(obj)/config.pot + $(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot + $(Q)ln -fs Kconfig.i386 arch/um/Kconfig.arch + (for i in `ls arch/`; \ + do \ + $(obj)/kxgettext arch/$$i/Kconfig; \ + done ) >> $(obj)/config.pot + msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \ + --output $(obj)/linux.pot + $(Q)rm -f arch/um/Kconfig.arch + $(Q)rm -f $(obj)/config.pot PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c index abee55c..11f7dab 100644 --- a/scripts/kconfig/kxgettext.c +++ b/scripts/kconfig/kxgettext.c @@ -212,7 +212,9 @@ void menu__xgettext(void) struct message *m = message__list; 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; } } -- 1.5.0.6