[Rt-commit] rt branch, 4.2/message-catalog-extraction, updated. rt-4.1.8-486-g12a425e

Thomas Sibley trs at bestpractical.com
Fri May 24 21:29:10 EDT 2013


The branch, 4.2/message-catalog-extraction has been updated
       via  12a425e5be6c32cc7f32d8a64f21f4010c36612d (commit)
       via  af70c427dbccbac2c67606425d92e76fbea1e3e1 (commit)
      from  7e08d9dcaac05eadb48ff052434545cd7d0391ac (commit)

Summary of changes:
 sbin/rt-message-catalog | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit af70c427dbccbac2c67606425d92e76fbea1e3e1
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri May 24 18:27:23 2013 -0700

    Look in up to two directories deep for translation files
    
    We don't care about the name.  Launchpad's current exports are under
    share/po/*.po.

diff --git a/sbin/rt-message-catalog b/sbin/rt-message-catalog
index b31b58d..443e0a4 100755
--- a/sbin/rt-message-catalog
+++ b/sbin/rt-message-catalog
@@ -209,7 +209,7 @@ sub rosetta {
         die "Is not URL or directory: '$url'";
     }
 
-    my @files = ( <$dir/rt/*.po>, <$dir/*.po> );
+    my @files = ( <$dir/*/*/*.po>, <$dir/*/*.po>, <$dir/*.po> );
     unless ( @files ) {
         print STDERR "No files in $dir/rt/*.po and $dir/*.po\n";
         exit;

commit 12a425e5be6c32cc7f32d8a64f21f4010c36612d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Fri May 24 18:28:01 2013 -0700

    A usage message for rt-message-catalog
    
    Previously this program died trying to display usage().

diff --git a/sbin/rt-message-catalog b/sbin/rt-message-catalog
index 443e0a4..1053fba 100755
--- a/sbin/rt-message-catalog
+++ b/sbin/rt-message-catalog
@@ -63,6 +63,46 @@ my %commands = (
     extract => { },
 );
 
+sub usage {
+    warn @_, "\n\n" if @_;
+    warn <<'    USAGE';
+usages:
+
+    rt-message-catalog stats [po-directory]
+    rt-message-catalog shrink [--no-update] [--keep CLASS] [po-directory]
+    rt-message-catalog clean [--no-update] [po-directory]
+    rt-message-catalog rosetta [--boundary PERCENT] download-url
+    rt-message-catalog extract [po-file ...]
+
+stats: Print stats for each translation.
+
+shrink: Reduce translations, optionally keeping classes of strings.
+
+    --no-update     Just report what could be shrunk.
+    --keep CLASS    Don't remove strings in the specified class:
+                        not-referenced, not-translated, equal
+
+                    May be specified more than once.
+
+clean: Equivalent to `shrink --keep not-translated --keep equal`
+
+rosetta: Merge translations from Launchpad's Rosetta.
+
+    Requires a Launchpad translations export url.
+
+    --boundary PERCENT      Acceptable threshold of percentage of strings
+                            translated.  Translations with less than this are
+                            discarded.  Default is 20.
+
+extract: Extract message catalogs from source code and report common errors.
+
+    If passed a specific translation file, only that file is updated.
+    (Not recommended except for debugging.)
+
+    USAGE
+    exit 1;
+}
+
 my $command = shift;
 usage() unless $command;
 usage("Unknown command '$command'")

-----------------------------------------------------------------------


More information about the Rt-commit mailing list