From 23e188f2260f60e05cc7c33b029440db2253a170 Mon Sep 17 00:00:00 2001 From: Petr Viktorin Date: Wed, 20 Jun 2012 06:38:16 -0400 Subject: Arrange stripping .po files The .po files we use for translations have two shortcomings when used in Git: - They include file locations, which change each time the source is updated. This results in large, unreadable diffs that don't merge well. - They include source strings for untranslated messages, wasting space unnecessarily. Update the Makefile so that the extraneous information is stripped when the files are updated or pulled form Transifex, and empty translation files are removed entirely. Also, translations are normalized to a common style. This should help diffs and merges. The validator requires file location comments to identify the programming language, and to produce good error reports. To make this work, merge the comments in before validation. First patch for: https://fedorahosted.org/freeipa/ticket/2435 --- install/po/README | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'install/po/README') diff --git a/install/po/README b/install/po/README index ada7df40e..6894a0633 100644 --- a/install/po/README +++ b/install/po/README @@ -6,10 +6,17 @@ A: Edit Makefile.in and add the source file to the appropriate *_POTFILES list. NOTE: Now this i only necessary for python files that lack the .py extension. All .py, .c and .h files are automatically sourced. +Q: Untranslated strings and file locations are missing from my .po file. + How do I add them? + +A: make merge-po + Untranslated strings are left out of the files in SCM. The merge-po command + runs msgmerge to add them again. + Q: How do I pick up new strings to translate from the source files after the source have been modified? -A: make update-po +A: make merge-po This regenerates the pot template file by scanning all the source files. Then the new strings are merged into each .po file from the new pot file. @@ -18,6 +25,11 @@ Q: How do I just regenerate the pot template file without regenerating all the A: make update-pot +Q: I am done translating. How do I commit my changes? + +A: Run `make strip-po` to remove unneeded information from the po files, then + add your changes to SCM. + Q: How do I add a new language for translation? A: Edit the LINGUAS file and add the new language. Then run "make create-po". @@ -27,7 +39,7 @@ A: Edit the LINGUAS file and add the new language. Then run "make create-po". http://www.gnu.org/software/hello/manual/gettext/Plural-forms.html However, if this line is wrong, it is often an indicator that the locale value is incorrect. For example, using 'jp' for Japanese in stead of 'ja' - will result in an invailid Plural's line. + will result in an invalid Plurals line. Q: What files must be under source code control? -- cgit