]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/FacebookBridge/actions/facebooksettings.php
ImageFile->resize now totally replaced with resizeTo
[quix0rs-gnu-social.git] / plugins / FacebookBridge / actions / facebooksettings.php
index b9fa7ba2af8cc4739e33dfe3ff1d3c7dc2974ebe..31e020a3ce7a42351856245ae2d13b0a82007946 100644 (file)
@@ -41,8 +41,7 @@ if (!defined('STATUSNET')) {
  *
  * @see      SettingsAction
  */
-class FacebooksettingsAction extends ConnectSettingsAction {
-
+class FacebooksettingsAction extends SettingsAction {
     private $facebook; // Facebook PHP-SDK client obj
     private $flink;
     private $user;
@@ -84,6 +83,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
         $token = $this->trimmed('token');
         if (!$token || $token != common_session_token()) {
             $this->showForm(
+                // TRANS: Client error displayed when the session token does not match or is not given.
                 _m('There was a problem with your session token. Try again, please.')
             );
             return;
@@ -103,7 +103,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
      */
     function title() {
         // TRANS: Page title for Facebook settings.
-        return _m('Facebook settings');
+        return _m('TITLE','Facebook settings');
     }
 
     /**
@@ -112,7 +112,8 @@ class FacebooksettingsAction extends ConnectSettingsAction {
      * @return instructions for use
      */
     function getInstructions() {
-        return _('Facebook settings');
+        // TRANS: Instructions for Facebook settings.
+        return _m('Facebook settings');
     }
 
     /*
@@ -121,7 +122,6 @@ class FacebooksettingsAction extends ConnectSettingsAction {
      * @return void
      */
     function showContent() {
-
         if (!empty($this->flink)) {
 
             $this->elementStart(
@@ -136,6 +136,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
 
             $this->hidden('token', common_session_token());
 
+            // TRANS: Form note. User is connected to facebook.
             $this->element('p', 'form_note', _m('Connected Facebook user'));
 
             $this->elementStart('p', array('class' => 'facebook-user-display'));
@@ -163,6 +164,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
 
             $this->checkbox(
                 'noticesync',
+                // TRANS: Checkbox label in Facebook settings.
                 _m('Publish my notices to Facebook.'),
                 ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true
             );
@@ -173,6 +175,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
 
             $this->checkbox(
                     'replysync',
+                    // TRANS: Checkbox label in Facebook settings.
                     _m('Send "@" replies to Facebook.'),
                     ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true
             );
@@ -190,32 +193,28 @@ class FacebooksettingsAction extends ConnectSettingsAction {
 
             $this->elementStart('fieldset');
 
-            // TRANS: Legend.
+            // TRANS: Fieldset legend for form to disconnect from Facebook.
             $this->element('legend', null, _m('Disconnect my account from Facebook'));
 
             if (empty($this->user->password)) {
-
                 $this->elementStart('p', array('class' => 'form_guide'));
 
                 $msg = sprintf(
-                    _m(
-                        'Disconnecting your Faceboook would make it impossible to '
-                            . 'log in! Please [set a password](%s) first.'
-                    ),
+                    // TRANS: Notice in disconnect from Facebook form if user has no local StatusNet password.
+                    _m('Disconnecting your Faceboook would make it impossible to '.
+                       'log in! Please [set a password](%s) first.'),
                     common_local_url('passwordsettings')
                 );
 
                 $this->raw(common_markup_to_html($msg));
                 $this->elementEnd('p');
-
             } else {
-
-                $msg = sprintf(
-                    _m(
-                        'Keep your %1$s account but disconnect from Facebook. ' .
-                        'You\'ll use your 1%$s password to log in.'
-                    ),
-                    common_config('site', 'name')
+                // @todo FIXME: i18n: This message is not being used.
+                // TRANS: Message displayed when initiating disconnect of a StatusNet user
+                // TRANS: from a Facebook account. %1$s is the StatusNet site name.
+                $msg = sprintf(_m('Keep your %1$s account but disconnect from Facebook. ' .
+                                  'You\'ll use your %1$s password to log in.'),
+                               common_config('site', 'name')
                 );
 
                 // TRANS: Submit button.
@@ -234,7 +233,6 @@ class FacebooksettingsAction extends ConnectSettingsAction {
      * @return void
      */
     function saveSettings() {
-
         $noticesync = $this->boolean('noticesync');
         $replysync  = $this->boolean('replysync');
 
@@ -243,6 +241,7 @@ class FacebooksettingsAction extends ConnectSettingsAction {
         $result = $this->flink->update($original);
 
         if ($result === false) {
+            // TRANS: Notice in case saving of synchronisation preferences fail.
             $this->showForm(_m('There was a problem saving your sync preferences.'));
         } else {
             // TRANS: Confirmation that synchronisation settings have been saved into the system.
@@ -255,17 +254,16 @@ class FacebooksettingsAction extends ConnectSettingsAction {
      * and shows the user a success message if all goes well.
      */
     function disconnect() {
-
         $result = $this->flink->delete();
         $this->flink = null;
 
         if ($result === false) {
             common_log_db_error($user, 'DELETE', __FILE__);
-            $this->serverError(_m('Couldn\'t delete link to Facebook.'));
-            return;
+            // TRANS: Server error displayed when deleting the link to a Facebook account fails.
+            $this->serverError(_m('Could not delete link to Facebook.'));
         }
 
+        // TRANS: Confirmation message. StatusNet account was unlinked from Facebook.
         $this->showForm(_m('You have disconnected from Facebook.'), true);
     }
-
 }