slartyblartfast (slartyblartfast) wrote in changelog,
slartyblartfast
slartyblartfast
changelog

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

Committer: mchernyshev
LJSUP-4390: Inclusion of messenger-alert to translation system
- some events converted to translateable form.

U   branches/msn/bin/upgrading/en.dat
U   branches/msn/cgi-bin/LJ/Event/Befriended.pm
U   branches/msn/cgi-bin/LJ/Event/CommunityInvite.pm
U   branches/msn/cgi-bin/LJ/Event/CommunityJoinRequest.pm
U   branches/msn/cgi-bin/LJ/Event/InvitedFriendJoins.pm
U   branches/msn/cgi-bin/LJ/Event/JournalNewEntry.pm
U   branches/msn/cgi-bin/LJ/Event.pm
U   branches/msn/cgi-bin/LJ/NotificationMethod/Alerts.pm
Modified: branches/msn/bin/upgrading/en.dat
===================================================================
--- branches/msn/bin/upgrading/en.dat	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/bin/upgrading/en.dat	2009-06-04 07:20:19 UTC (rev 15239)
@@ -1339,6 +1339,10 @@
 
 esn.journal_new_entry.about= titled "[[title]]"
 
+esn.comm_invite.alert=You've been invited to join [[user]]
+
+esn.befriended.alert=[[who]] has added you as a friend.
+
 esn.befriended.subject=[[who]] added you as a friend!
 
 esn.befriended.email_text<<
@@ -1357,6 +1361,8 @@
 You can:
 .
 
+esn.community_join_requst.alert=[[who]] requests membership in [[comm]]. Visit community settings to approve.
+
 esn.defriended.subject=[[who]] removed you from their Friends list
 
 esn.defriended.email_text<<
@@ -1403,6 +1409,8 @@
 
 esn.join_community=[[openlink]]Join [[journal]] to read Members-only entries[[closelink]]
 
+esn.journal_new_entry.alert=[[who]] posted a new entry in [[journal]]!
+
 esn.read_user_entries=[[openlink]]Read [[poster]]'s recent entries[[closelink]]
 
 esn.add_friend=[[openlink]]Add [[journal]] to your Friends list[[closelink]]
@@ -1433,6 +1441,10 @@
 
 esn.if_suport_form=If your mail client supports it, you can also reply here:
 
+esn.invited_friend_joins.alert=A friend you invited has created the journal [[newuser]].
+
+esn.invited_friend_joins.alert.unnamed=A friend you invited has created a journal.
+
 esn.invited_friend_joins.subject=[[who]] created a journal!
 
 esn.invite_another_friend=[[openlink]]Invite another friend[[closelink]]

Modified: branches/msn/cgi-bin/LJ/Event/Befriended.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/Befriended.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event/Befriended.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -23,6 +23,7 @@
     'esn.view_profile',                 # '[[openlink]]View [[postername]]\'s profile[[closelink]]',
     'esn.edit_friends',                 # '[[openlink]]Edit Friends[[closelink]]',
     'esn.edit_groups',                  # '[[openlink]]Edit Friends groups[[closelink]]',
+    'esn.befriended.alert',             # '[[who]] has added you as a friend.',
     'esn.befriended.email_text',        # 'Hi [[user]],
                                         #
                                         #[[poster]] has added you to their Friends list. They will now be able to read your[[entries]] entries on their Friends page.
@@ -131,6 +132,15 @@
                    $self->friend->user, $self->friend->user);
 }
 
+sub as_alert {
+    my $self = shift;
+    my $u = shift;
+    my $friend = $self->friend;
+    return '' unless $friend;
+    return LJ::Lang::get_text($u->prop('browselang'),
+        'esn.befriended.alert', undef, { who => $friend->display_username });
+}
+
 sub subscription_as_html {
     my ($class, $subscr) = @_;
     my $journal = $subscr->journal or croak "No user";

Modified: branches/msn/cgi-bin/LJ/Event/CommunityInvite.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/CommunityInvite.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event/CommunityInvite.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -16,6 +16,7 @@
 sub is_common { 0 }
 
 my @_ml_strings = (
+    'esn.comm_invite.alert',        # "You've been invited to join [[user]]"
     'esn.comm_invite.subject',      # "You've been invited to join [[user]]"
     'esn.comm_invite.email',        # 'Hi [[user]],
                                     #
@@ -133,6 +134,15 @@
                    $self->comm->display_username);
 }
 
+sub as_alert {
+    my $self = shift;
+    my $u = shift;
+    my $friend = $self->friend;
+    return '' unless $friend;
+    return LJ::Lang::get_text($u->prop('browselang'),
+        'esn.comm_invite.alert', undef, { user => $friend->display_username });
+}
+
 sub subscription_as_html {
     my ($class, $subscr) = @_;
     return BML::ml('event.comm_invite'); # "I receive an invitation to join a community";

Modified: branches/msn/cgi-bin/LJ/Event/CommunityJoinRequest.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/CommunityJoinRequest.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event/CommunityJoinRequest.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -71,6 +71,7 @@
 }
 
 my @_ml_strings_en = (
+    'esn.community_join_requst.alert',    # [[who]] requests membership in [[comm]]. Visit community settings to approve.
     'esn.community_join_requst.subject',    # '[[comm]] membership request by [[who]]!',
     'esn.manage_membership_reqs',           # '[[openlink]]Manage [[communityname]]\'s membership requests[[closelink]]',
     'esn.manage_community',                 # '[[openlink]]Manage your communities[[closelink]]',
@@ -141,6 +142,17 @@
                    $self->comm->display_username);
 }
 
+sub as_alert {
+    my $self = shift;
+    my $u = shift;
+    return LJ::Lang::get_text($u->prop('browselang'),
+        'esn.community_join_requst.alert', undef,
+            {
+                who  => $self->requestor->display_username,
+                comm => $self->comm->display_username,
+            });
+}
+
 sub subscription_as_html {
     my ($class, $subscr) = @_;
     return BML::ml('event.community_join_requst'); # Someone requests membership in a community I maintain';

Modified: branches/msn/cgi-bin/LJ/Event/InvitedFriendJoins.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/InvitedFriendJoins.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event/InvitedFriendJoins.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -15,16 +15,18 @@
 sub is_common { 0 }
 
 my @_ml_strings = (
-    'esn.invited_friend_joins.subject', # '[[who]] created a journal!'
-    'esn.add_friend',                   # '[[openlink]]Add [[journal]] to your Friends list[[closelink]]',
-    'esn.read_journal',                 # '[[openlink]]Read [[postername]]\'s journal[[closelink]]',
-    'esn.view_profile',                 # '[[openlink]]View [[postername]]\'s profile[[closelink]]',
-    'esn.invite_another_friend',        # '[[openlink]]Invite another friend[[closelink]]",
-    'esn.invited_friend_joins.email',   # 'Hi [[user]],
-                                        #
-                                        # Your friend [[newuser]] has created a journal on [[sitenameshort]]!
-                                        #
-                                        # You can:'
+    'esn.invited_friend_joins.subject',         # '[[who]] created a journal!'
+    'esn.add_friend',                           # '[[openlink]]Add [[journal]] to your Friends list[[closelink]]',
+    'esn.read_journal',                         # '[[openlink]]Read [[postername]]\'s journal[[closelink]]',
+    'esn.view_profile',                         # '[[openlink]]View [[postername]]\'s profile[[closelink]]',
+    'esn.invite_another_friend',                # '[[openlink]]Invite another friend[[closelink]]',
+    'esn.invited_friend_joins.alert.unnamed',   # 'A friend you invited has created a journal.'
+    'esn.invited_friend_joins.alert',           # 'A friend you invited has created the journal [[newuser]]',
+    'esn.invited_friend_joins.email',           # 'Hi [[user]],
+                                                #
+                                                # Your friend [[newuser]] has created a journal on [[sitenameshort]]!
+                                                #
+                                                # You can:'
 );
 
 sub as_email_subject {
@@ -107,9 +109,13 @@
     return sprintf "A friend you invited has created the journal %s", $self->friend->user;
 }
 
-sub as_sms {
+sub as_alert {
     my $self = shift;
-    return $self->as_string;
+    my $u = shift;
+    my $friend = $self->friend;
+    return LJ::Lang::get_text($u->prop('browselang'),
+        'esn.invited_friend_joins.alert' . ($friend ? '' : '.unnamed'), undef,
+        $friend ? { newuser => $friend->display_username } : {} );
 }
 
 sub friend {

Modified: branches/msn/cgi-bin/LJ/Event/JournalNewEntry.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event/JournalNewEntry.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event/JournalNewEntry.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -85,6 +85,17 @@
             $self->entry->poster->user, $self->entry->journal->user);
 }
 
+sub as_alert {
+    my $self = shift;
+    my $u = shift;
+    return LJ::Lang::get_text($u->prop('browselang'),
+        'esn.journal_new_entry.alert', undef,
+            {
+                who     => $self->entry->poster->display_username,
+                journal => $self->entry->journal->display_username,
+            });
+}
+
 sub as_html {
     my ($self, $target) = @_;
 
@@ -124,6 +135,7 @@
 }
 
 my @_ml_strings_en = (
+    'esn.journal_new_entry.alert',                  # '[[who]] posted a new entry in [[journal]]!',
     'esn.journal_new_entry.posted_new_entry',       # '[[who]] posted a new entry in [[journal]]!',
     'esn.journal_new_entry.updated_their_journal',  # '[[who]] updated their journal!',
     'esn.hi',                                       # 'Hi [[username]],',

Modified: branches/msn/cgi-bin/LJ/Event.pm
===================================================================
--- branches/msn/cgi-bin/LJ/Event.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/Event.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -140,6 +140,11 @@
     return $self->as_string($u);
 }
 
+sub as_alert {
+    my ($self, $u) = @_;
+    return $self->as_string($u);
+}
+
 # plaintext email subject
 sub as_email_subject {
     my ($self, $u) = @_;

Modified: branches/msn/cgi-bin/LJ/NotificationMethod/Alerts.pm
===================================================================
--- branches/msn/cgi-bin/LJ/NotificationMethod/Alerts.pm	2009-06-04 07:01:33 UTC (rev 15238)
+++ branches/msn/cgi-bin/LJ/NotificationMethod/Alerts.pm	2009-06-04 07:20:19 UTC (rev 15239)
@@ -72,7 +72,7 @@
     
     foreach my $ev (@events) {
         croak "invalid event passed" unless ref $ev;
-        my $msg = $ev->as_im($u);
+        my $msg = $ev->as_alert($u);
 
         # send data to comet server
         my $rec = LJ::Comet::History->add(

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