[Kimchi-devel] [PATCH] add a make check-local command to verify the i18n string format

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Thu Mar 27 09:37:48 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

When I do i18n translation, I find some string format are wrong.
So I add a check-local command to help the developer to check their
string format.

Every developers please run this command before submit your patch.
Thanks.

After you run this command, it may report some invalid string formats.
$ make -C src/kimchi/ check-local
check the invalid string format:
    "KCHREPOS0018E": _("Could not write repository configuration file
%(repo_file)"),

You should check %(repo_file) is what you want.

Ref:
http://docs.python.org/2/library/string.html

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
---
 src/kimchi/Makefile.am | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/kimchi/Makefile.am b/src/kimchi/Makefile.am
index 957d2c9..cec705a 100644
--- a/src/kimchi/Makefile.am
+++ b/src/kimchi/Makefile.am
@@ -29,6 +29,10 @@ EXTRA_DIST = \
 
 kimchidir = $(pythondir)/kimchi
 
+check-local:
+	@echo "check the invalid string format:"
+	@grep -P "%\([^\)]*?\)[^0-9\.bcdeEfgGnosxX%]" i18n.py
+
 install-data-local:
 	$(MKDIR_P) $(DESTDIR)$(kimchidir)
 	$(INSTALL_DATA) API.json $(DESTDIR)$(kimchidir)/API.json
-- 
1.8.5.3




More information about the Kimchi-devel mailing list