Exemple #1
0
 /**
  * Auto detects the locale directory location.
  *
  * @param string $handlerClass  The name of a class implementing the
  *                              Horde_Translation_Handler interface.
  */
 public static function loadHandler($handlerClass)
 {
     if (!static::$_domain) {
         throw new Horde_Translation_Exception('The domain property must be set by the class that extends Horde_Translation_Autodetect.');
     }
     $directory = static::_searchLocaleDirectory();
     if (!$directory) {
         throw new Horde_Translation_Exception(sprintf('Could not found find any locale directory for %s domain.', static::$_domain));
     }
     static::$_directory = $directory;
     parent::loadHandler($handlerClass);
 }
Exemple #2
0
 /**
  * Returns the plural translation of a message.
  *
  * @param string $singular  The singular version to translate.
  * @param string $plural    The plural version to translate.
  * @param integer $number   The number that determines singular vs. plural.
  *
  * @return string  The string translation, or the original string if no
  *                 translation exists.
  */
 public static function ngettext($singular, $plural, $number)
 {
     self::$_domain = 'Horde_Service_Facebook';
     self::$_directory = '@data_dir@' == '@' . 'data_dir' . '@' ? __DIR__ . '/../../../../locale' : '@data_dir@/Horde_Service_Facebook/locale';
     return parent::ngettext($singular, $plural, $number);
 }
Exemple #3
0
 /**
  * Returns the plural translation of a message.
  *
  * @param string $singular  The singular version to translate.
  * @param string $plural    The plural version to translate.
  * @param integer $number   The number that determines singular vs. plural.
  *
  * @return string  The string translation, or the original string if no
  *                 translation exists.
  */
 public static function ngettext($singular, $plural, $number)
 {
     self::$_domain = 'Horde_Imap_Client';
     self::$_directory = '/usr/share/php/data' == '@' . 'data_dir' . '@' ? __DIR__ . '/../../../../locale' : '/usr/share/php/data/Horde_Imap_Client/locale';
     return parent::ngettext($singular, $plural, $number);
 }
Exemple #4
0
 /**
  * Returns the plural translation of a message.
  *
  * @param string $singular  The singular version to translate.
  * @param string $plural    The plural version to translate.
  * @param integer $number   The number that determines singular vs. plural.
  *
  * @return string  The string translation, or the original string if no
  *                 translation exists.
  */
 public static function ngettext($singular, $plural, $number)
 {
     self::$_domain = 'Horde_ActiveSync';
     self::$_directory = '@data_dir@' == '@' . 'data_dir' . '@' ? dirname(__FILE__) . '/../../../locale' : '@data_dir@/Horde_ActiveSync/locale';
     return parent::ngettext($singular, $plural, $number);
 }
Exemple #5
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
namespace {
    // add include path to this apps 3rdparty
    $incPath = __DIR__ . "/../3rdparty";
    set_include_path(get_include_path() . PATH_SEPARATOR . $incPath);
    // load Horde's auto loader
    require_once 'Horde/Autoloader/Default.php';
    // bypass Horde Translation system
    Horde_Translation::setHandler('Horde_Imap_Client', new OC_Translation_Handler());
}
namespace OCA\Mail {
    class App
    {
        /**
         * Extracts all matching contacts with email address and name
         *
         * @param $term
         * @return array
         */
        public static function getMatchingRecipient($term)
        {
            if (!\OCP\Contacts::isEnabled()) {
                return array();
            }
Exemple #6
0
 /**
  * Returns the plural translation of a message.
  *
  * @param string $singular  The singular version to translate.
  * @param string $plural    The plural version to translate.
  * @param integer $number   The number that determines singular vs. plural.
  *
  * @return string  The string translation, or the original string if no
  *                 translation exists.
  */
 public static function ngettext($singular, $plural, $number)
 {
     self::$_domain = 'Horde_Exception';
     self::$_directory = '/usr/share/php/data' == '@' . 'data_dir' . '@' ? dirname(__FILE__) . '/../../../locale' : '/usr/share/php/data/Horde_Exception/locale';
     return parent::ngettext($singular, $plural, $number);
 }
Exemple #7
0
 public static function ngettext($singular, $plural, $number)
 {
     self::$_domain = 'Horde_Other';
     self::$_directory = __DIR__ . '/locale';
     return parent::ngettext($singular, $plural, $number);
 }
Exemple #8
0
<?php

use OCA\Mail\HordeTranslationHandler;
if (@(include_once __DIR__ . '/../vendor/autoload.php') === false) {
    throw new Exception('Cannot include autoload. Did you run install dependencies using composer?');
}
// bypass Horde Translation system
Horde_Translation::setHandler('Horde_Imap_Client', new HordeTranslationHandler());
Horde_Translation::setHandler('Horde_Mime', new HordeTranslationHandler());
Horde_Translation::setHandler('Horde_Smtp', new HordeTranslationHandler());
$l = \OC::$server->getL10N('mail');
$g = \OC::$server->getURLGenerator();
\OC::$server->getNavigationManager()->add(['id' => 'mail', 'order' => 1, 'href' => $g->linkToRoute('mail.page.index'), 'icon' => $g->imagePath('mail', 'mail.svg'), 'name' => $l->t('Mail')]);