[Rt-commit] rt branch, 4.2/placeholder-mismatch, updated. rt-4.0.0rc7-254-g4f595c7

Shawn Moore sartak at bestpractical.com
Fri May 20 14:13:38 EDT 2011


The branch, 4.2/placeholder-mismatch has been updated
       via  4f595c73a6c6c42aa7d75564694f53849d72fc41 (commit)
      from  a9c0032f5fe8fbaef2e1a018f162ab878a3df5ff (commit)

Summary of changes:
 devel/extract-message-catalog |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 4f595c73a6c6c42aa7d75564694f53849d72fc41
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri May 20 14:13:08 2011 -0400

    Better name validate_msgstr and internalize its skip-this-string logic

diff --git a/devel/extract-message-catalog b/devel/extract-message-catalog
index 5b07885..b2dace9 100755
--- a/devel/extract-message-catalog
+++ b/devel/extract-message-catalog
@@ -320,8 +320,7 @@ sub update {
         $Lexicon{$msgid} = $msgstr;
         $Header{$msgid}  = $msghdr;
 
-        complain_about_placeholder_mismatch($lang, $msgid, $msgstr)
-            unless $msgstr eq '';
+        validate_msgstr($lang, $msgid, $msgstr);
     }
 
     my $is_english = ( $lang =~ /^en(?:[^A-Za-z]|$)/ );
@@ -370,11 +369,14 @@ sub update {
     return 1;
 }
 
-sub complain_about_placeholder_mismatch {
+sub validate_msgstr {
     my $lang   = shift;
     my $msgid  = shift;
     my $msgstr = shift;
 
+    return if $msgstr eq ''; # no translation for this string
+    return if $msgid eq '';  # special case: po file metadata
+
     # we uniq because a string can use a placeholder more than once
     # (eg %1 %quant(%1, ...) like in our czech localization
     my @expected_variables = uniq($msgid =~ /%\d+/g);

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


More information about the Rt-commit mailing list