sunnyman's (sunnyman) wrote in changelog,
sunnyman's
sunnyman
changelog

[ljcom] r11908: LJSUP-12059: Add region name into all no...

Committer: vtroitsky
LJSUP-12059: Add region name into all notification messages
U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Pay/SelfPromo.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2012-05-05 15:38:34 UTC (rev 11907)
+++ trunk/bin/upgrading/en_LJ.dat	2012-05-10 08:30:14 UTC (rev 11908)
@@ -7574,6 +7574,12 @@
 
 selfpromo.journal.shop_item.name=Promotion of the <a href="[[object_url]]">journal</a>
 
+selfpromo.region.cyr=Cyrillic
+
+selfpromo.region.noncyr=Common
+
+selfpromo.region.ua=Ukraine
+
 selfpromo.shop_item.type=Self Promo service
 
 service_page_reskining.xbox.url=http://sixapart.adbureau.net/adclick/CID=000016fb0000000000000000

Modified: trunk/cgi-bin/LJ/Pay/SelfPromo.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-05-05 15:38:34 UTC (rev 11907)
+++ trunk/cgi-bin/LJ/Pay/SelfPromo.pm	2012-05-10 08:30:14 UTC (rev 11908)
@@ -504,6 +504,8 @@
         return LJ::Lang::get_text( $lang, $code, undef, $params );
     };
 
+    my $region_str = $ml->('selfpromo.region.'.$slot->region);
+
     my $object_type = $slot->type;
 
     my $type = $item->get_prop('selfpromo_type'); # action type
@@ -622,15 +624,16 @@
        # $item->set_subitem(join('-', ($slot->slot_id, $new_promotion->promoid)));
        # $item->save();
 
-        $email_subject = $ml->("selfpromo.$object_type.notification.activate.subject");
+        $email_subject = $ml->("selfpromo.$object_type.notification.activate.subject", { region => $region_str });
  
         LJ::Pay::SelfPromo->debug_msg("generating the emails");
         # Need to send second email if object owner and recipient are different
         unless ( LJ::u_equals($owner, $rcpt_u) ) {
             $email_body = $ml->(
                 "selfpromo.$object_type.notification.activate.body",
-                {   'user'    => $owner->display_name,
-                    'object_url' => $object_url,
+                {   'user'          => $owner->display_name,
+                    'object_url'    => $object_url,
+                    'region'        => $region_str,
                 },
             );
 
@@ -646,8 +649,9 @@
 
         $email_body = $ml->(
             "selfpromo.$object_type.notification.activate.body",
-            {   'user'    => $rcpt_u->display_name,
-                'object_url' => $object_url,
+            {   'user'          => $rcpt_u->display_name,
+                'object_url'    => $object_url,
+                'region'        => $region_str,
             },
         );
     }
@@ -657,12 +661,13 @@
         # gets notified that everything was cancelled
         # successfully
 
-        $email_subject = $ml->("selfpromo.$object_type.notification.admin_cancel.subject");
+        $email_subject = $ml->("selfpromo.$object_type.notification.admin_cancel.subject", { region => $region_str });
 
         $email_body = $ml->(
             "selfpromo.$object_type.notification.admin_cancel.body",
-            {   'user'     => $rcpt_u->display_name,
-                'object_url' => $current_promotion ? $object_url : '',
+            {   'user'          => $rcpt_u->display_name,
+                'object_url'    => $current_promotion ? $object_url : '',
+                'region'        => $region_str,
             },
         );
     }
@@ -2039,6 +2044,12 @@
     }
 
     my $lang = $user->prop('browselang') || $LJ::DEFAULT_LANG;
+
+    
+    my $region = $slot->region;
+    $region = LJ::Lang::get_text( $lang, 'selfpromo.region.'.$region);
+    $ml_params{'region'} = $region;
+
     my $subject =
         LJ::Lang::get_text( $lang, "$ml_var.subject", undef,
         \%ml_params, );

Tags: dat, ljcom, pm, sunnyman, vtroitsky
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments