[Rt-commit] rt branch, 4.0/validation-localization, created. rt-4.0.2-196-gee3bf30

Alex Vandiver alexmv at bestpractical.com
Fri Oct 28 17:43:13 EDT 2011


The branch, 4.0/validation-localization has been created
        at  ee3bf30e316e61506c2a96499e8f9b853e5bf940 (commit)

- Log -----------------------------------------------------------------
commit ee3bf30e316e61506c2a96499e8f9b853e5bf940
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Oct 28 17:33:20 2011 -0400

    Do localization where the message is first returned
    
    Otherwise, extract-message-catalog can't determine the string that
    should be localized.
    
    Also, remove the "." from the end of the "Queue already exists." loc
    string, reverting it to the one that was in use prior to 29b1120.

diff --git a/lib/RT/Queue.pm b/lib/RT/Queue.pm
index 73733fc..5f525d0 100644
--- a/lib/RT/Queue.pm
+++ b/lib/RT/Queue.pm
@@ -406,10 +406,7 @@ sub Create {
 
     {
         my ($val, $msg) = $self->ValidateName( $args{'Name'} );
-
-        if (!$val) {
-            return ($val, $self->loc($msg));
-        }
+        return ($val, $msg) unless $val;
     }
 
     if ( $args{'Lifecycle'} && $args{'Lifecycle'} ne 'default' ) {
@@ -543,7 +540,7 @@ sub ValidateName {
 
     #If this queue exists, return undef
     if ( $tempqueue->Name() && $tempqueue->id != $self->id)  {
-        return (undef, "Queue already exists.");
+        return (undef, $self->loc("Queue already exists") );
     }
 
     #If the queue doesn't exist, return 1
@@ -551,7 +548,7 @@ sub ValidateName {
         return ($q);
     }
     else {
-        return (undef, "That's not a valid name.");
+        return (undef, $self->loc("'[_1]' is not a valid name.", $name) );
     }
 
 }

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


More information about the Rt-commit mailing list