]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'testing' into 0.9.x
authorBrion Vibber <brion@pobox.com>
Wed, 10 Mar 2010 17:55:14 +0000 (09:55 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 10 Mar 2010 17:55:14 +0000 (09:55 -0800)
Conflicts:
actions/apistatusnetconfig.php

1  2 
lib/action.php
lib/util.php

diff --combined lib/action.php
index 10394c78956775490e1365cc31b19f4958b0693d,9884f529c9e1b970d3d708d437a2c9ed179aa4e4..491d7d4810e17ee0db73a36ef0bc8702cfb15161
@@@ -426,69 -426,39 +426,69 @@@ class Action extends HTMLOutputter // l
          $this->elementStart('ul', array('class' => 'nav'));
          if (Event::handle('StartPrimaryNav', array($this))) {
              if ($user) {
 +                // TRANS: Tooltip for main menu option "Personal"
 +                $tooltip = _m('TOOLTIP', 'Personal profile and friends timeline');
 +                // TRANS: Main menu option when logged in for access to personal profile and friends timeline
                  $this->menuItem(common_local_url('all', array('nickname' => $user->nickname)),
 -                                _('Home'), _('Personal profile and friends timeline'), false, 'nav_home');
 +                                _m('MENU', 'Personal'), $tooltip, false, 'nav_home');
 +                // TRANS: Tooltip for main menu option "Account"
 +                $tooltip = _m('TOOLTIP', 'Change your email, avatar, password, profile');
 +                // TRANS: Main menu option when logged in for access to user settings
                  $this->menuItem(common_local_url('profilesettings'),
 -                                _('Account'), _('Change your email, avatar, password, profile'), false, 'nav_account');
 +                                _('Account'), $tooltip, false, 'nav_account');
 +                // TRANS: Tooltip for main menu option "Services"
 +                $tooltip = _m('TOOLTIP', 'Connect to services');
 +                // TRANS: Main menu option when logged in and connection are possible for access to options to connect to other services
                  $this->menuItem(common_local_url('oauthconnectionssettings'),
 -                                _('Connect'), _('Connect to services'), false, 'nav_connect');
 +                                _('Connect'), $tooltip, false, 'nav_connect');
                  if ($user->hasRight(Right::CONFIGURESITE)) {
 +                    // TRANS: Tooltip for menu option "Admin"
 +                    $tooltip = _m('TOOLTIP', 'Change site configuration');
 +                    // TRANS: Main menu option when logged in and site admin for access to site configuration
                      $this->menuItem(common_local_url('siteadminpanel'),
 -                                    _('Admin'), _('Change site configuration'), false, 'nav_admin');
 +                                    _m('MENU', 'Admin'), $tooltip, false, 'nav_admin');
                  }
                  if (common_config('invite', 'enabled')) {
 +                    // TRANS: Tooltip for main menu option "Invite"
 +                    $tooltip = _m('TOOLTIP', 'Invite friends and colleagues to join you on %s');
 +                    // TRANS: Main menu option when logged in and invitations are allowed for inviting new users
                      $this->menuItem(common_local_url('invite'),
 -                                    _('Invite'),
 -                                    sprintf(_('Invite friends and colleagues to join you on %s'),
 +                                    _m('MENU', 'Invite'),
 +                                    sprintf($tooltip,
                                              common_config('site', 'name')),
                                      false, 'nav_invitecontact');
                  }
 +                // TRANS: Tooltip for main menu option "Logout"
 +                $tooltip = _m('TOOLTIP', 'Logout from the site');
 +                // TRANS: Main menu option when logged in to log out the current user
                  $this->menuItem(common_local_url('logout'),
 -                                _('Logout'), _('Logout from the site'), false, 'nav_logout');
 +                                _m('MENU', 'Logout'), $tooltip, false, 'nav_logout');
              }
              else {
                  if (!common_config('site', 'closed')) {
 +                    // TRANS: Tooltip for main menu option "Register"
 +                    $tooltip = _m('TOOLTIP', 'Create an account');
 +                    // TRANS: Main menu option when not logged in to register a new account
                      $this->menuItem(common_local_url('register'),
 -                                    _('Register'), _('Create an account'), false, 'nav_register');
 +                                    _m('MENU', 'Register'), $tooltip, false, 'nav_register');
                  }
 +                // TRANS: Tooltip for main menu option "Login"
 +                $tooltip = _m('TOOLTIP', 'Login to the site');
 +                // TRANS: Main menu option when not logged in to log in
                  $this->menuItem(common_local_url('login'),
 -                                _('Login'), _('Login to the site'), false, 'nav_login');
 +                                _m('MENU', 'Login'), $tooltip, false, 'nav_login');
              }
 +            // TRANS: Tooltip for main menu option "Help"
 +            $tooltip = _m('TOOLTIP', 'Help me!');
 +            // TRANS: Main menu option for help on the StatusNet site
              $this->menuItem(common_local_url('doc', array('title' => 'help')),
 -                            _('Help'), _('Help me!'), false, 'nav_help');
 +                            _m('MENU', 'Help'), $tooltip, false, 'nav_help');
              if ($user || !common_config('site', 'private')) {
 +                // TRANS: Tooltip for main menu option "Search"
 +                $tooltip = _m('TOOLTIP', 'Search for people or text');
 +                // TRANS: Main menu option when logged in or when the StatusNet instance is not private
                  $this->menuItem(common_local_url('peoplesearch'),
 -                                _('Search'), _('Search for people or text'), false, 'nav_search');
 +                                _m('MENU', 'Search'), $tooltip, false, 'nav_search');
              }
              Event::handle('EndPrimaryNav', array($this));
          }
          if ($text) {
              $this->elementStart('dl', array('id' => 'site_notice',
                                              'class' => 'system_notice'));
 +            // TRANS: DT element for site notice. String is hidden in default CSS.
              $this->element('dt', null, _('Site notice'));
              $this->elementStart('dd', null);
              $this->raw($text);
      {
          $this->element('dt', array('id' => 'site_statusnet_license'), _('StatusNet software license'));
          $this->elementStart('dd', null);
+         // @fixme drop the final spaces in the messages when at good spot
+         // to let translations get updated.
          if (common_config('site', 'broughtby')) {
              $instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%). ');
          } else {
              $instr = _('**%%site.name%%** is a microblogging service. ');
          }
+         $instr .= ' ';
          $instr .= sprintf(_('It runs the [StatusNet](http://status.net/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION);
          $output = common_markup_to_html($instr);
          $this->raw($output);
diff --combined lib/util.php
index c5dacb699604711db147f4177603627db462aaa8,44ccc0deff546d7c15d107010911fbe706789e37..a30d69100289f08a94ba8e850bbcb1ed6f127e2e
@@@ -52,17 -52,43 +52,43 @@@ function common_init_language(
  {
      mb_internal_encoding('UTF-8');
  
-     // gettext seems very picky... We first need to setlocale()
-     // to a locale which _does_ exist on the system, and _then_
-     // we can set in another locale that may not be set up
-     // (say, ga_ES for Galego/Galician) it seems to take it.
-     common_init_locale("en_US");
      // Note that this setlocale() call may "fail" but this is harmless;
      // gettext will still select the right language.
      $language = common_language();
      $locale_set = common_init_locale($language);
  
+     if (!$locale_set) {
+         // The requested locale doesn't exist on the system.
+         //
+         // gettext seems very picky... We first need to setlocale()
+         // to a locale which _does_ exist on the system, and _then_
+         // we can set in another locale that may not be set up
+         // (say, ga_ES for Galego/Galician) it seems to take it.
+         //
+         // For some reason C and POSIX which are guaranteed to work
+         // don't do the job. en_US.UTF-8 should be there most of the
+         // time, but not guaranteed.
+         $ok = common_init_locale("en_US");
+         if (!$ok) {
+             // Try to find a complete, working locale...
+             // @fixme shelling out feels awfully inefficient
+             // but I don't think there's a more standard way.
+             $all = `locale -a`;
+             foreach (explode("\n", $all) as $locale) {
+                 if (preg_match('/\.utf[-_]?8$/i', $locale)) {
+                     $ok = setlocale(LC_ALL, $locale);
+                     if ($ok) {
+                         break;
+                     }
+                 }
+             }
+             if (!$ok) {
+                 common_log(LOG_ERR, "Unable to find a UTF-8 locale on this system; UI translations may not work.");
+             }
+         }
+         $locale_set = common_init_locale($language);
+     }
      setlocale(LC_CTYPE, 'C');
      // So we do not have to make people install the gettext locales
      $path = common_config('site','locale_path');
@@@ -133,6 -159,11 +159,11 @@@ function common_munge_password($passwor
  
  function common_check_user($nickname, $password)
  {
+     // empty nickname always unacceptable
+     if (empty($nickname)) {
+         return false;
+     }
      $authenticatedUser = false;
  
      if (Event::handle('StartCheckPassword', array($nickname, $password, &$authenticatedUser))) {
@@@ -1462,15 -1493,7 +1493,15 @@@ function common_copy_args($from
      $to = array();
      $strip = get_magic_quotes_gpc();
      foreach ($from as $k => $v) {
 -        $to[$k] = ($strip) ? stripslashes($v) : $v;
 +        if($strip) {
 +            if(is_array($v)) {
 +                $to[$k] = common_copy_args($v);
 +            } else {
 +                $to[$k] = stripslashes($v);
 +            }
 +        } else {
 +            $to[$k] = $v;
 +        }
      }
      return $to;
  }