slartyblartfast (slartyblartfast) wrote in changelog,
slartyblartfast
slartyblartfast
changelog

[livejournal] r15278: LJSUP-4390: Inclusion of messenger-alert...

Committer: mchernyshev
LJSUP-4390: Inclusion of messenger-alert to translation system
- official posts (and inherited from it sup official posts).

U   branches/msn/bin/upgrading/en.dat
U   branches/msn/cgi-bin/LJ/Event/OfficialPost.pm
Modified: branches/msn/bin/upgrading/en.dat
===================================================================
--- branches/msn/bin/upgrading/en.dat	2009-06-10 10:32:17 UTC (rev 15277)
+++ branches/msn/bin/upgrading/en.dat	2009-06-11 03:16:47 UTC (rev 15278)
@@ -1317,6 +1317,10 @@
 This letter was sent out automatically to help you keep your account secure. You cannot opt-out of receiving these letters.
 .
 
+esn.officialpost.alert=There is a new [[sitenameabbrev]] announcement in [[username]]. Reply with READ [[username]] to read it. Standard rates apply.
+
+esn.supofficialpost.alert=There is a new [[sitenameabbrev]] announcement in [[username]]. Reply with READ [[username]] to read it. Standard rates apply.
+
 esn.supofficialpost.subject=[[sitenameshort]] Announcement: [[subject]]
 
 esn.supofficialpost.nosubject=[[sitenameshort]] Announcement: New [[username]] announcement

Modified: branches/msn/cgi-bin/LJ/Event/OfficialPost.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/OfficialPost.pm	2009-06-10 10:32:17 UTC (rev 15277)
+++ branches/msn/cgi-bin/LJ/Event/OfficialPost.pm	2009-06-11 03:16:47 UTC (rev 15278)
@@ -114,8 +114,8 @@
             siteroot        => $LJ::SITEROOT,
             sitename        => $LJ::SITENAME,
             sitenameshort   => $LJ::SITENAMESHORT,
-            subject         => $self->entry->subject_text || '',
-            username        => $self->entry->journal->display_username,
+            subject         => $entry->subject_text || '',
+            username        => $entry->journal->display_username,
             url             => $entry->url,
         });
 }
@@ -128,6 +128,29 @@
                    $entry->journal->display_username, $entry->journal->display_username);
 }
 
+# esn.officialpost.alert=There is a new [[sitenameabbrev]] announcement in [[username]]. Reply with READ [[username]] to read it. Standard rates apply.
+# esn.supofficialpost.alert=There is a new [[sitenameabbrev]] announcement in [[username]]. Reply with READ [[username]] to read it. Standard rates apply.
+
+sub as_alert {
+    my $self = shift;
+    my $u = shift;
+    my $entry = $self->entry or return "(Invalid entry)";
+
+    return LJ::Lang::get_text(
+        $u->prop("browselang"),
+        _construct_prefix($self) . '.alert',
+        undef,
+        {
+            siteroot        => $LJ::SITEROOT,
+            sitename        => $LJ::SITENAME,
+            sitenameshort   => $LJ::SITENAMESHORT,
+            sitenameabbrev  => $LJ::SITENAMEABBREV,
+            subject         => $entry->subject_text || '',
+            username        => $entry->journal->display_username,
+            url             => $entry->url,
+        });
+}
+
 sub subscription_as_html {
     my ($class, $subscr) = @_;
     return BML::ml('event.officialpost', { sitename => $LJ::SITENAME }); # $LJ::SITENAME makes a new announcement

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