Translatable strings have certain requirements for proper translation
and run time behaviour. We should routinely validate those strings. A
recent checkin to install/po/test_i18n.py makes it possible to validate
the contents of our current pot file by searching for problematic strings.

However, we only occasionally generate a new pot file, far less
frequently than translatable strings change in the source base. Just
like other checkin's to the source which are tested for correctness we
should also validate new or modified translation strings when they are
introduced and not accumulate problems to fix at the last minute. This
would also raise the awareness of developers as to the requirements for
proper string translation.

The top level Makefile should be enhanced to create a temporary pot
files from the current sources and validate it. We need to use a
temporary pot file because we do not want to modify the pot file under
source code control and exported to Transifex.

--
John Dennis <jden...@redhat.com>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
>From b8c85678fd8ec0aabc23a795610c438f0fb667b6 Mon Sep 17 00:00:00 2001
From: John Dennis <jden...@redhat.com>
Date: Tue, 27 Mar 2012 15:54:38 -0400
Subject: [PATCH 70] validate i18n strings when running "make lint"
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

* add target validate-src-strings that invokes validation
  in install/po

* add validate-src-strings as dependency to lint targett

* remove obsolete test_lang frm test target
---
 Makefile               |   11 +++++++----
 install/po/Makefile.in |   10 +++++++++-
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 07abf6f..adf9265 100644
--- a/Makefile
+++ b/Makefile
@@ -88,11 +88,14 @@ client-dirs:
 		echo "Without those directories ipa-client-install will fail" ; \
 	fi
 
-lint:
+lint: validate-src-strings
 	./make-lint $(LINT_OPTIONS)
 
+validate-src-strings:
+	$(MAKE) -C install/po validate-src-strings
+
+
 test:
-	$(MAKE) -C install/po test_lang
 	./make-testcert
 	./make-test
 
@@ -120,12 +123,12 @@ version-update: release-update
 		ipa-client/ipa-client.spec.in > ipa-client/ipa-client.spec
 	sed -e s/__VERSION__/$(IPA_VERSION)/ ipa-client/version.m4.in \
 		> ipa-client/version.m4
-	
+
 	if [ "$(SUPPORTED_PLATFORM)" != "" ]; then \
 		sed -e s/SUPPORTED_PLATFORM/$(SUPPORTED_PLATFORM)/ ipapython/services.py.in \
 			> ipapython/services.py; \
 	fi
-	
+
 	if [ "$(SKIP_API_VERSION_CHECK)" != "yes" ]; then \
 		./makeapi --validate; \
 	fi
diff --git a/install/po/Makefile.in b/install/po/Makefile.in
index 02561ed..37462bd 100644
--- a/install/po/Makefile.in
+++ b/install/po/Makefile.in
@@ -158,7 +158,7 @@ install: $(mo_files)
 	done
 
 mostlyclean:
-	rm -rf *.mo test.po test_locale
+	rm -rf *.mo test.po test_locale tmp.pot
 	rm -f $(DOMAIN).pot.update $(DOMAIN).pot.update.tmp $(DOMAIN).pot.tmp
 
 clean: mostlyclean
@@ -177,6 +177,14 @@ validate-pot:
 validate-po:
 	$(IPA_TEST_I18N) --show-strings --validate-po $(po_files)
 
+validate-src-strings:
+	@rm -f tmp.pot
+	@touch tmp.pot
+	@$(MAKE) DOMAIN=tmp update-pot; \
+	status=$$?; \
+	rm tmp.pot; \
+	exit $$status
+
 debug:
 	@echo Python potfiles:
 	@echo PY_FILES = $(PY_FILES)
-- 
1.7.7.6

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to