]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/urlsettings.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / actions / urlsettings.php
index ddf8daa2ae9b7142fc483996c9472db3dfa97706..807f9492c7e94c3c9bcd2d5fd743e41ca5db3996 100644 (file)
@@ -32,7 +32,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/accountsettingsaction.php';
+
 
 /**
  * Miscellaneous settings actions
@@ -47,7 +47,7 @@ require_once INSTALLDIR.'/lib/accountsettingsaction.php';
  * @link     http://status.net/
  */
 
-class UrlsettingsAction extends AccountSettingsAction
+class UrlsettingsAction extends SettingsAction
 {
     /**
      * Title of the page
@@ -68,6 +68,7 @@ class UrlsettingsAction extends AccountSettingsAction
 
     function getInstructions()
     {
+        // TRANS: Instructions for tab "Other" in user profile settings.
         return _('Manage various other options.');
     }
 
@@ -98,24 +99,34 @@ class UrlsettingsAction extends AccountSettingsAction
         $this->hidden('token', common_session_token());
         $this->elementStart('ul', 'form_data');
 
-        $shorteners = array(_('[none]') => array('freeService' => false));
-
         Event::handle('GetUrlShorteners', array(&$shorteners));
 
         $services = array();
-        foreach($shorteners as $name=>$value)
+
+        foreach ($shorteners as $name => $value)
         {
-            $services[$name]=$name;
-            if($value['freeService']){
-                $services[$name].=_(' (free service)');
+            $services[$name] = $name;
+            if ($value['freeService']) {
+                // TRANS: Used as a suffix for free URL shorteners in a dropdown list in the tab "Other" of a
+                // TRANS: user's profile settings. This message has one space at the beginning. Use your
+                // TRANS: language's word separator here if it has one (most likely a single space).
+                $services[$name] .= _(' (free service)');
             }
         }
-        if($services)
-        {
+
+        // Include default values
+
+        $services['none']     = _('[none]');
+        $services['internal'] = _('[internal]');
+
+        if ($services) {
+
             asort($services);
 
             $this->elementStart('li');
+            // TRANS: Label for dropdown with URL shortener services.
             $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
+                            // TRANS: Tooltip for for dropdown with URL shortener services.
                             $services, _('Automatic shortening service to use.'),
                             false, $user->urlshorteningservice);
             $this->elementEnd('li');
@@ -135,7 +146,8 @@ class UrlsettingsAction extends AccountSettingsAction
                      _('URLs in notices longer than this will be shortened, 0 means always shorten.'));
         $this->elementEnd('li');
         $this->elementEnd('ul');
-        $this->submit('save', _('Save'));
+        // TRANS: Button text for saving "Other settings" in profile.
+        $this->submit('save', _m('BUTTON','Save'));
         $this->elementEnd('fieldset');
         $this->elementEnd('form');
     }
@@ -162,7 +174,8 @@ class UrlsettingsAction extends AccountSettingsAction
         $urlshorteningservice = $this->trimmed('urlshorteningservice');
 
         if (!is_null($urlshorteningservice) && strlen($urlshorteningservice) > 50) {
-            $this->showForm(_('URL shortening service is too long (max 50 chars).'));
+            // TRANS: Form validation error for form "Other settings" in user profile.
+            $this->showForm(_('URL shortening service is too long (maximum 50 characters).'));
             return;
         }
 
@@ -192,7 +205,8 @@ class UrlsettingsAction extends AccountSettingsAction
 
         if ($result === false) {
             common_log_db_error($user, 'UPDATE', __FILE__);
-            $this->serverError(_('Couldn\'t update user.'));
+            // TRANS: Server error displayed when "Other" settings in user profile could not be updated on the server.
+            $this->serverError(_('Could not update user.'));
             return;
         }
 
@@ -224,6 +238,7 @@ class UrlsettingsAction extends AccountSettingsAction
 
         $user->query('COMMIT');
 
+        // TRANS: Confirmation message after saving preferences.
         $this->showForm(_('Preferences saved.'), true);
     }
 }