From 14456cbbb2b8f9266eb5ca13acff77e6b6699ac2 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Wed, 30 Mar 2011 22:30:23 +0200 Subject: [PATCH] Fix gettext domain for messages in plugins "_()" to "_m()". Some other i18n and L10n updates, too. i18n/L10n review not complete. --- plugins/BitlyUrl/bitlyadminpanelaction.php | 6 +++- plugins/BlogspamNet/BlogspamNetPlugin.php | 6 ++-- plugins/Bookmark/Bookmark.php | 17 ++++++---- plugins/Bookmark/BookmarkPlugin.php | 6 ++-- plugins/Bookmark/bookmarkform.php | 16 ++++----- plugins/Bookmark/bookmarkpopup.php | 2 +- plugins/Bookmark/deliciousbackupimporter.php | 6 ++-- plugins/Bookmark/importbookmarks.php | 2 +- plugins/Bookmark/importdelicious.php | 34 +++++++++---------- plugins/Bookmark/newbookmark.php | 10 +++--- plugins/Bookmark/noticebyurl.php | 6 ++-- plugins/Bookmark/showbookmark.php | 2 +- plugins/Directory/DirectoryPlugin.php | 4 +-- plugins/Directory/actions/userdirectory.php | 8 ++--- plugins/EmailSummary/EmailSummaryPlugin.php | 2 +- .../EmailSummary/useremailsummaryhandler.php | 8 ++--- plugins/Event/EventPlugin.php | 12 ++++--- plugins/Event/Happening.php | 18 +++++----- plugins/Event/RSVP.php | 20 +++++------ plugins/Event/cancelrsvp.php | 12 +++---- plugins/Event/cancelrsvpform.php | 6 ++-- plugins/Event/eventform.php | 32 ++++++++--------- plugins/Event/newevent.php | 22 ++++++------ plugins/Event/newrsvp.php | 10 +++--- plugins/Event/rsvpform.php | 2 +- plugins/Event/showrsvp.php | 2 +- .../lib/extendedprofilewidget.php | 2 +- .../actions/facebooksettings.php | 2 +- .../FollowEveryone/FollowEveryonePlugin.php | 2 +- .../GroupPrivateMessagePlugin.php | 28 +++++++-------- plugins/GroupPrivateMessage/Group_message.php | 6 ++-- .../Group_message_profile.php | 10 +++--- .../Group_privacy_settings.php | 10 +++--- plugins/GroupPrivateMessage/groupinbox.php | 12 +++---- .../groupmessagecommand.php | 2 +- .../GroupPrivateMessage/groupmessageform.php | 6 ++-- .../GroupPrivateMessage/newgroupmessage.php | 14 ++++---- .../GroupPrivateMessage/showgroupmessage.php | 12 +++---- plugins/Irc/IrcPlugin.php | 8 ++--- plugins/Irc/ircmanager.php | 2 +- plugins/LdapCommon/LdapCommon.php | 2 +- plugins/LinkPreview/oembedproxyaction.php | 2 +- plugins/Linkback/LinkbackPlugin.php | 2 +- plugins/ModPlus/remoteprofileaction.php | 2 +- plugins/Mollom/MollomPlugin.php | 2 +- plugins/OStatus/actions/usersalmon.php | 4 +-- plugins/OpenID/finishopenidlogin.php | 10 +++--- plugins/OpenID/openidadminpanel.php | 2 +- plugins/Poll/PollPlugin.php | 2 +- plugins/RSSCloud/LoggingAggregator.php | 2 +- plugins/Recaptcha/RecaptchaPlugin.php | 2 +- .../confirmfirstemail.php | 30 ++++++++-------- plugins/SearchSub/searchsubaction.php | 8 ++--- plugins/SearchSub/searchsubform.php | 2 +- plugins/SearchSub/searchunsubform.php | 2 +- plugins/SubMirror/actions/mirrorsettings.php | 2 +- .../SubscriptionThrottlePlugin.php | 4 +-- plugins/TagSub/tagsubaction.php | 8 ++--- plugins/TagSub/tagsubform.php | 2 +- plugins/TagSub/tagsubsaction.php | 6 ++-- plugins/TagSub/tagunsubform.php | 2 +- plugins/Template/TemplatePlugin.php | 6 ++-- .../TwitterBridge/twitterauthorization.php | 4 +-- plugins/UserFlag/adminprofileflag.php | 4 +-- plugins/UserLimit/UserLimitPlugin.php | 3 +- plugins/WikiHashtags/WikiHashtagsPlugin.php | 8 ++--- plugins/Xmpp/XmppPlugin.php | 5 +-- 67 files changed, 264 insertions(+), 251 deletions(-) diff --git a/plugins/BitlyUrl/bitlyadminpanelaction.php b/plugins/BitlyUrl/bitlyadminpanelaction.php index 05b8e83267..70cb664b84 100644 --- a/plugins/BitlyUrl/bitlyadminpanelaction.php +++ b/plugins/BitlyUrl/bitlyadminpanelaction.php @@ -233,6 +233,10 @@ class BitlyAdminPanelForm extends AdminForm function formActions() { - $this->out->submit('submit', _('Save'), 'submit', null, _m('Save bit.ly settings')); + $this->out->submit('submit', + _m('BUTTON','Save'), + 'submit', + null, + _m('Save bit.ly settings')); } } diff --git a/plugins/BlogspamNet/BlogspamNetPlugin.php b/plugins/BlogspamNet/BlogspamNetPlugin.php index 51a86b4f36..06198e6c54 100644 --- a/plugins/BlogspamNet/BlogspamNetPlugin.php +++ b/plugins/BlogspamNet/BlogspamNetPlugin.php @@ -82,13 +82,13 @@ class BlogspamNetPlugin extends Plugin } else { common_debug("Blogspamnet results = " . $response); if (preg_match('/^ERROR(:(.*))?$/', $response, $match)) { - throw new ServerException(sprintf(_("Error from %s: %s"), $this->baseUrl, $match[2]), 500); + throw new ServerException(sprintf(_m("Error from %1$s: %2$s"), $this->baseUrl, $match[2]), 500); } else if (preg_match('/^SPAM(:(.*))?$/', $response, $match)) { - throw new ClientException(sprintf(_("Spam checker results: %s"), $match[2]), 400); + throw new ClientException(sprintf(_m("Spam checker results: %s"), $match[2]), 400); } else if (preg_match('/^OK$/', $response)) { // don't do anything } else { - throw new ServerException(sprintf(_("Unexpected response from %s: %s"), $this->baseUrl, $response), 500); + throw new ServerException(sprintf(_m("Unexpected response from %1$s: %2$s"), $this->baseUrl, $response), 500); } } return true; diff --git a/plugins/Bookmark/Bookmark.php b/plugins/Bookmark/Bookmark.php index 04cd8dbfa8..9ae4f7cfc6 100644 --- a/plugins/Bookmark/Bookmark.php +++ b/plugins/Bookmark/Bookmark.php @@ -199,7 +199,7 @@ class Bookmark extends Memcached_DataObject $nb = self::getByURL($profile, $url); if (!empty($nb)) { - throw new ClientException(_('Bookmark already exists.')); + throw new ClientException(_m('Bookmark already exists.')); } if (empty($options)) { @@ -209,7 +209,7 @@ class Bookmark extends Memcached_DataObject if (array_key_exists('uri', $options)) { $other = Bookmark::staticGet('uri', $options['uri']); if (!empty($other)) { - throw new ClientException(_('Bookmark already exists.')); + throw new ClientException(_m('Bookmark already exists.')); } } @@ -288,16 +288,19 @@ class Bookmark extends Memcached_DataObject $shortUrl = $url; } - $content = sprintf(_('"%s" %s %s %s'), + // @todo FIXME: i18n documentation. + // TRANS: %1$s is a title, %2$s is a short URL, %3$s is a description, + // TRANS: %4$s is space separated list of hash tags. + $content = sprintf(_m('"%1$s" %2$s %3$s %4$s'), $title, $shortUrl, $description, implode(' ', $hashtags)); - $rendered = sprintf(_(''. - '%s '. - '%s '. - '%s'. + $rendered = sprintf(_m(''. + '%2$s '. + '%3$s '. + '%4$s'. ''), htmlspecialchars($url), htmlspecialchars($title), diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 4c13ec79cb..a24f207720 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -274,7 +274,7 @@ class BookmarkPlugin extends MicroAppPlugin $action->elementStart('li'); $action->element('a', array('href' => common_local_url('importdelicious')), - _('Import del.icio.us bookmarks')); + _m('Import del.icio.us bookmarks')); $action->elementEnd('li'); } @@ -379,7 +379,7 @@ class BookmarkPlugin extends MicroAppPlugin $relLinkEls = ActivityUtils::getLinks($bookmark->element, 'related'); if (count($relLinkEls) < 1) { - throw new ClientException(_('Expected exactly 1 link '. + throw new ClientException(_m('Expected exactly 1 link '. 'rel=related in a Bookmark.')); } @@ -472,7 +472,7 @@ class BookmarkPlugin extends MicroAppPlugin $attachments = $notice->attachments(); if (count($attachments) != 1) { - throw new ServerException(_('Bookmark notice with the '. + throw new ServerException(_m('Bookmark notice with the '. 'wrong number of attachments.')); } diff --git a/plugins/Bookmark/bookmarkform.php b/plugins/Bookmark/bookmarkform.php index d8cf1f7f5b..074571e162 100644 --- a/plugins/Bookmark/bookmarkform.php +++ b/plugins/Bookmark/bookmarkform.php @@ -121,30 +121,30 @@ class BookmarkForm extends Form $this->li(); $this->out->input('title', - _('Title'), + _m('LABEL','Title'), $this->_title, - _('Title of the bookmark')); + _m('Title of the bookmark')); $this->unli(); $this->li(); $this->out->input('url', - _('URL'), + _m('LABEL','URL'), $this->_url, - _('URL to bookmark')); + _m('URL to bookmark')); $this->unli(); $this->li(); $this->out->input('tags', - _('Tags'), + _m('LABEL','Tags'), $this->_tags, - _('Comma- or space-separated list of tags')); + _m('Comma- or space-separated list of tags')); $this->unli(); $this->li(); $this->out->input('description', - _('Description'), + _m('LABEL','Description'), $this->_description, - _('Description of the URL')); + _m('Description of the URL')); $this->unli(); $this->out->elementEnd('ul'); diff --git a/plugins/Bookmark/bookmarkpopup.php b/plugins/Bookmark/bookmarkpopup.php index 33f983a93a..f254557b81 100644 --- a/plugins/Bookmark/bookmarkpopup.php +++ b/plugins/Bookmark/bookmarkpopup.php @@ -55,7 +55,7 @@ class BookmarkpopupAction extends NewbookmarkAction // TRANS: Title for mini-posting window loaded from bookmarklet. // TRANS: %s is the StatusNet site name. $this->element('title', - null, sprintf(_('Bookmark on %s'), + null, sprintf(_m('Bookmark on %s'), common_config('site', 'name'))); } diff --git a/plugins/Bookmark/deliciousbackupimporter.php b/plugins/Bookmark/deliciousbackupimporter.php index 197c7a143b..a8d2819fe7 100644 --- a/plugins/Bookmark/deliciousbackupimporter.php +++ b/plugins/Bookmark/deliciousbackupimporter.php @@ -82,7 +82,7 @@ class DeliciousBackupImporter extends QueueHandler $dls = $doc->getElementsByTagName('dl'); if ($dls->length != 1) { - throw new ClientException(_("Bad import file.")); + throw new ClientException(_m("Bad import file.")); } $dl = $dls->item(0); @@ -165,7 +165,7 @@ class DeliciousBackupImporter extends QueueHandler $as = $dt->getElementsByTagName('a'); if ($as->length == 0) { - throw new ClientException(_("No tag in a
.")); + throw new ClientException(_m("No tag in a
.")); } $a = $as->item(0); @@ -173,7 +173,7 @@ class DeliciousBackupImporter extends QueueHandler $private = $a->getAttribute('private'); if ($private != 0) { - throw new ClientException(_('Skipping private bookmark.')); + throw new ClientException(_m('Skipping private bookmark.')); } if (!empty($dd)) { diff --git a/plugins/Bookmark/importbookmarks.php b/plugins/Bookmark/importbookmarks.php index 5518b00e97..e16cf9d633 100644 --- a/plugins/Bookmark/importbookmarks.php +++ b/plugins/Bookmark/importbookmarks.php @@ -75,7 +75,7 @@ function getBookmarksFile() } // TRANS: %s is the filename that contains a backup for a user. - printfv(_("Getting backup from file '%s'.")."\n", $filename); + printfv(_m("Getting backup from file \"%s\".")."\n", $filename); $html = file_get_contents($filename); diff --git a/plugins/Bookmark/importdelicious.php b/plugins/Bookmark/importdelicious.php index b98b215717..0d206e456d 100644 --- a/plugins/Bookmark/importdelicious.php +++ b/plugins/Bookmark/importdelicious.php @@ -58,7 +58,7 @@ class ImportdeliciousAction extends Action function title() { - return _("Import del.icio.us bookmarks"); + return _m("Import del.icio.us bookmarks"); } /** @@ -76,13 +76,13 @@ class ImportdeliciousAction extends Action $cur = common_current_user(); if (empty($cur)) { - throw new ClientException(_('Only logged-in users can '. + throw new ClientException(_m('Only logged-in users can '. 'import del.icio.us backups.'), 403); } if (!$cur->hasRight(BookmarkPlugin::IMPORTDELICIOUS)) { - throw new ClientException(_('You may not restore your account.'), 403); + throw new ClientException(_m('You may not restore your account.'), 403); } return true; @@ -121,7 +121,7 @@ class ImportdeliciousAction extends Action $this->checkSessionToken(); if (!isset($_FILES[ImportDeliciousForm::FILEINPUT]['error'])) { - throw new ClientException(_('No uploaded file.')); + throw new ClientException(_m('No uploaded file.')); } switch ($_FILES[ImportDeliciousForm::FILEINPUT]['error']) { @@ -129,42 +129,42 @@ class ImportdeliciousAction extends Action break; case UPLOAD_ERR_INI_SIZE: // TRANS: Client exception thrown when an uploaded file is too large. - throw new ClientException(_('The uploaded file exceeds the ' . + throw new ClientException(_m('The uploaded file exceeds the ' . 'upload_max_filesize directive in php.ini.')); return; case UPLOAD_ERR_FORM_SIZE: throw new ClientException( // TRANS: Client exception. - _('The uploaded file exceeds the MAX_FILE_SIZE directive' . + _m('The uploaded file exceeds the MAX_FILE_SIZE directive' . ' that was specified in the HTML form.')); return; case UPLOAD_ERR_PARTIAL: @unlink($_FILES[ImportDeliciousForm::FILEINPUT]['tmp_name']); // TRANS: Client exception. - throw new ClientException(_('The uploaded file was only' . + throw new ClientException(_m('The uploaded file was only' . ' partially uploaded.')); return; case UPLOAD_ERR_NO_FILE: // No file; probably just a non-AJAX submission. - throw new ClientException(_('No uploaded file.')); + throw new ClientException(_m('No uploaded file.')); return; case UPLOAD_ERR_NO_TMP_DIR: // TRANS: Client exception thrown when a temporary folder is not present - throw new ClientException(_('Missing a temporary folder.')); + throw new ClientException(_m('Missing a temporary folder.')); return; case UPLOAD_ERR_CANT_WRITE: // TRANS: Client exception thrown when writing to disk is not possible - throw new ClientException(_('Failed to write file to disk.')); + throw new ClientException(_m('Failed to write file to disk.')); return; case UPLOAD_ERR_EXTENSION: // TRANS: Client exception thrown when a file upload has been stopped - throw new ClientException(_('File upload stopped by extension.')); + throw new ClientException(_m('File upload stopped by extension.')); return; default: common_log(LOG_ERR, __METHOD__ . ": Unknown upload error " . $_FILES[ImportDeliciousForm::FILEINPUT]['error']); // TRANS: Client exception thrown when a file upload operation has failed - throw new ClientException(_('System error uploading file.')); + throw new ClientException(_m('System error uploading file.')); return; } @@ -183,7 +183,7 @@ class ImportdeliciousAction extends Action throw new ServerException("File '$filename' not readable."); } - common_debug(sprintf(_("Getting backup from file '%s'."), $filename)); + common_debug(sprintf(_m("Getting backup from file '%s'."), $filename)); $html = file_get_contents($filename); @@ -219,10 +219,10 @@ class ImportdeliciousAction extends Action { if ($this->success) { $this->element('p', null, - _('Bookmarks have been imported. Your bookmarks should now appear in search and your profile page.')); + _m('Bookmarks have been imported. Your bookmarks should now appear in search and your profile page.')); } else if ($this->inprogress) { $this->element('p', null, - _('Bookmarks are being imported. Please wait a few minutes for results.')); + _m('Bookmarks are being imported. Please wait a few minutes for results.')); } else { $form = new ImportDeliciousForm($this); $form->show(); @@ -310,7 +310,7 @@ class ImportDeliciousForm extends Form { $this->out->elementStart('p', 'instructions'); - $this->out->raw(_('You can upload a backed-up '. + $this->out->raw(_m('You can upload a backed-up '. 'delicious.com bookmarks file.')); $this->out->elementEnd('p'); @@ -340,6 +340,6 @@ class ImportDeliciousForm extends Form _m('BUTTON', 'Upload'), 'submit', null, - _('Upload the file')); + _m('Upload the file')); } } diff --git a/plugins/Bookmark/newbookmark.php b/plugins/Bookmark/newbookmark.php index ebfdb6cb95..79266e52b2 100644 --- a/plugins/Bookmark/newbookmark.php +++ b/plugins/Bookmark/newbookmark.php @@ -62,7 +62,7 @@ class NewbookmarkAction extends Action function title() { - return _('New bookmark'); + return _m('New bookmark'); } /** @@ -80,7 +80,7 @@ class NewbookmarkAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_("Must be logged in to post a bookmark."), + throw new ClientException(_m("Must be logged in to post a bookmark."), 403); } @@ -130,11 +130,11 @@ class NewbookmarkAction extends Action } try { if (empty($this->title)) { - throw new ClientException(_('Bookmark must have a title.')); + throw new ClientException(_m('Bookmark must have a title.')); } if (empty($this->url)) { - throw new ClientException(_('Bookmark must have an URL.')); + throw new ClientException(_m('Bookmark must have an URL.')); } @@ -156,7 +156,7 @@ class NewbookmarkAction extends Action $this->elementStart('html'); $this->elementStart('head'); // TRANS: Page title after sending a notice. - $this->element('title', null, _('Notice posted')); + $this->element('title', null, _m('Notice posted')); $this->elementEnd('head'); $this->elementStart('body'); $this->showNotice($saved); diff --git a/plugins/Bookmark/noticebyurl.php b/plugins/Bookmark/noticebyurl.php index 226c7a32bf..b8bea78051 100644 --- a/plugins/Bookmark/noticebyurl.php +++ b/plugins/Bookmark/noticebyurl.php @@ -67,7 +67,7 @@ class NoticebyurlAction extends Action $this->file = File::staticGet('id', $this->trimmed('id')); if (empty($this->file)) { - throw new ClientException(_('Unknown URL')); + throw new ClientException(_m('Unknown URL')); } $pageArg = $this->trimmed('page'); @@ -89,9 +89,9 @@ class NoticebyurlAction extends Action function title() { if ($this->page == 1) { - return sprintf(_("Notices linking to %s"), $this->file->url); + return sprintf(_m("Notices linking to %s"), $this->file->url); } else { - return sprintf(_("Notices linking to %s, page %d"), + return sprintf(_m("Notices linking to %1$s, page %2$d"), $this->file->url, $this->page); } diff --git a/plugins/Bookmark/showbookmark.php b/plugins/Bookmark/showbookmark.php index 40005c087f..6b9bf9bc25 100644 --- a/plugins/Bookmark/showbookmark.php +++ b/plugins/Bookmark/showbookmark.php @@ -82,7 +82,7 @@ class ShowbookmarkAction extends ShownoticeAction { // TRANS: Title for bookmark. // TRANS: %1$s is a user nickname, %2$s is a bookmark title. - return sprintf(_('%1$s\'s bookmark for "%2$s"'), + return sprintf(_m('%1$s\'s bookmark for "%2$s"'), $this->user->nickname, $this->bookmark->title); } diff --git a/plugins/Directory/DirectoryPlugin.php b/plugins/Directory/DirectoryPlugin.php index 541ec556bf..cba75802e5 100644 --- a/plugins/Directory/DirectoryPlugin.php +++ b/plugins/Directory/DirectoryPlugin.php @@ -165,8 +165,8 @@ class DirectoryPlugin extends Plugin $nav->out->menuItem( common_local_url('userdirectory'), - _('Directory'), - _('User Directory'), + _m('Directory'), + _m('User Directory'), $actionName == 'userdirectory', 'nav_directory' ); diff --git a/plugins/Directory/actions/userdirectory.php b/plugins/Directory/actions/userdirectory.php index 85835e2c1f..6532f03c02 100644 --- a/plugins/Directory/actions/userdirectory.php +++ b/plugins/Directory/actions/userdirectory.php @@ -116,7 +116,7 @@ class UserdirectoryAction extends Action function getInstructions() { // TRANS: %%site.name%% is the name of the StatusNet site. - return _( + return _m( 'Search for people on %%site.name%% by their name, ' . 'location, or interests. Separate the terms by spaces; ' . ' they must be 3 characters or more.' @@ -256,11 +256,11 @@ class UserdirectoryAction extends Action $this->elementStart('fieldset'); - $this->element('legend', null, _('Search site')); + $this->element('legend', null, _m('Search site')); $this->elementStart('ul', 'form_data'); $this->elementStart('li'); - $this->input('q', _('Keyword(s)'), $this->q); + $this->input('q', _m('Keyword(s)'), $this->q); $this->submit('search', _m('BUTTON','Search')); $this->elementEnd('li'); @@ -372,7 +372,7 @@ class UserdirectoryAction extends Action ) ); } else { - $this->element('p', 'error', _('No results.')); + $this->element('p', 'error', _m('No results.')); $message = _m(<<elementStart('li'); $action->checkbox('emailsummary', // TRANS: Checkbox label in e-mail preferences form. - _('Send me a periodic summary of updates from my network.'), + _m('Send me a periodic summary of updates from my network.'), Email_summary_status::getSendSummary($user->id)); $action->elementEnd('li'); return true; diff --git a/plugins/EmailSummary/useremailsummaryhandler.php b/plugins/EmailSummary/useremailsummaryhandler.php index 8ba8a7a20b..5e10af40eb 100644 --- a/plugins/EmailSummary/useremailsummaryhandler.php +++ b/plugins/EmailSummary/useremailsummaryhandler.php @@ -128,7 +128,7 @@ class UserEmailSummaryHandler extends QueueHandler 'style' => 'background-color: #ffffff; border: 4px solid #4c609a; padding: 10px;')); $out->elementStart('div', array('style' => 'color: #ffffff; background-color: #4c609a; font-weight: bold; margin-bottom: 10px; padding: 4px;')); - $out->raw(sprintf(_('Recent updates from %1s for %2s:'), + $out->raw(sprintf(_m('Recent updates from %1s for %2s:'), common_config('site', 'name'), $profile->getBestName())); $out->elementEnd('div'); @@ -184,7 +184,7 @@ class UserEmailSummaryHandler extends QueueHandler $out->text(' '); $out->element('a', array('href' => $convurl.'#notice-'.$notice->id), - _('in context')); + _m('in context')); } } $out->elementEnd('div'); @@ -194,7 +194,7 @@ class UserEmailSummaryHandler extends QueueHandler $out->elementEnd('table'); - $out->raw(sprintf(_('

change your email settings for %2s

'), + $out->raw(sprintf(_m('

change your email settings for %2s

'), common_local_url('emailsettings'), common_config('site', 'name'))); @@ -204,7 +204,7 @@ class UserEmailSummaryHandler extends QueueHandler // FIXME: do something for people who don't like HTML email - mail_to_user($user, _('Updates from your network'), $body, + mail_to_user($user, _m('Updates from your network'), $body, array('Content-Type' => 'text/html; charset=UTF-8')); if (empty($ess)) { diff --git a/plugins/Event/EventPlugin.php b/plugins/Event/EventPlugin.php index 1ee6ef4309..d1dda6336d 100644 --- a/plugins/Event/EventPlugin.php +++ b/plugins/Event/EventPlugin.php @@ -365,7 +365,7 @@ class EventPlugin extends MicroappPlugin $out->elementStart('div', 'event-times'); // VEVENT/EVENT-TIMES IN - $out->element('strong', null, _('Time:')); + $out->element('strong', null, _m('Time:')); $out->element('abbr', array('class' => 'dtstart', 'title' => common_date_iso8601($event->start_time)), @@ -385,14 +385,14 @@ class EventPlugin extends MicroappPlugin if (!empty($event->location)) { $out->elementStart('div', 'event-location'); - $out->element('strong', null, _('Location: ')); + $out->element('strong', null, _m('Location:')); $out->element('span', 'location', $event->location); $out->elementEnd('div'); } if (!empty($event->description)) { $out->elementStart('div', 'event-description'); - $out->element('strong', null, _('Description: ')); + $out->element('strong', null, _m('Description:')); $out->element('span', 'description', $event->description); $out->elementEnd('div'); } @@ -400,9 +400,11 @@ class EventPlugin extends MicroappPlugin $rsvps = $event->getRSVPs(); $out->elementStart('div', 'event-rsvps'); - $out->element('strong', null, _('Attending: ')); + $out->element('strong', null, _m('Attending:')); $out->element('span', 'event-rsvps', - sprintf(_('Yes: %d No: %d Maybe: %d'), + // TRANS: RSVP counts. + // TRANS: %1$d, %2$d and %3$d are numbers of RSVPs. + sprintf(_m('Yes: %1$d No: %2$d Maybe: %3$d'), count($rsvps[RSVP::POSITIVE]), count($rsvps[RSVP::NEGATIVE]), count($rsvps[RSVP::POSSIBLE]))); diff --git a/plugins/Event/Happening.php b/plugins/Event/Happening.php index 45398dfcf2..bbea213a1a 100644 --- a/plugins/Event/Happening.php +++ b/plugins/Event/Happening.php @@ -122,7 +122,7 @@ class Happening extends Managed_DataObject if (array_key_exists('uri', $options)) { $other = Happening::staticGet('uri', $options['uri']); if (!empty($other)) { - throw new ClientException(_('Event already exists.')); + throw new ClientException(_m('Event already exists.')); } } @@ -154,19 +154,21 @@ class Happening extends Managed_DataObject // XXX: does this get truncated? - $content = sprintf(_('"%s" %s - %s (%s): %s'), + // TRANS: Event description. %1$s is a title, %2$s is start time, %3$s is end time, + // TRANS: %4$s is location, %5$s is a description. + $content = sprintf(_m('"%1$s" %2$s - %3$s (%4$s): %5$s'), $title, common_exact_date($ev->start_time), common_exact_date($ev->end_time), $location, $description); - $rendered = sprintf(_(''. - '%s '. - '%s - '. - '%s '. - '(%s): '. - '%s '. + $rendered = sprintf(_m(''. + '%1$s '. + '%3$s - '. + '%5$s '. + '(%6$s): '. + '%7$s '. ''), htmlspecialchars($title), htmlspecialchars(common_date_iso8601($ev->start_time)), diff --git a/plugins/Event/RSVP.php b/plugins/Event/RSVP.php index beb377c5bc..108fd5f4db 100644 --- a/plugins/Event/RSVP.php +++ b/plugins/Event/RSVP.php @@ -143,7 +143,7 @@ class RSVP extends Managed_DataObject if (array_key_exists('uri', $options)) { $other = RSVP::staticGet('uri', $options['uri']); if (!empty($other)) { - throw new ClientException(_('RSVP already exists.')); + throw new ClientException(_m('RSVP already exists.')); } } @@ -151,7 +151,7 @@ class RSVP extends Managed_DataObject 'event_id' => $event->id)); if (!empty($other)) { - throw new ClientException(_('RSVP already exists.')); + throw new ClientException(_m('RSVP already exists.')); } $rsvp = new RSVP(); @@ -316,13 +316,13 @@ class RSVP extends Managed_DataObject switch ($response) { case 'Y': - $fmt = _("%2s is attending %4s."); + $fmt = _m("%2s is attending %4s."); break; case 'N': - $fmt = _("%2s is not attending %4s."); + $fmt = _m("%2s is not attending %4s."); break; case '?': - $fmt = _("%2s might attend %4s."); + $fmt = _m("%2s might attend %4s."); break; default: throw new Exception("Unknown response code {$response}"); @@ -331,7 +331,7 @@ class RSVP extends Managed_DataObject if (empty($event)) { $eventUrl = '#'; - $eventTitle = _('an unknown event'); + $eventTitle = _m('an unknown event'); } else { $notice = $event->getNotice(); $eventUrl = $notice->bestUrl(); @@ -351,13 +351,13 @@ class RSVP extends Managed_DataObject switch ($response) { case 'Y': - $fmt = _("%1s is attending %2s."); + $fmt = _m("%1s is attending %2s."); break; case 'N': - $fmt = _("%1s is not attending %2s."); + $fmt = _m("%1s is not attending %2s."); break; case '?': - $fmt = _("%1s might attend %2s.>"); + $fmt = _m("%1s might attend %2s.>"); break; default: throw new Exception("Unknown response code {$response}"); @@ -365,7 +365,7 @@ class RSVP extends Managed_DataObject } if (empty($event)) { - $eventTitle = _('an unknown event'); + $eventTitle = _m('an unknown event'); } else { $notice = $event->getNotice(); $eventTitle = $event->title; diff --git a/plugins/Event/cancelrsvp.php b/plugins/Event/cancelrsvp.php index 83dabe2de5..94f78bfca6 100644 --- a/plugins/Event/cancelrsvp.php +++ b/plugins/Event/cancelrsvp.php @@ -58,7 +58,7 @@ class CancelrsvpAction extends Action function title() { - return _('Cancel RSVP'); + return _m('Cancel RSVP'); } /** @@ -79,25 +79,25 @@ class CancelrsvpAction extends Action $rsvpId = $this->trimmed('rsvp'); if (empty($rsvpId)) { - throw new ClientException(_('No such rsvp.')); + throw new ClientException(_m('No such RSVP.')); } $this->rsvp = RSVP::staticGet('id', $rsvpId); if (empty($this->rsvp)) { - throw new ClientException(_('No such rsvp.')); + throw new ClientException(_m('No such RSVP.')); } $this->event = Happening::staticGet('id', $this->rsvp->event_id); if (empty($this->event)) { - throw new ClientException(_('No such event.')); + throw new ClientException(_m('No such event.')); } $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_('You must be logged in to RSVP for an event.')); + throw new ClientException(_m('You must be logged in to RSVP for an event.')); } return true; @@ -154,7 +154,7 @@ class CancelrsvpAction extends Action $this->elementStart('html'); $this->elementStart('head'); // TRANS: Page title after sending a notice. - $this->element('title', null, _('Event saved')); + $this->element('title', null, _m('Event saved')); $this->elementEnd('head'); $this->elementStart('body'); $this->elementStart('body'); diff --git a/plugins/Event/cancelrsvpform.php b/plugins/Event/cancelrsvpform.php index 955a782e62..14161d1897 100644 --- a/plugins/Event/cancelrsvpform.php +++ b/plugins/Event/cancelrsvpform.php @@ -102,13 +102,13 @@ class CancelRSVPForm extends Form switch (RSVP::verbFor($this->rsvp->response)) { case RSVP::POSITIVE: - $this->out->text(_('You will attend this event.')); + $this->out->text(_m('You will attend this event.')); break; case RSVP::NEGATIVE: - $this->out->text(_('You will not attend this event.')); + $this->out->text(_m('You will not attend this event.')); break; case RSVP::POSSIBLE: - $this->out->text(_('You might attend this event.')); + $this->out->text(_m('You might attend this event.')); break; } diff --git a/plugins/Event/eventform.php b/plugins/Event/eventform.php index e6bc1e7016..327c8a31e6 100644 --- a/plugins/Event/eventform.php +++ b/plugins/Event/eventform.php @@ -93,58 +93,58 @@ class EventForm extends Form $this->li(); $this->out->input('title', - _('Title'), + _m('LABEL','Title'), null, - _('Title of the event')); + _m('Title of the event')); $this->unli(); $this->li(); $this->out->input('startdate', - _('Start date'), + _m('LABEL','Start date'), null, - _('Date the event starts')); + _m('Date the event starts')); $this->unli(); $this->li(); $this->out->input('starttime', - _('Start time'), + _m('LABEL','Start time'), null, - _('Time the event starts')); + _m('Time the event starts')); $this->unli(); $this->li(); $this->out->input('enddate', - _('End date'), + _m('LABEL','End date'), null, - _('Date the event ends')); + _m('Date the event ends')); $this->unli(); $this->li(); $this->out->input('endtime', - _('End time'), + _m('LABEL','End time'), null, - _('Time the event ends')); + _m('Time the event ends')); $this->unli(); $this->li(); $this->out->input('location', - _('Location'), + _m('LABEL','Location'), null, - _('Event location')); + _m('Event location')); $this->unli(); $this->li(); $this->out->input('url', - _('URL'), + _m('LABEL','URL'), null, - _('URL for more information')); + _m('URL for more information')); $this->unli(); $this->li(); $this->out->input('description', - _('Description'), + _m('LABEL','Description'), null, - _('Description of the event')); + _m('Description of the event')); $this->unli(); $this->out->elementEnd('ul'); diff --git a/plugins/Event/newevent.php b/plugins/Event/newevent.php index 5551e0ce2c..7fe80f0857 100644 --- a/plugins/Event/newevent.php +++ b/plugins/Event/newevent.php @@ -63,7 +63,7 @@ class NeweventAction extends Action function title() { - return _('New event'); + return _m('New event'); } /** @@ -81,7 +81,7 @@ class NeweventAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_("Must be logged in to post a event."), + throw new ClientException(_m("Must be logged in to post a event."), 403); } @@ -92,7 +92,7 @@ class NeweventAction extends Action $this->title = $this->trimmed('title'); if (empty($this->title)) { - throw new ClientException(_('Title required.')); + throw new ClientException(_m('Title required.')); } $this->location = $this->trimmed('location'); @@ -102,7 +102,7 @@ class NeweventAction extends Action $startDate = $this->trimmed('startdate'); if (empty($startDate)) { - throw new ClientException(_('Start date required.')); + throw new ClientException(_m('Start date required.')); } $startTime = $this->trimmed('starttime'); @@ -114,7 +114,7 @@ class NeweventAction extends Action $endDate = $this->trimmed('enddate'); if (empty($endDate)) { - throw new ClientException(_('End date required.')); + throw new ClientException(_m('End date required.')); } $endTime = $this->trimmed('endtime'); @@ -135,13 +135,13 @@ class NeweventAction extends Action $this->endTime = strtotime($end); if ($this->startTime == 0) { - throw new Exception(sprintf(_('Could not parse date "%s"'), + throw new Exception(sprintf(_m('Could not parse date "%s"'), $start)); } if ($this->endTime == 0) { - throw new Exception(sprintf(_('Could not parse date "%s"'), + throw new Exception(sprintf(_m('Could not parse date "%s"'), $end)); } @@ -179,15 +179,15 @@ class NeweventAction extends Action { try { if (empty($this->title)) { - throw new ClientException(_('Event must have a title.')); + throw new ClientException(_m('Event must have a title.')); } if (empty($this->startTime)) { - throw new ClientException(_('Event must have a start time.')); + throw new ClientException(_m('Event must have a start time.')); } if (empty($this->endTime)) { - throw new ClientException(_('Event must have an end time.')); + throw new ClientException(_m('Event must have an end time.')); } $profile = $this->user->getProfile(); @@ -216,7 +216,7 @@ class NeweventAction extends Action $this->elementStart('html'); $this->elementStart('head'); // TRANS: Page title after sending a notice. - $this->element('title', null, _('Event saved')); + $this->element('title', null, _m('Event saved')); $this->elementEnd('head'); $this->elementStart('body'); $this->showNotice($saved); diff --git a/plugins/Event/newrsvp.php b/plugins/Event/newrsvp.php index 2b28580b1d..cb7f72d49c 100644 --- a/plugins/Event/newrsvp.php +++ b/plugins/Event/newrsvp.php @@ -58,7 +58,7 @@ class NewrsvpAction extends Action function title() { - return _('New RSVP'); + return _m('New RSVP'); } /** @@ -79,19 +79,19 @@ class NewrsvpAction extends Action $eventId = $this->trimmed('event'); if (empty($eventId)) { - throw new ClientException(_('No such event.')); + throw new ClientException(_m('No such event.')); } $this->event = Happening::staticGet('id', $eventId); if (empty($this->event)) { - throw new ClientException(_('No such event.')); + throw new ClientException(_m('No such event.')); } $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_('You must be logged in to RSVP for an event.')); + throw new ClientException(_m('You must be logged in to RSVP for an event.')); } common_debug(print_r($this->args, true)); @@ -159,7 +159,7 @@ class NewrsvpAction extends Action $this->elementStart('html'); $this->elementStart('head'); // TRANS: Page title after sending a notice. - $this->element('title', null, _('Event saved')); + $this->element('title', null, _m('Event saved')); $this->elementEnd('head'); $this->elementStart('body'); $this->elementStart('body'); diff --git a/plugins/Event/rsvpform.php b/plugins/Event/rsvpform.php index acc8cd8d12..494e64929f 100644 --- a/plugins/Event/rsvpform.php +++ b/plugins/Event/rsvpform.php @@ -98,7 +98,7 @@ class RSVPForm extends Form { $this->out->elementStart('fieldset', array('id' => 'new_rsvp_data')); - $this->out->text(_('RSVP: ')); + $this->out->text(_m('RSVP:')); $this->out->hidden('event', $this->event->id); $this->out->hidden('submitvalue', ''); diff --git a/plugins/Event/showrsvp.php b/plugins/Event/showrsvp.php index 145788feea..f08857dcc4 100644 --- a/plugins/Event/showrsvp.php +++ b/plugins/Event/showrsvp.php @@ -91,7 +91,7 @@ class ShowrsvpAction extends ShownoticeAction { // TRANS: Title for event. // TRANS: %1$s is a user nickname, %2$s is an event title. - return sprintf(_('%1$s\'s RSVP for "%2$s"'), + return sprintf(_m('%1$s\'s RSVP for "%2$s"'), $this->user->nickname, $this->event->title); } diff --git a/plugins/ExtendedProfile/lib/extendedprofilewidget.php b/plugins/ExtendedProfile/lib/extendedprofilewidget.php index 53cb5d3b87..24c8b2f3d4 100644 --- a/plugins/ExtendedProfile/lib/extendedprofilewidget.php +++ b/plugins/ExtendedProfile/lib/extendedprofilewidget.php @@ -618,7 +618,7 @@ class ExtendedProfileWidget extends Form _m('BUTTON','Save'), 'submit form_action-secondary', 'save', - _('Save details') + _m('Save details') ); } diff --git a/plugins/FacebookBridge/actions/facebooksettings.php b/plugins/FacebookBridge/actions/facebooksettings.php index b9526c1269..54e96ee400 100644 --- a/plugins/FacebookBridge/actions/facebooksettings.php +++ b/plugins/FacebookBridge/actions/facebooksettings.php @@ -111,7 +111,7 @@ class FacebooksettingsAction extends SettingsAction { * @return instructions for use */ function getInstructions() { - return _('Facebook settings'); + return _m('Facebook settings'); } /* diff --git a/plugins/FollowEveryone/FollowEveryonePlugin.php b/plugins/FollowEveryone/FollowEveryonePlugin.php index 228efc9357..04ed932122 100644 --- a/plugins/FollowEveryone/FollowEveryonePlugin.php +++ b/plugins/FollowEveryone/FollowEveryonePlugin.php @@ -159,7 +159,7 @@ class FollowEveryonePlugin extends Plugin $action->elementStart('li'); // TRANS: Checkbox label in form for profile settings. - $action->checkbox('followeveryone', _('Follow everyone'), + $action->checkbox('followeveryone', _m('Follow everyone'), ($action->arg('followeveryone')) ? $action->arg('followeveryone') : User_followeveryone_prefs::followEveryone($user->id)); diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 42a8a5d573..29e57c1aae 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -255,21 +255,21 @@ class GroupPrivateMessagePlugin extends Plugin $form->out->elementStart('li'); $form->out->dropdown('allow_privacy', - _('Private messages'), - array(Group_privacy_settings::SOMETIMES => _('Sometimes'), - Group_privacy_settings::ALWAYS => _('Always'), - Group_privacy_settings::NEVER => _('Never')), - _('Whether to allow private messages to this group'), + _m('Private messages'), + array(Group_privacy_settings::SOMETIMES => _m('Sometimes'), + Group_privacy_settings::ALWAYS => _m('Always'), + Group_privacy_settings::NEVER => _m('Never')), + _m('Whether to allow private messages to this group'), false, (empty($gps)) ? Group_privacy_settings::SOMETIMES : $gps->allow_privacy); $form->out->elementEnd('li'); $form->out->elementStart('li'); $form->out->dropdown('allow_sender', - _('Private sender'), - array(Group_privacy_settings::EVERYONE => _('Everyone'), - Group_privacy_settings::MEMBER => _('Member'), - Group_privacy_settings::ADMIN => _('Admin')), - _('Who can send private messages to the group'), + _m('Private sender'), + array(Group_privacy_settings::EVERYONE => _m('Everyone'), + Group_privacy_settings::MEMBER => _m('Member'), + Group_privacy_settings::ADMIN => _m('Admin')), + _m('Who can send private messages to the group'), false, (empty($gps)) ? Group_privacy_settings::MEMBER : $gps->allow_sender); $form->out->elementEnd('li'); @@ -370,8 +370,8 @@ class GroupPrivateMessagePlugin extends Plugin $action->elementStart('li', 'entity_send-a-message'); $action->element('a', array('href' => common_local_url('newgroupmessage', array('nickname' => $group->nickname)), - 'title' => _('Send a direct message to this group')), - _('Message')); + 'title' => _m('Send a direct message to this group')), + _m('Message')); // $form = new GroupMessageForm($action, $group); // $form->hidden = true; // $form->show(); @@ -454,7 +454,7 @@ class GroupPrivateMessagePlugin extends Plugin // Don't save the notice! // FIXME: this is probably cheating. - throw new ClientException(sprintf(_('Forced notice to private group message.')), + throw new ClientException(sprintf(_m('Forced notice to private group message.')), 200); } } @@ -476,7 +476,7 @@ class GroupPrivateMessagePlugin extends Plugin $gps = Group_privacy_settings::forGroup($group); if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) { - $action->element('p', 'privategroupindicator', _('Private')); + $action->element('p', 'privategroupindicator', _m('Private')); } return true; diff --git a/plugins/GroupPrivateMessage/Group_message.php b/plugins/GroupPrivateMessage/Group_message.php index f8c0c707c3..9679f57031 100644 --- a/plugins/GroupPrivateMessage/Group_message.php +++ b/plugins/GroupPrivateMessage/Group_message.php @@ -123,7 +123,7 @@ class Group_message extends Memcached_DataObject { if (!$user->hasRight(Right::NEWMESSAGE)) { // XXX: maybe break this out into a separate right - throw new Exception(sprintf(_('User %s not allowed to send private messages.'), + throw new Exception(sprintf(_m('User %s is not allowed to send private messages.'), $user->nickname)); } @@ -177,7 +177,7 @@ class Group_message extends Memcached_DataObject { $group = User_group::staticGet('id', $this->to_group); if (empty($group)) { - throw new ServerException(_('No group for group message')); + throw new ServerException(_m('No group for group message')); } return $group; } @@ -186,7 +186,7 @@ class Group_message extends Memcached_DataObject { $sender = Profile::staticGet('id', $this->from_profile); if (empty($sender)) { - throw new ServerException(_('No sender for group message')); + throw new ServerException(_m('No sender for group message')); } return $sender; } diff --git a/plugins/GroupPrivateMessage/Group_message_profile.php b/plugins/GroupPrivateMessage/Group_message_profile.php index c5832a9294..cdd2839c12 100644 --- a/plugins/GroupPrivateMessage/Group_message_profile.php +++ b/plugins/GroupPrivateMessage/Group_message_profile.php @@ -156,27 +156,27 @@ class Group_message_profile extends Memcached_DataObject // TRANS: Subject for direct-message notification email. // TRANS: %s is the sending user's nickname. - $subject = sprintf(_('New private message from %s to group %s'), $from_profile->nickname, $group->nickname); + $subject = sprintf(_m('New private message from %1$s to group %2$s'), $from_profile->nickname, $group->nickname); // TRANS: Body for direct-message notification email. // TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname, // TRANS: %3$s is the message content, %4$s a URL to the message, // TRANS: %5$s is the StatusNet sitename. - $body = sprintf(_("%1\$s (%2\$s) sent a private message to group %3\$s:\n\n". + $body = sprintf(_m("%1\$s (%2\$s) sent a private message to group %3\$s:\n\n". "------------------------------------------------------\n". "%4\$s\n". "------------------------------------------------------\n\n". "You can reply to their message here:\n\n". "%5\$s\n\n". - "Don't reply to this email; it won't get to them.\n\n". + "Do not reply to this email; it will not get to them.\n\n". "With kind regards,\n". - "%6\$s\n"), + "%6\$s"), $from_profile->getBestName(), $from_profile->nickname, $group->nickname, $gm->content, common_local_url('newmessage', array('to' => $from_profile->id)), - common_config('site', 'name')); + common_config('site', 'name')) . "\n"; $headers = _mail_prepare_headers('message', $to->nickname, $from_profile->nickname); diff --git a/plugins/GroupPrivateMessage/Group_privacy_settings.php b/plugins/GroupPrivateMessage/Group_privacy_settings.php index 0176d3bd6e..7447ca9a62 100644 --- a/plugins/GroupPrivateMessage/Group_privacy_settings.php +++ b/plugins/GroupPrivateMessage/Group_privacy_settings.php @@ -164,7 +164,7 @@ class Group_privacy_settings extends Memcached_DataObject $gps = self::forGroup($group); if ($gps->allow_privacy == Group_privacy_settings::NEVER) { - throw new Exception(sprintf(_('Group %s does not allow private messages.'), + throw new Exception(sprintf(_m('Group %s does not allow private messages.'), $group->nickname)); } @@ -172,27 +172,27 @@ class Group_privacy_settings extends Memcached_DataObject case Group_privacy_settings::EVERYONE: $profile = $user->getProfile(); if (Group_block::isBlocked($group, $profile)) { - throw new Exception(sprintf(_('User %s is blocked from group %s.'), + throw new Exception(sprintf(_m('User %1$s is blocked from group %2$s.'), $user->nickname, $group->nickname)); } break; case Group_privacy_settings::MEMBER: if (!$user->isMember($group)) { - throw new Exception(sprintf(_('User %s is not a member of group %s.'), + throw new Exception(sprintf(_m('User %1$s is not a member of group %2$s.'), $user->nickname, $group->nickname)); } break; case Group_privacy_settings::ADMIN: if (!$user->isAdmin($group)) { - throw new Exception(sprintf(_('User %s is not an administrator of group %s.'), + throw new Exception(sprintf(_m('User %1$s is not an administrator of group %2$s.'), $user->nickname, $group->nickname)); } break; default: - throw new Exception(sprintf(_('Unknown privacy settings for group %s.'), + throw new Exception(sprintf(_m('Unknown privacy settings for group %s.'), $group->nickname)); } diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php index 39789cc9af..e1c4fc996d 100644 --- a/plugins/GroupPrivateMessage/groupinbox.php +++ b/plugins/GroupPrivateMessage/groupinbox.php @@ -63,7 +63,7 @@ class GroupinboxAction extends GroupDesignAction $cur = common_current_user(); if (empty($cur)) { - throw new ClientException(_('Only for logged-in users'), 403); + throw new ClientException(_m('Only for logged-in users.'), 403); } $nicknameArg = $this->trimmed('nickname'); @@ -79,17 +79,17 @@ class GroupinboxAction extends GroupDesignAction $localGroup = Local_group::staticGet('nickname', $nickname); if (empty($localGroup)) { - throw new ClientException(_('No such group'), 404); + throw new ClientException(_m('No such group.'), 404); } $this->group = User_group::staticGet('id', $localGroup->group_id); if (empty($this->group)) { - throw new ClientException(_('No such group'), 404); + throw new ClientException(_m('No such group.'), 404); } if (!$cur->isMember($this->group)) { - throw new ClientException(_('Only for members'), 403); + throw new ClientException(_m('Only for members.'), 403); } $this->page = $this->trimmed('page'); @@ -167,11 +167,11 @@ class GroupinboxAction extends GroupDesignAction $base = $this->group->getFancyName(); if ($this->page == 1) { - return sprintf(_('%s group inbox'), $base); + return sprintf(_m('%s group inbox'), $base); } else { // TRANS: Page title for any but first group page. // TRANS: %1$s is a group name, $2$s is a page number. - return sprintf(_('%1$s group inbox, page %2$d'), + return sprintf(_m('%1$s group inbox, page %2$d'), $base, $this->page); } diff --git a/plugins/GroupPrivateMessage/groupmessagecommand.php b/plugins/GroupPrivateMessage/groupmessagecommand.php index 3b3cf4cfea..bd865cb37c 100644 --- a/plugins/GroupPrivateMessage/groupmessagecommand.php +++ b/plugins/GroupPrivateMessage/groupmessagecommand.php @@ -77,7 +77,7 @@ class GroupMessageCommand extends Command $gm = Group_message::send($this->user, $group, $this->text); $channel->output($this->user, - sprintf(_('Direct message to group %s sent.'), + sprintf(_m('Direct message to group %s sent.'), $group->nickname)); return true; diff --git a/plugins/GroupPrivateMessage/groupmessageform.php b/plugins/GroupPrivateMessage/groupmessageform.php index a832ce5978..6d44096123 100644 --- a/plugins/GroupPrivateMessage/groupmessageform.php +++ b/plugins/GroupPrivateMessage/groupmessageform.php @@ -87,7 +87,7 @@ class GroupMessageForm extends Form { $this->out->element('legend', null, - sprintf(_('Message to %s'), $this->group->nickname)); + sprintf(_m('Message to %s'), $this->group->nickname)); } /** @@ -128,7 +128,7 @@ class GroupMessageForm extends Form { $this->out->element('label', array('for' => 'notice_data-text', 'id' => 'notice_data-text-label'), - sprintf(_('Direct message to %s'), $this->group->nickname)); + sprintf(_m('Direct message to %s'), $this->group->nickname)); $this->out->element('textarea', array('id' => 'notice_data-text', 'cols' => 35, @@ -140,7 +140,7 @@ class GroupMessageForm extends Form if ($contentLimit > 0) { $this->out->elementStart('dl', 'form_note'); - $this->out->element('dt', null, _('Available characters')); + $this->out->element('dt', null, _m('Available characters')); $this->out->element('dd', array('class' => 'count'), $contentLimit); $this->out->elementEnd('dl'); diff --git a/plugins/GroupPrivateMessage/newgroupmessage.php b/plugins/GroupPrivateMessage/newgroupmessage.php index 1ad24c4a0a..4271a8d22b 100644 --- a/plugins/GroupPrivateMessage/newgroupmessage.php +++ b/plugins/GroupPrivateMessage/newgroupmessage.php @@ -66,11 +66,11 @@ class NewgroupmessageAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_('Must be logged in.'), 403); + throw new ClientException(_m('Must be logged in.'), 403); } if (!$this->user->hasRight(Right::NEWMESSAGE)) { - throw new Exception(sprintf(_('User %s not allowed to send private messages.'), + throw new Exception(sprintf(_m('User %s not allowed to send private messages.'), $this->user->nickname)); } @@ -87,13 +87,13 @@ class NewgroupmessageAction extends Action $localGroup = Local_group::staticGet('nickname', $nickname); if (empty($localGroup)) { - throw new ClientException(_('No such group'), 404); + throw new ClientException(_m('No such group.'), 404); } $this->group = User_group::staticGet('id', $localGroup->group_id); if (empty($this->group)) { - throw new ClientException(_('No such group'), 404); + throw new ClientException(_m('No such group.'), 404); } // This throws an exception on error @@ -140,12 +140,12 @@ class NewgroupmessageAction extends Action if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); - $this->element('title', null, _('Message sent')); + $this->element('title', null, _m('Message sent')); $this->elementEnd('head'); $this->elementStart('body'); $this->element('p', array('id' => 'command_result'), - sprintf(_('Direct message to %s sent.'), + sprintf(_m('Direct message to %s sent.'), $this->group->nickname)); $this->elementEnd('body'); $this->elementEnd('html'); @@ -156,6 +156,6 @@ class NewgroupmessageAction extends Action function title() { - return sprintf(_('New message to group %s'), $this->group->nickname); + return sprintf(_m('New message to group %s'), $this->group->nickname); } } diff --git a/plugins/GroupPrivateMessage/showgroupmessage.php b/plugins/GroupPrivateMessage/showgroupmessage.php index 73293255cf..828b676548 100644 --- a/plugins/GroupPrivateMessage/showgroupmessage.php +++ b/plugins/GroupPrivateMessage/showgroupmessage.php @@ -67,7 +67,7 @@ class ShowgroupmessageAction extends Action $this->user = common_current_user(); if (empty($this->user)) { - throw new ClientException(_('Only logged-in users can view private messages.'), + throw new ClientException(_m('Only logged-in users can view private messages.'), 403); } @@ -76,23 +76,23 @@ class ShowgroupmessageAction extends Action $this->gm = Group_message::staticGet('id', $id); if (empty($this->gm)) { - throw new ClientException(_('No such message'), 404); + throw new ClientException(_m('No such message.'), 404); } $this->group = User_group::staticGet('id', $this->gm->to_group); if (empty($this->group)) { - throw new ServerException(_('Group not found.')); + throw new ServerException(_m('Group not found.')); } if (!$this->user->isMember($this->group)) { - throw new ClientException(_('Cannot read message.'), 403); + throw new ClientException(_m('Cannot read message.'), 403); } $this->sender = Profile::staticGet('id', $this->gm->from_profile); if (empty($this->sender)) { - throw new ServerException(_('No sender found.')); + throw new ServerException(_m('No sender found.')); } return true; @@ -117,7 +117,7 @@ class ShowgroupmessageAction extends Action function title() { - return sprintf(_('Message from %1$s to group %2$s on %3$s'), + return sprintf(_m('Message from %1$s to group %2$s on %3$s'), $this->sender->nickname, $this->group->nickname, common_exact_date($this->gm->created)); diff --git a/plugins/Irc/IrcPlugin.php b/plugins/Irc/IrcPlugin.php index 7a53e5cbf5..7877815604 100644 --- a/plugins/Irc/IrcPlugin.php +++ b/plugins/Irc/IrcPlugin.php @@ -290,12 +290,12 @@ class IrcPlugin extends ImPlugin { * @return boolean success value */ public function sendConfirmationCode($screenname, $code, $user, $checked = false) { - $body = sprintf(_('User "%s" on %s has said that your %s screenname belongs to them. ' . + $body = sprintf(_m('User "%1$s" on %2$s has said that your %3$s screenname belongs to them. ' . 'If that\'s true, you can confirm by clicking on this URL: ' . - '%s' . + '%4$s' . ' . (If you cannot click it, copy-and-paste it into the ' . - 'address bar of your browser). If that user isn\'t you, ' . - 'or if you didn\'t request this confirmation, just ignore this message.'), + 'address bar of your browser). If that user is not you, ' . + 'or if you did not request this confirmation, just ignore this message.'), $user->nickname, common_config('site', 'name'), $this->getDisplayName(), common_local_url('confirmaddress', array('code' => $code))); if ($this->regcheck && !$checked) { diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index 6066293311..d963735251 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -244,7 +244,7 @@ class IrcManager extends ImManager { if (!$result) { common_log_db_error($confirm, 'DELETE', __FILE__); // TRANS: Server error thrown on database error canceling IM address confirmation. - $this->serverError(_('Couldn\'t delete confirmation.')); + $this->serverError(_m('Could not delete confirmation.')); return; } } diff --git a/plugins/LdapCommon/LdapCommon.php b/plugins/LdapCommon/LdapCommon.php index 3afcd824f9..93e1e87dc0 100644 --- a/plugins/LdapCommon/LdapCommon.php +++ b/plugins/LdapCommon/LdapCommon.php @@ -165,7 +165,7 @@ class LdapCommon function changePassword($username,$oldpassword,$newpassword) { if(! isset($this->attributes['password']) || !isset($this->password_encoding)){ - //throw new Exception(_('Sorry, changing LDAP passwords is not supported at this time')); + //throw new Exception(_m('Sorry, changing LDAP passwords is not supported at this time.')); return false; } $entry = $this->get_user($username,array('dn' => 'dn')); diff --git a/plugins/LinkPreview/oembedproxyaction.php b/plugins/LinkPreview/oembedproxyaction.php index bc80ee5cf9..5d76535b22 100644 --- a/plugins/LinkPreview/oembedproxyaction.php +++ b/plugins/LinkPreview/oembedproxyaction.php @@ -56,7 +56,7 @@ class OembedproxyAction extends OembedAction // We're not a general oEmbed proxy service; limit to valid sessions. $token = $this->trimmed('token'); if (!$token || $token != common_session_token()) { - $this->clientError(_('There was a problem with your session token. '. + $this->clientError(_m('There was a problem with your session token. '. 'Try again, please.')); } diff --git a/plugins/Linkback/LinkbackPlugin.php b/plugins/Linkback/LinkbackPlugin.php index 797572d7f8..c40000921c 100644 --- a/plugins/Linkback/LinkbackPlugin.php +++ b/plugins/Linkback/LinkbackPlugin.php @@ -201,7 +201,7 @@ class LinkbackPlugin extends Plugin { $profile = $this->notice->getProfile(); - $args = array('title' => sprintf(_('%1$s\'s status on %2$s'), + $args = array('title' => sprintf(_m('%1$s\'s status on %2$s'), $profile->nickname, common_exact_date($this->notice->created)), 'excerpt' => $this->notice->content, diff --git a/plugins/ModPlus/remoteprofileaction.php b/plugins/ModPlus/remoteprofileaction.php index caa5e6fbf3..4822fc4248 100644 --- a/plugins/ModPlus/remoteprofileaction.php +++ b/plugins/ModPlus/remoteprofileaction.php @@ -15,7 +15,7 @@ class RemoteProfileAction extends ShowstreamAction $this->profile = Profile::staticGet('id', $id); if (!$this->profile) { - $this->serverError(_('User has no profile.')); + $this->serverError(_m('User has no profile.')); return false; } diff --git a/plugins/Mollom/MollomPlugin.php b/plugins/Mollom/MollomPlugin.php index 4c82c481ae..444a82adba 100644 --- a/plugins/Mollom/MollomPlugin.php +++ b/plugins/Mollom/MollomPlugin.php @@ -86,7 +86,7 @@ class MollomPlugin extends Plugin ); $response = $this->mollom('mollom.checkContent', $data); if ($response['spam'] == MOLLOM_ANALYSIS_SPAM) { - throw new ClientException(_("Spam Detected"), 400); + throw new ClientException(_m("Spam Detected."), 400); } if ($response['spam'] == MOLLOM_ANALYSIS_UNSURE) { //if unsure, let through diff --git a/plugins/OStatus/actions/usersalmon.php b/plugins/OStatus/actions/usersalmon.php index 5355aeba03..c7ec33eeec 100644 --- a/plugins/OStatus/actions/usersalmon.php +++ b/plugins/OStatus/actions/usersalmon.php @@ -157,7 +157,7 @@ class UsersalmonAction extends SalmonAction if (!empty($old)) { // TRANS: Client exception. - throw new ClientException(_('This is already a favorite.')); + throw new ClientException(_m('This is already a favorite.')); } if (!Fave::addNew($profile, $notice)) { @@ -179,7 +179,7 @@ class UsersalmonAction extends SalmonAction 'notice_id' => $notice->id)); if (empty($fave)) { // TRANS: Client exception. - throw new ClientException(_('Notice wasn\'t favorited!')); + throw new ClientException(_m('Notice was not favorited!')); } $fave->delete(); diff --git a/plugins/OpenID/finishopenidlogin.php b/plugins/OpenID/finishopenidlogin.php index 6d2c5f31f0..bc93bc21a6 100644 --- a/plugins/OpenID/finishopenidlogin.php +++ b/plugins/OpenID/finishopenidlogin.php @@ -125,12 +125,12 @@ class FinishopenidloginAction extends Action $this->elementStart('li'); $this->input('newname', _m('New nickname'), ($this->username) ? $this->username : '', - _m('1-64 lowercase letters or numbers, no punctuation or spaces')); + _m('1-64 lowercase letters or numbers, no punctuation or spaces.')); $this->elementEnd('li'); $this->elementStart('li'); - $this->input('email', _('Email'), $this->getEmail(), - _('Used only for updates, announcements, '. - 'and password recovery')); + $this->input('email', _m('Email'), $this->getEmail(), + _m('Used only for updates, announcements, '. + 'and password recovery.')); $this->elementEnd('li'); // Hook point for captcha etc @@ -146,7 +146,7 @@ class FinishopenidloginAction extends Action 'class' => 'checkbox')); // TRANS: OpenID plugin link text. // TRANS: %s is a link to a licese with the license name as link text. - $message = _('My text and files are available under %s ' . + $message = _m('My text and files are available under %s ' . 'except this private data: password, ' . 'email address, IM address, and phone number.'); $link = 'error))); + $action->showForm(sprintf(_m("(reCAPTCHA error: %s)", $resp->error))); } $action->showForm(_m("Captcha does not match!")); return false; diff --git a/plugins/RequireValidatedEmail/confirmfirstemail.php b/plugins/RequireValidatedEmail/confirmfirstemail.php index 1f22487a68..974a95a7cf 100644 --- a/plugins/RequireValidatedEmail/confirmfirstemail.php +++ b/plugins/RequireValidatedEmail/confirmfirstemail.php @@ -66,7 +66,7 @@ class ConfirmfirstemailAction extends Action $user = common_current_user(); if (!empty($user)) { - throw new ClientException(_('You are already logged in.')); + throw new ClientException(_m('You are already logged in.')); } $this->code = $this->trimmed('code'); @@ -74,25 +74,25 @@ class ConfirmfirstemailAction extends Action $this->confirm = Confirm_address::staticGet('code', $this->code); if (empty($this->confirm)) { - throw new ClientException(_('Confirmation code not found.')); + throw new ClientException(_m('Confirmation code not found.')); return; } $this->user = User::staticGet('id', $this->confirm->user_id); if (empty($this->user)) { - throw new ServerException(_('No user for that confirmation code.')); + throw new ServerException(_m('No user for that confirmation code.')); } $type = $this->confirm->address_type; if ($type != 'email') { - throw new ServerException(sprintf(_('Unrecognized address type %s.'), $type)); + throw new ServerException(sprintf(_m('Unrecognized address type %s.'), $type)); } if (!empty($this->user->email) && $this->user->email == $confirm->address) { // TRANS: Client error for an already confirmed email/jabber/sms address. - throw new ClientException(_('That address has already been confirmed.')); + throw new ClientException(_m('That address has already been confirmed.')); } if ($this->isPost()) { @@ -103,10 +103,10 @@ class ConfirmfirstemailAction extends Action $confirm = $this->trimmed('confirm'); if (strlen($password) < 6) { - throw new ClientException(_('Password too short.')); + throw new ClientException(_m('Password too short.')); return; } else if (0 != strcmp($password, $confirm)) { - throw new ClientException(_("Passwords don't match.")); + throw new ClientException(_m("Passwords do not match.")); return; } @@ -162,7 +162,7 @@ class ConfirmfirstemailAction extends Action function showContent() { $this->element('p', 'instructions', - sprintf(_('You have confirmed the email address for your new user account %s. '. + sprintf(_m('You have confirmed the email address for your new user account %s. '. 'Use the form below to set your new password.'), $this->user->nickname)); @@ -172,7 +172,7 @@ class ConfirmfirstemailAction extends Action function title() { - return _('Set a password'); + return _m('Set a password'); } } @@ -188,7 +188,7 @@ class ConfirmFirstEmailForm extends Form function formLegend() { - return _('Confirm email'); + return _m('Confirm email'); } function action() @@ -206,18 +206,18 @@ class ConfirmFirstEmailForm extends Form { $this->out->elementStart('ul', 'form_data'); $this->out->elementStart('li'); - $this->out->password('password', _('New password'), - _('6 or more characters.')); + $this->out->password('password', _m('New password'), + _m('6 or more characters.')); $this->out->elementEnd('li'); $this->out->elementStart('li'); - $this->out->password('confirm', _('Confirm'), - _('Same as password above.')); + $this->out->password('confirm', _m('Confirm'), + _m('Same as password above.')); $this->out->elementEnd('li'); $this->out->elementEnd('ul'); } function formActions() { - $this->out->submit('save', _('Save')); + $this->out->submit('save', _m('Save')); } } diff --git a/plugins/SearchSub/searchsubaction.php b/plugins/SearchSub/searchsubaction.php index 67bc178df6..db1a0e9abc 100644 --- a/plugins/SearchSub/searchsubaction.php +++ b/plugins/SearchSub/searchsubaction.php @@ -75,7 +75,7 @@ class SearchsubAction extends Action if ($_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error displayed trying to perform any request method other than POST. // TRANS: Do not translate POST. - $this->clientError(_('This action only accepts POST requests.')); + $this->clientError(_m('This action only accepts POST requests.')); return false; } @@ -85,7 +85,7 @@ class SearchsubAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token is not okay. - $this->clientError(_('There was a problem with your session token.'. + $this->clientError(_m('There was a problem with your session token.'. ' Try again, please.')); return false; } @@ -96,7 +96,7 @@ class SearchsubAction extends Action if (empty($this->user)) { // TRANS: Client error displayed trying to subscribe when not logged in. - $this->clientError(_('Not logged in.')); + $this->clientError(_m('Not logged in.')); return false; } @@ -106,7 +106,7 @@ class SearchsubAction extends Action if (empty($this->search)) { // TRANS: Client error displayed trying to subscribe to a non-existing profile. - $this->clientError(_('No such profile.')); + $this->clientError(_m('No such profile.')); return false; } diff --git a/plugins/SearchSub/searchsubform.php b/plugins/SearchSub/searchsubform.php index 8078cdde1b..7b05377397 100644 --- a/plugins/SearchSub/searchsubform.php +++ b/plugins/SearchSub/searchsubform.php @@ -137,6 +137,6 @@ class SearchSubForm extends Form function formActions() { - $this->out->submit('submit', _('Subscribe'), 'submit', null, _m('Subscribe to this search')); + $this->out->submit('submit', _m('BUTTON','Subscribe'), 'submit', null, _m('Subscribe to this search')); } } diff --git a/plugins/SearchSub/searchunsubform.php b/plugins/SearchSub/searchunsubform.php index 296b74f4a1..f90531f6aa 100644 --- a/plugins/SearchSub/searchunsubform.php +++ b/plugins/SearchSub/searchunsubform.php @@ -104,6 +104,6 @@ class SearchUnsubForm extends SearchSubForm function formActions() { - $this->out->submit('submit', _('Unsubscribe'), 'submit', null, _m('Unsubscribe from this search')); + $this->out->submit('submit', _m('BUTTON','Unsubscribe'), 'submit', null, _m('Unsubscribe from this search')); } } diff --git a/plugins/SubMirror/actions/mirrorsettings.php b/plugins/SubMirror/actions/mirrorsettings.php index 90bbf3dffb..d6e1ed5d1b 100644 --- a/plugins/SubMirror/actions/mirrorsettings.php +++ b/plugins/SubMirror/actions/mirrorsettings.php @@ -129,7 +129,7 @@ class MirrorSettingsAction extends SettingsAction header('Content-Type: text/html;charset=utf-8'); $this->elementStart('html'); $this->elementStart('head'); - $this->element('title', null, _('Provider add')); + $this->element('title', null, _m('Provider add')); $this->elementEnd('head'); $this->elementStart('body'); diff --git a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php index 114113360e..e898ce9ae0 100644 --- a/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php +++ b/plugins/SubscriptionThrottle/SubscriptionThrottlePlugin.php @@ -71,7 +71,7 @@ class SubscriptionThrottlePlugin extends Plugin $subtime = strtotime($sub->created); $now = time(); if ($now - $subtime < $seconds) { - throw new Exception(_("Too many subscriptions. Take a break and try again later.")); + throw new Exception(_m("Too many subscriptions. Take a break and try again later.")); } } } @@ -97,7 +97,7 @@ class SubscriptionThrottlePlugin extends Plugin $jointime = strtotime($mem->created); $now = time(); if ($now - $jointime < $seconds) { - throw new Exception(_("Too many memberships. Take a break and try again later.")); + throw new Exception(_m("Too many memberships. Take a break and try again later.")); } } } diff --git a/plugins/TagSub/tagsubaction.php b/plugins/TagSub/tagsubaction.php index 2e4e25d6e1..83bf106bed 100644 --- a/plugins/TagSub/tagsubaction.php +++ b/plugins/TagSub/tagsubaction.php @@ -75,7 +75,7 @@ class TagsubAction extends Action if ($_SERVER['REQUEST_METHOD'] != 'POST') { // TRANS: Client error displayed trying to perform any request method other than POST. // TRANS: Do not translate POST. - $this->clientError(_('This action only accepts POST requests.')); + $this->clientError(_m('This action only accepts POST requests.')); return false; } @@ -85,7 +85,7 @@ class TagsubAction extends Action if (!$token || $token != common_session_token()) { // TRANS: Client error displayed when the session token is not okay. - $this->clientError(_('There was a problem with your session token.'. + $this->clientError(_m('There was a problem with your session token.'. ' Try again, please.')); return false; } @@ -96,7 +96,7 @@ class TagsubAction extends Action if (empty($this->user)) { // TRANS: Client error displayed trying to subscribe when not logged in. - $this->clientError(_('Not logged in.')); + $this->clientError(_m('Not logged in.')); return false; } @@ -106,7 +106,7 @@ class TagsubAction extends Action if (empty($this->tag)) { // TRANS: Client error displayed trying to subscribe to a non-existing profile. - $this->clientError(_('No such profile.')); + $this->clientError(_m('No such profile.')); return false; } diff --git a/plugins/TagSub/tagsubform.php b/plugins/TagSub/tagsubform.php index 108558be24..169ccc4adb 100644 --- a/plugins/TagSub/tagsubform.php +++ b/plugins/TagSub/tagsubform.php @@ -137,6 +137,6 @@ class TagSubForm extends Form function formActions() { - $this->out->submit('submit', _('Subscribe'), 'submit', null, _m('Subscribe to this tag')); + $this->out->submit('submit', _m('BUTTON','Subscribe'), 'submit', null, _m('Subscribe to this tag')); } } diff --git a/plugins/TagSub/tagsubsaction.php b/plugins/TagSub/tagsubsaction.php index f11935229b..21ddf5035f 100644 --- a/plugins/TagSub/tagsubsaction.php +++ b/plugins/TagSub/tagsubsaction.php @@ -115,13 +115,13 @@ class TagSubsAction extends GalleryAction $current_user = common_current_user(); if ($this->user->id === $current_user->id) { // TRANS: Tag subscription list text when the logged in user has no tag subscriptions. - $message = _('You\'re not listening to any hash tags right now. You can push the "Subscribe" button ' . + $message = _m('You are not listening to any hash tags right now. You can push the "Subscribe" button ' . 'on any hashtag page to automatically receive any public messages on this site that use that ' . - 'tag, even if you\'re not subscribed to the poster.'); + 'tag, even if you are not subscribed to the poster.'); } else { // TRANS: Tag subscription list text when looking at the subscriptions for a of a user other // TRANS: than the logged in user that has no tag subscriptions. %s is the user nickname. - $message = sprintf(_('%s is not listening to any tags.'), $this->user->nickname); + $message = sprintf(_m('%s is not listening to any tags.'), $this->user->nickname); } } else { diff --git a/plugins/TagSub/tagunsubform.php b/plugins/TagSub/tagunsubform.php index 0b44648071..d26e99a3e5 100644 --- a/plugins/TagSub/tagunsubform.php +++ b/plugins/TagSub/tagunsubform.php @@ -104,6 +104,6 @@ class TagUnsubForm extends TagSubForm function formActions() { - $this->out->submit('submit', _('Unsubscribe'), 'submit', null, _m('Unsubscribe from this tag')); + $this->out->submit('submit', _m('BUTTON','Unsubscribe'), 'submit', null, _m('Unsubscribe from this tag')); } } diff --git a/plugins/Template/TemplatePlugin.php b/plugins/Template/TemplatePlugin.php index 80625c5b70..c013f9f4d1 100644 --- a/plugins/Template/TemplatePlugin.php +++ b/plugins/Template/TemplatePlugin.php @@ -285,7 +285,7 @@ class TemplateAction extends Action header('WWW-Authenticate: Basic realm="StatusNet API"'); // cancelled the browser login form - $this->clientError(_('Authentication error!'), $code = 401); + $this->clientError(_m('Authentication error!'), $code = 401); } else { @@ -299,7 +299,7 @@ class TemplateAction extends Action // verify that user is admin if (!($user->id == 1)) - $this->clientError(_('Only User #1 can update the template.'), $code = 401); + $this->clientError(_m('Only User #1 can update the template.'), $code = 401); // open the old template $tpl_file = $this->templateFolder() . '/index.html'; @@ -316,7 +316,7 @@ class TemplateAction extends Action } else { // bad username and password - $this->clientError(_('Authentication error!'), $code = 401); + $this->clientError(_m('Authentication error!'), $code = 401); } diff --git a/plugins/TwitterBridge/twitterauthorization.php b/plugins/TwitterBridge/twitterauthorization.php index 972fa527d4..1870c6a477 100644 --- a/plugins/TwitterBridge/twitterauthorization.php +++ b/plugins/TwitterBridge/twitterauthorization.php @@ -392,8 +392,8 @@ class TwitterauthorizationAction extends Action _m('1-64 lowercase letters or numbers, no punctuation or spaces')); $this->elementEnd('li'); $this->elementStart('li'); - $this->input('email', _('Email'), $this->getEmail(), - _('Used only for updates, announcements, '. + $this->input('email', _m('LABEL','Email'), $this->getEmail(), + _m('Used only for updates, announcements, '. 'and password recovery')); $this->elementEnd('li'); diff --git a/plugins/UserFlag/adminprofileflag.php b/plugins/UserFlag/adminprofileflag.php index df0450f66a..2f62fa7c41 100644 --- a/plugins/UserFlag/adminprofileflag.php +++ b/plugins/UserFlag/adminprofileflag.php @@ -61,7 +61,7 @@ class AdminprofileflagAction extends Action // User must be logged in. if (!common_logged_in()) { - $this->clientError(_('Not logged in.')); + $this->clientError(_m('Not logged in.')); return; } @@ -85,7 +85,7 @@ class AdminprofileflagAction extends Action // User must have the right to review flags if (!$user->hasRight(UserFlagPlugin::REVIEWFLAGS)) { - $this->clientError(_('You cannot review profile flags.')); + $this->clientError(_m('You cannot review profile flags.')); return false; } diff --git a/plugins/UserLimit/UserLimitPlugin.php b/plugins/UserLimit/UserLimitPlugin.php index ab3187299e..ad2c6e363e 100644 --- a/plugins/UserLimit/UserLimitPlugin.php +++ b/plugins/UserLimit/UserLimitPlugin.php @@ -71,7 +71,8 @@ class UserLimitPlugin extends Plugin $cnt = $cls->count(); if ($cnt >= $this->maxUsers) { - $msg = sprintf(_('Cannot register; maximum number of users (%d) reached.'), + // @todo FIXME: i18n issue. Needs plural. + $msg = sprintf(_m('Cannot register; maximum number of users (%d) reached.'), $this->maxUsers); throw new ClientException($msg); diff --git a/plugins/WikiHashtags/WikiHashtagsPlugin.php b/plugins/WikiHashtags/WikiHashtagsPlugin.php index c6c976b8f4..46ae4bc068 100644 --- a/plugins/WikiHashtags/WikiHashtagsPlugin.php +++ b/plugins/WikiHashtags/WikiHashtagsPlugin.php @@ -81,16 +81,16 @@ class WikiHashtagsPlugin extends Plugin $action->raw($html); $action->elementStart('p'); $action->element('a', array('href' => $editurl, - 'title' => sprintf(_('Edit the article for #%s on WikiHashtags'), $tag)), - _('Edit')); + 'title' => sprintf(_m('Edit the article for #%s on WikiHashtags'), $tag)), + _m('Edit')); $action->element('a', array('href' => 'http://www.gnu.org/copyleft/fdl.html', - 'title' => _('Shared under the terms of the GNU Free Documentation License'), + 'title' => _m('Shared under the terms of the GNU Free Documentation License'), 'rel' => 'license'), 'GNU FDL'); $action->elementEnd('p'); } else { $action->element('a', array('href' => $editurl), - sprintf(_('Start the article for #%s on WikiHashtags'), $tag)); + sprintf(_m('Start the article for #%s on WikiHashtags'), $tag)); } $action->elementEnd('div'); diff --git a/plugins/Xmpp/XmppPlugin.php b/plugins/Xmpp/XmppPlugin.php index 2002541782..f7df6812cf 100644 --- a/plugins/Xmpp/XmppPlugin.php +++ b/plugins/Xmpp/XmppPlugin.php @@ -354,8 +354,9 @@ class XmppPlugin extends ImPlugin $xs->text(" "); $xs->element('a', array( 'href'=>common_local_url('conversation', - array('id' => $notice->conversation)).'#notice-'.$notice->id - ),sprintf(_('[%s]'),$notice->id)); + array('id' => $notice->conversation)).'#notice-'.$notice->id), + // TRANS: %s is a notice ID. + sprintf(_m('[%s]'),$notice->id)); $xs->elementEnd('body'); $xs->elementEnd('html');