[dw-free] English-strip inbox/compose.bml
[commit: http://hg.dwscoalition.org/dw-free/rev/cb38b75a9ac5]
http://bugs.dwscoalition.org/show_bug.cgi?id=1528
Inbox, translated
Patch by
chemicallace.
Files modified:
http://bugs.dwscoalition.org/show_bug.cgi?id=1528
Inbox, translated
Patch by
![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Files modified:
- htdocs/inbox/compose.bml
- htdocs/inbox/compose.bml.text
-------------------------------------------------------------------------------- diff -r 65259cb4c6ff -r cb38b75a9ac5 htdocs/inbox/compose.bml --- a/htdocs/inbox/compose.bml Wed Aug 05 07:19:18 2009 +0000 +++ b/htdocs/inbox/compose.bml Wed Aug 05 08:14:14 2009 +0000 @@ -11,7 +11,7 @@ body<= LJ::JSUtil ); - return "User messaging is currently disabled" unless LJ::is_enabled('user_messaging'); + return $ML{'.messaging.disabled'} unless LJ::is_enabled( 'user_messaging' ); my $remote = LJ::get_remote() or return "<?needlogin?>"; my $remote_id = $remote->{'userid'}; @@ -48,16 +48,17 @@ body<= if ($mode eq 'send') { # test encoding my $msg_subject_text = $POST{'msg_subject'}; - push @errors, "Invalid text encoding for message subject" + push @errors, $ML{'.error.text.encoding.subject'} unless LJ::text_in($msg_subject_text); # test encoding and length my $msg_body_text = $POST{'msg_body'}; - push @errors, "Invalid text encoding for message body" + push @errors, $ML{'.error.text.encoding.text'} unless LJ::text_in($msg_body_text); my ($msg_len_b, $msg_len_c) = LJ::text_length($msg_body_text); - push @errors, "Message body is too long (" . LJ::commafy($msg_len_c) - . " characters). It should not exceed " . LJ::commafy($msg_limit) . " characters." + push @errors, BML::ml( ".error.message.length", + { msg_length => LJ::commafy( $msg_len_c ), + => msg_limit -> LJ::commafy( $msg_limit ) } ) unless ($msg_len_c <= $msg_limit); # Get list of recipients @@ -70,32 +71,34 @@ body<= my @msg_list; # must be at least one username - push @errors, "Please enter a valid username" unless (scalar(@to_list) > 0); + push @errors, $ML{'.error.no.username'} unless ( scalar( @to_list ) > 0 ); # Check each user being sent a message foreach my $to (@to_list) { # Check the To field my $tou = LJ::load_user($to); unless ($tou) { - push @errors, "\"$to\" is not a valid username"; + push @errors, BML::ml( '.error.invalid.username', + { to => $to } ); next; } # Can only send to other individual users unless ($tou->is_person || $tou->is_identity || $tou->is_renamed) { - push @errors, BML::ml('error.message.individual', { 'ljuser' => $tou->ljuser_display }); + push @errors, BML::ml( 'error.message.individual', { ljuser => $tou->ljuser_display } ); next; } # Can't send to unvalidated users unless ($tou->is_validated) { - push @errors, BML::ml('error.message.unvalidated', { 'ljuser' => $tou->ljuser_display }); + push @errors, BML::ml( 'error.message.unvalidated', + { ljuser => $tou->ljuser_display } ); next; } # Will target user accept messages from sender unless ($tou->can_receive_message($remote)) { - push @errors, BML::ml('error.message.canreceive', { 'ljuser' => $tou->ljuser_display }); + push @errors, BML::ml( 'error.message.canreceive', { ljuser => $tou->ljuser_display } ); next; } @@ -115,7 +118,7 @@ body<= my $up; $up = LJ::run_hook('upgrade_message', $remote, 'message'); $up = "<br />$up" if ($up); - push @errors, "This message will exceed your limit and cannot be sent.$up" + push @errors, BML::ml( ".error.rate.limit", { up => $up } ) unless LJ::Message::ratecheck_multi(userid => $remote_id, msg_list => \@msg_list) } @@ -133,11 +136,11 @@ body<= } unless (@errors) { - $body .= "Your message has been sent successfully."; - $body .= "<?p From here you can:<ul>"; - $body .= "<li><a href='$LJ::SITEROOT/inbox/compose'>Send a new message</a></li>"; - $body .= "<li><a href='$LJ::SITEROOT/inbox/'>Return to Inbox</a></li>"; - $body .= "<li><a href='$LJ::SITEROOT/'>Return Home</a></li>"; + $body .= $ML{'.message.sent'}; + $body .= "<?p $ML{'.message.sent.options'} <ul>"; + $body .= "<li><a href='$LJ::SITEROOT/inbox/compose'>$ML{'.link.send.message'}</a></li>"; + $body .= "<li><a href='$LJ::SITEROOT/inbox/'>$ML{'.link.inbox'}</a><li>"; + $body .= "<li><a href='$LJ::SITEROOT/'>$ML{'.link.home'}</a></li>"; $body .= "</ul> p?>\n"; return $body; } @@ -154,7 +157,7 @@ body<= next unless $msgid; my $msg = LJ::Message->load({msgid => $msgid, journalid => $remote_id}); - push @errors, "You cannot reply to this message" + push @errors, $ML{'.error.cannot.reply'} unless ($msg->can_reply($msgid, $remote_id)); if (@errors) { diff -r 65259cb4c6ff -r cb38b75a9ac5 htdocs/inbox/compose.bml.text --- a/htdocs/inbox/compose.bml.text Wed Aug 05 07:19:18 2009 +0000 +++ b/htdocs/inbox/compose.bml.text Wed Aug 05 08:14:14 2009 +0000 @@ -1,5 +1,31 @@ ;; -*- coding: utf-8 -*- + +.error.cannot.reply=You cannot reply to this message + +.error.invalid.username="[[to]]" is not a valid username + +.error.message.length=Message body is too long ([[msg_length]] characters). It should not exceed [[msg_limit]] characters. + +.error.no.username=Please enter a valid username + +.error.rate.limit=This message will exceed your limit and cannot be sent.[[up]] + +.error.text.encoding.subject=Invalid text encoding for message subject + +.error.text.encoding.text=Invalid text encoding for message text .form.label.cc=Send me a copy of my own message +.link.home=Return Home + +.link.inbox=Return to Inbox + +.link.send.message=Send a new message + +.message.sent=Your message has been sent successfully. + +.message.sent.options=From here you can: + +.messaging.disabled=User messaging is currently disabled + .suspended.cannot.send=Suspended accounts are not allowed to send private messages --------------------------------------------------------------------------------