From 86cf457beaed347585b357e4ba089c88c11e55a0 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 22 Oct 2010 19:26:53 +0200 Subject: [PATCH] Convert framework packages to new static translation wrappers. --- framework/Alarm/lib/Horde/Alarm/Handler.php | 21 - .../Alarm/lib/Horde/Alarm/Handler/Desktop.php | 3 +- framework/Alarm/lib/Horde/Alarm/Handler/Mail.php | 6 +- framework/Alarm/lib/Horde/Alarm/Handler/Notify.php | 6 +- framework/Alarm/lib/Horde/Alarm/Translation.php | 50 ++ framework/Alarm/package.xml | 364 +++++++++++- framework/Argv/lib/Horde/Argv/HelpFormatter.php | 16 +- .../Argv/lib/Horde/Argv/IndentedHelpFormatter.php | 2 +- framework/Argv/lib/Horde/Argv/Option.php | 28 +- framework/Argv/lib/Horde/Argv/Parser.php | 31 +- .../Argv/lib/Horde/Argv/TitledHelpFormatter.php | 2 +- framework/Argv/lib/Horde/Argv/Translation.php | 50 ++ framework/Argv/package.xml | 364 +++++++++++- framework/Block/lib/Horde/Block.php | 18 +- framework/Block/lib/Horde/Block/Collection.php | 19 +- framework/Block/lib/Horde/Block/Layout.php | 33 +- framework/Block/lib/Horde/Block/Layout/Manager.php | 17 +- framework/Block/lib/Horde/Block/Layout/View.php | 3 +- framework/Block/lib/Horde/Block/Translation.php | 50 ++ framework/Block/lib/Horde/Block/Ui.php | 22 +- framework/Block/package.xml | 397 ++++++++++++- framework/Cli/lib/Horde/Cli.php | 31 +- framework/Cli/lib/Horde/Cli/Translation.php | 50 ++ framework/Cli/package.xml | 363 +++++++++++- framework/Compress/lib/Horde/Compress.php | 22 - framework/Compress/lib/Horde/Compress/Dbx.php | 6 +- framework/Compress/lib/Horde/Compress/Gzip.php | 6 +- framework/Compress/lib/Horde/Compress/Rar.php | 2 +- framework/Compress/lib/Horde/Compress/Tar.php | 2 +- .../Compress/lib/Horde/Compress/Translation.php | 50 ++ framework/Compress/lib/Horde/Compress/Zip.php | 8 +- framework/Compress/package.xml | 420 ++++++++++++- framework/Core/lib/Horde.php | 34 +- framework/Core/lib/Horde/Core/Ajax/Application.php | 3 +- framework/Core/lib/Horde/Core/Auth/Application.php | 11 +- framework/Core/lib/Horde/Core/Auth/Signup/Base.php | 25 +- framework/Core/lib/Horde/Core/Auth/Signup/Form.php | 20 +- framework/Core/lib/Horde/Core/Factory/History.php | 3 +- framework/Core/lib/Horde/Core/Factory/Prefs.php | 12 +- framework/Core/lib/Horde/Core/Factory/Share.php | 3 +- framework/Core/lib/Horde/Core/Factory/Twitter.php | 3 +- framework/Core/lib/Horde/Core/Factory/Vfs.php | 3 +- .../Core/lib/Horde/Core/Mime/Viewer/Vcard.php | 91 ++- .../Core/lib/Horde/Core/Notification/Status.php | 33 +- framework/Core/lib/Horde/Core/Perms/Ui.php | 60 +- framework/Core/lib/Horde/Core/Prefs/Identity.php | 32 +- framework/Core/lib/Horde/Core/Prefs/Ui.php | 37 +- framework/Core/lib/Horde/Core/Prefs/Ui/Widgets.php | 19 - framework/Core/lib/Horde/Core/Sidebar.php | 13 +- .../lib/Horde/Core/Text/Filter/Highlightquotes.php | 13 +- framework/Core/lib/Horde/Core/Translation.php | 50 ++ framework/Core/lib/Horde/Core/Ui/JsCalendar.php | 61 +- framework/Core/lib/Horde/Core/Ui/Pager.php | 13 +- .../Core/lib/Horde/Core/Ui/VarRenderer/Html.php | 169 +++--- framework/Core/lib/Horde/Help.php | 5 +- framework/Core/lib/Horde/Menu.php | 19 +- framework/Core/lib/Horde/Registry.php | 20 +- framework/Core/lib/Horde/Script/Files.php | 17 +- framework/Core/package.xml | 434 ++++++++++++-- framework/Crypt/lib/Horde/Crypt.php | 15 - framework/Crypt/lib/Horde/Crypt/Pgp.php | 66 +-- framework/Crypt/lib/Horde/Crypt/Smime.php | 132 ++--- framework/Crypt/lib/Horde/Crypt/Translation.php | 50 ++ framework/Crypt/package.xml | 589 +++++++++++++++++- framework/Data/lib/Horde/Data/Base.php | 16 +- framework/Data/lib/Horde/Data/Translation.php | 50 ++ framework/Data/lib/Horde/Data/Tsv.php | 2 +- framework/Data/package.xml | 463 +++++++++++++-- framework/Date/lib/Horde/Date/Recurrence.php | 16 +- framework/Date/lib/Horde/Date/Translation.php | 50 ++ framework/Date/lib/Horde/Date/Utils.php | 20 +- framework/Date/package.xml | 449 +++++++++++++- .../Exception/lib/Horde/Exception/NotFound.php | 9 +- .../lib/Horde/Exception/PermissionDenied.php | 9 +- .../Exception/lib/Horde/Exception/Translation.php | 50 ++ framework/Exception/package.xml | 364 +++++++++++- framework/File_Csv/lib/Horde/File/Csv.php | 5 +- .../File_Csv/lib/Horde/File/Csv/Translation.php | 50 ++ framework/File_Csv/package.xml | 574 +++++++++++++++++- framework/Form/Form.php | 22 +- framework/Form/Form/Renderer.php | 21 +- framework/Form/Form/Translation.php | 50 ++ framework/Form/Form/Type.php | 431 +++++++------- framework/Form/Form/Type/tableset.php | 8 +- framework/Form/Form/Variable.php | 23 +- framework/Form/package.xml | 414 +++++++++++-- .../Icalendar/lib/Horde/Icalendar/Translation.php | 50 ++ framework/Icalendar/lib/Horde/Icalendar/Vevent.php | 3 +- framework/Icalendar/package.xml | 101 +++- framework/Image/lib/Horde/Image/Exif.php | 311 +++++----- framework/Image/lib/Horde/Image/Exif/Base.php | 13 - framework/Image/lib/Horde/Image/Exif/Bundled.php | 30 +- .../Image/lib/Horde/Image/Exif/Parser/Base.php | 22 - .../Image/lib/Horde/Image/Exif/Parser/Canon.php | 220 +++---- .../Image/lib/Horde/Image/Exif/Parser/Fujifilm.php | 118 ++-- .../Image/lib/Horde/Image/Exif/Parser/Nikon.php | 74 +-- .../Image/lib/Horde/Image/Exif/Parser/Olympus.php | 4 +- .../lib/Horde/Image/Exif/Parser/Panasonic.php | 174 +++--- .../Image/lib/Horde/Image/Exif/Parser/Sanyo.php | 6 +- framework/Image/lib/Horde/Image/Translation.php | 50 ++ framework/Image/package.xml | 385 +++++++++++- framework/Itip/lib/Horde/Itip/Event/Vevent.php | 18 +- .../Itip/lib/Horde/Itip/Response/Type/Accept.php | 6 +- .../Itip/lib/Horde/Itip/Response/Type/Base.php | 17 +- .../Itip/lib/Horde/Itip/Response/Type/Decline.php | 6 +- .../lib/Horde/Itip/Response/Type/Tentative.php | 6 +- framework/Itip/package.xml | 356 ++++++++++- framework/Kolab/Kolab.php | 13 +- framework/Kolab/Kolab/Translation.php | 50 ++ framework/Kolab/package.xml | 459 +++++++++++++-- .../lib/Horde/Kolab/Format/Translation.php | 50 ++ .../Kolab_Format/lib/Horde/Kolab/Format/Xml.php | 23 +- framework/Kolab_Format/package.xml | 362 +++++++++++- .../lib/Horde/Kolab/FreeBusy/Driver/Base.php | 19 +- .../Horde/Kolab/FreeBusy/Driver/Freebusy/Base.php | 4 +- .../Horde/Kolab/FreeBusy/Driver/Freebusy/Kolab.php | 4 +- .../lib/Horde/Kolab/FreeBusy/Imap.php | 17 +- .../lib/Horde/Kolab/FreeBusy/Report.php | 25 +- .../lib/Horde/Kolab/FreeBusy/Translation.php | 50 ++ .../lib/Horde/Kolab/FreeBusy/View.php | 24 +- framework/Kolab_FreeBusy/package.xml | 364 +++++++++++- .../Kolab_Resource/lib/Horde/Kolab/Resource.php | 31 +- .../lib/Horde/Kolab/Resource/Translation.php | 50 ++ framework/Kolab_Resource/package.xml | 375 +++++++++++- .../Kolab_Storage/lib/Horde/Kolab/Storage/Data.php | 25 +- .../lib/Horde/Kolab/Storage/Translation.php | 50 ++ framework/Kolab_Storage/package.xml | 364 +++++++++++- framework/LoginTasks/lib/Horde/LoginTasks.php | 19 +- .../lib/Horde/LoginTasks/Translation.php | 50 ++ framework/LoginTasks/package.xml | 371 +++++++++++- framework/Mime/lib/Horde/Mime/Headers.php | 22 +- framework/Mime/lib/Horde/Mime/Mail.php | 21 +- framework/Mime/lib/Horde/Mime/Mdn.php | 20 +- framework/Mime/lib/Horde/Mime/Translation.php | 50 ++ framework/Mime/package.xml | 446 +++++++++++++- .../Mime_Viewer/lib/Horde/Mime/Viewer/Base.php | 15 - .../Mime_Viewer/lib/Horde/Mime/Viewer/Msword.php | 2 +- .../Mime_Viewer/lib/Horde/Mime/Viewer/Rar.php | 20 +- .../Mime_Viewer/lib/Horde/Mime/Viewer/Rfc822.php | 14 +- .../Mime_Viewer/lib/Horde/Mime/Viewer/Rtf.php | 2 +- .../Mime_Viewer/lib/Horde/Mime/Viewer/Tgz.php | 16 +- .../lib/Horde/Mime/Viewer/Translation.php | 50 ++ .../lib/Horde/Mime/Viewer/Wordperfect.php | 2 +- .../Mime_Viewer/lib/Horde/Mime/Viewer/Zip.php | 18 +- framework/Mime_Viewer/package.xml | 341 ++++++++++- framework/Model/lib/Horde/Form.php | 347 ++++++----- framework/Model/lib/Horde/Form/Renderer.php | 19 +- framework/Model/lib/Horde/Form/Renderer/Xhtml.php | 6 +- framework/Model/lib/Horde/Form/Type.php | 17 +- framework/Model/lib/Horde/Form/Type/Color.php | 4 +- framework/Model/lib/Horde/Form/Type/CreditCard.php | 4 +- framework/Model/lib/Horde/Form/Type/Date.php | 12 +- framework/Model/lib/Horde/Form/Type/Email.php | 16 +- framework/Model/lib/Horde/Form/Type/Enum.php | 4 +- framework/Model/lib/Horde/Form/Type/Int.php | 4 +- framework/Model/lib/Horde/Form/Type/Number.php | 4 +- framework/Model/lib/Horde/Form/Type/Octal.php | 4 +- framework/Model/lib/Horde/Form/Type/Password.php | 6 +- framework/Model/lib/Horde/Form/Type/Phone.php | 4 +- framework/Model/lib/Horde/Form/Type/Set.php | 6 +- framework/Model/lib/Horde/Form/Type/String.php | 6 +- framework/Model/lib/Horde/Form/Type/Time.php | 4 +- .../Model/lib/Horde/Form/VarRenderer/Xhtml.php | 147 ++--- framework/Model/lib/Horde/Model/Translation.php | 50 ++ framework/Net_IMSP/IMSP.php | 14 +- framework/Net_IMSP/IMSP/Auth.php | 25 +- framework/Net_IMSP/IMSP/Book.php | 14 +- framework/Net_IMSP/IMSP/Translation.php | 50 ++ framework/Net_IMSP/package.xml | 463 +++++++++++++-- framework/Nls/lib/Horde/Nls/Countries.php | 480 ++++++++------- framework/Nls/lib/Horde/Nls/Geoip.php | 26 +- framework/Nls/lib/Horde/Nls/Tld.php | 502 ++++++++-------- framework/Nls/lib/Horde/Nls/Translation.php | 50 ++ framework/Nls/package.xml | 419 ++++++++++++- framework/Perms/lib/Horde/Perms.php | 26 +- framework/Perms/lib/Horde/Perms/Translation.php | 50 ++ framework/Perms/package.xml | 445 ++++++++++++-- framework/Prefs/lib/Horde/Prefs.php | 12 - .../Prefs/lib/Horde/Prefs/CategoryManager.php | 20 +- framework/Prefs/lib/Horde/Prefs/Identity.php | 17 +- framework/Prefs/lib/Horde/Prefs/Translation.php | 50 ++ framework/Prefs/package.xml | 462 +++++++++++++-- framework/Rpc/lib/Horde/Rpc.php | 13 - framework/Rpc/lib/Horde/Rpc/Phpgw.php | 10 +- framework/Rpc/lib/Horde/Rpc/Soap.php | 4 +- framework/Rpc/lib/Horde/Rpc/Translation.php | 50 ++ framework/Rpc/lib/Horde/Rpc/Webdav.php | 6 +- framework/Rpc/package.xml | 428 +++++++++++++- .../lib/Horde/Service/Facebook/Request.php | 11 +- .../lib/Horde/Service/Facebook/Translation.php | 50 ++ .../lib/Horde/Service/Facebook/UploadRequest.php | 8 +- framework/Service_Facebook/package.xml | 454 ++++++++++++-- .../Service_Scribd/lib/Horde/Block/Scribd.php | 34 +- .../lib/Horde/Service/Scribd/Translation.php | 50 ++ framework/Service_Scribd/package.xml | 403 ++++++++++++- framework/Share/lib/Horde/Share.php | 16 +- framework/Share/lib/Horde/Share/Kolab.php | 4 +- framework/Share/lib/Horde/Share/Object/Kolab.php | 33 +- framework/Share/lib/Horde/Share/Sql.php | 4 +- .../Share/lib/Horde/Share/Sql/Hierarchical.php | 2 +- framework/Share/lib/Horde/Share/Translation.php | 50 ++ framework/Share/package.xml | 378 +++++++++++- framework/SyncML/SyncML/Backend.php | 14 - framework/SyncML/SyncML/Translation.php | 50 ++ framework/SyncML/package.xml | 655 ++++++++++++++++++++- .../Text_Filter/lib/Horde/Text/Filter/Base.php | 12 - .../lib/Horde/Text/Filter/Html2text.php | 4 +- .../lib/Horde/Text/Filter/Translation.php | 50 ++ framework/Text_Filter/package.xml | 372 +++++++++++- framework/VFS/lib/VFS.php | 12 - framework/VFS/lib/VFS/Translation.php | 50 ++ framework/VFS/lib/VFS/smb.php | 4 +- framework/VFS/lib/VFS/sql_file.php | 2 +- framework/VFS/package.xml | 616 +++++++++++++++---- framework/VFS_ISOWriter/ISOWriter.php | 16 +- .../VFS_ISOWriter/ISOWriter/RealInputStrategy.php | 16 +- .../ISOWriter/RealInputStrategy/copy.php | 14 +- .../VFS_ISOWriter/ISOWriter/RealOutputStrategy.php | 19 +- .../ISOWriter/RealOutputStrategy/copy.php | 2 +- .../ISOWriter/RealOutputStrategy/direct.php | 2 +- framework/VFS_ISOWriter/ISOWriter/Translation.php | 50 ++ framework/VFS_ISOWriter/ISOWriter/mkisofs.php | 4 +- framework/VFS_ISOWriter/package.xml | 436 +++++++++++++- 223 files changed, 17696 insertions(+), 3922 deletions(-) create mode 100644 framework/Alarm/lib/Horde/Alarm/Translation.php create mode 100644 framework/Argv/lib/Horde/Argv/Translation.php create mode 100644 framework/Block/lib/Horde/Block/Translation.php create mode 100644 framework/Cli/lib/Horde/Cli/Translation.php create mode 100644 framework/Compress/lib/Horde/Compress/Translation.php create mode 100644 framework/Core/lib/Horde/Core/Translation.php create mode 100644 framework/Crypt/lib/Horde/Crypt/Translation.php create mode 100644 framework/Data/lib/Horde/Data/Translation.php create mode 100644 framework/Date/lib/Horde/Date/Translation.php create mode 100644 framework/Exception/lib/Horde/Exception/Translation.php create mode 100644 framework/File_Csv/lib/Horde/File/Csv/Translation.php create mode 100644 framework/Form/Form/Translation.php create mode 100644 framework/Icalendar/lib/Horde/Icalendar/Translation.php create mode 100644 framework/Image/lib/Horde/Image/Translation.php create mode 100644 framework/Kolab/Kolab/Translation.php create mode 100644 framework/Kolab_Format/lib/Horde/Kolab/Format/Translation.php create mode 100644 framework/Kolab_FreeBusy/lib/Horde/Kolab/FreeBusy/Translation.php create mode 100644 framework/Kolab_Resource/lib/Horde/Kolab/Resource/Translation.php create mode 100644 framework/Kolab_Storage/lib/Horde/Kolab/Storage/Translation.php create mode 100644 framework/LoginTasks/lib/Horde/LoginTasks/Translation.php create mode 100644 framework/Mime/lib/Horde/Mime/Translation.php create mode 100644 framework/Mime_Viewer/lib/Horde/Mime/Viewer/Translation.php create mode 100644 framework/Model/lib/Horde/Model/Translation.php create mode 100644 framework/Net_IMSP/IMSP/Translation.php create mode 100644 framework/Nls/lib/Horde/Nls/Translation.php create mode 100644 framework/Perms/lib/Horde/Perms/Translation.php create mode 100644 framework/Prefs/lib/Horde/Prefs/Translation.php create mode 100644 framework/Rpc/lib/Horde/Rpc/Translation.php create mode 100644 framework/Service_Facebook/lib/Horde/Service/Facebook/Translation.php create mode 100644 framework/Service_Scribd/lib/Horde/Service/Scribd/Translation.php create mode 100644 framework/Share/lib/Horde/Share/Translation.php create mode 100644 framework/SyncML/SyncML/Translation.php create mode 100644 framework/Text_Filter/lib/Horde/Text/Filter/Translation.php create mode 100644 framework/VFS/lib/VFS/Translation.php create mode 100644 framework/VFS_ISOWriter/ISOWriter/Translation.php diff --git a/framework/Alarm/lib/Horde/Alarm/Handler.php b/framework/Alarm/lib/Horde/Alarm/Handler.php index 8dafdca73..a45d330ad 100644 --- a/framework/Alarm/lib/Horde/Alarm/Handler.php +++ b/framework/Alarm/lib/Horde/Alarm/Handler.php @@ -25,27 +25,6 @@ abstract class Horde_Alarm_Handler public $alarm; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** - * Constructor. - * - * @param array $params Any parameters that the handler might need. - */ - public function __construct(array $params = null) - { - if (isset($params['translation'])) { - $this->_dict = $params['translation']; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Alarm', dirname(__FILE__) . '/../../../locale'); - } - } - - /** * Notifies about an alarm. * * @param array $alarm An alarm hash. diff --git a/framework/Alarm/lib/Horde/Alarm/Handler/Desktop.php b/framework/Alarm/lib/Horde/Alarm/Handler/Desktop.php index 8198ab416..87d4359d3 100644 --- a/framework/Alarm/lib/Horde/Alarm/Handler/Desktop.php +++ b/framework/Alarm/lib/Horde/Alarm/Handler/Desktop.php @@ -43,7 +43,6 @@ class Horde_Alarm_Handler_Desktop extends Horde_Alarm_Handler */ public function __construct(array $params = null) { - parent::__construct($params); /* if (!isset($params['js_notify'])) { throw new InvalidArgumentException('Parameter \'js_notify\' missing.'); @@ -83,6 +82,6 @@ class Horde_Alarm_Handler_Desktop extends Horde_Alarm_Handler */ public function getDescription() { - return $this->_dict->t("Desktop notification (with certain browsers)"); + return Horde_Alarm_Translation::t("Desktop notification (with certain browsers)"); } } diff --git a/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php b/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php index c35ee653d..1b89ffb8c 100644 --- a/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php +++ b/framework/Alarm/lib/Horde/Alarm/Handler/Mail.php @@ -42,8 +42,6 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler */ public function __construct(array $params = null) { - parent::__construct($params); - foreach (array('identity', 'mail') as $param) { if (!isset($params[$param])) { throw new Horde_Alarm_Exception('Parameter \'' . $param . '\' missing.'); @@ -115,7 +113,7 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler */ public function getDescription() { - return $this->_dict->t("Email"); + return Horde_Alarm_Translation::t("Email"); } /** @@ -135,7 +133,7 @@ class Horde_Alarm_Handler_Mail extends Horde_Alarm_Handler return array( 'email' => array( 'type' => 'text', - 'desc' => $this->_dict->t("Email address (optional)"), + 'desc' => Horde_Alarm_Translation::t("Email address (optional)"), 'required' => false)); } } diff --git a/framework/Alarm/lib/Horde/Alarm/Handler/Notify.php b/framework/Alarm/lib/Horde/Alarm/Handler/Notify.php index 90cd4ba01..ab531563a 100644 --- a/framework/Alarm/lib/Horde/Alarm/Handler/Notify.php +++ b/framework/Alarm/lib/Horde/Alarm/Handler/Notify.php @@ -41,8 +41,6 @@ class Horde_Alarm_Handler_Notify extends Horde_Alarm_Handler */ public function __construct(array $params = null) { - parent::__construct($params); - /* if (!isset($params['notification'])) { throw new Horde_Alarm_Exception('Parameter \'notification\' missing.'); @@ -78,7 +76,7 @@ class Horde_Alarm_Handler_Notify extends Horde_Alarm_Handler */ public function getDescription() { - return $this->_dict->t("Inline"); + return Horde_Alarm_Translation::t("Inline"); } /** @@ -98,7 +96,7 @@ class Horde_Alarm_Handler_Notify extends Horde_Alarm_Handler return array( 'sound' => array( 'type' => 'sound', - 'desc' => $this->_dict->t("Play a sound?"), + 'desc' => Horde_Alarm_Translation::t("Play a sound?"), 'required' => false)); } } diff --git a/framework/Alarm/lib/Horde/Alarm/Translation.php b/framework/Alarm/lib/Horde/Alarm/Translation.php new file mode 100644 index 000000000..034ce63fb --- /dev/null +++ b/framework/Alarm/lib/Horde/Alarm/Translation.php @@ -0,0 +1,50 @@ + + * @package Alarm + */ +class Horde_Alarm_Translation extends Horde_Translation +{ + /** + * Returns the translation of a message. + * + * @var string $message The string to translate. + * + * @return string The string translation, or the original string if no + * translation exists. + */ + static public function t($message) + { + self::$_domain = 'Horde_Alarm'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Alarm/locale'; + return parent::t($message); + } + + /** + * 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. + */ + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Alarm'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Alarm/locale'; + return parent::ngettext($singular, $plural, $number); + } +} diff --git a/framework/Alarm/package.xml b/framework/Alarm/package.xml index 799a54c20..8e6337347 100644 --- a/framework/Alarm/package.xml +++ b/framework/Alarm/package.xml @@ -1,5 +1,5 @@ - + Alarm pear.horde.org Horde alarm libraries @@ -13,8 +13,8 @@ jan@horde.org yes - 2010-05-17 - + 2010-10-22 + 0.2.0 0.2.0 @@ -42,10 +42,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -87,6 +351,10 @@ Exception pear.horde.org + + Translation + pear.horde.org + @@ -123,9 +391,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -160,7 +516,7 @@ beta beta - 2010-05-17 + 2010-10-22 LGPL * Initial Horde 4 package. diff --git a/framework/Argv/lib/Horde/Argv/HelpFormatter.php b/framework/Argv/lib/Horde/Argv/HelpFormatter.php index 772d9a7f9..8ab39b60d 100644 --- a/framework/Argv/lib/Horde/Argv/HelpFormatter.php +++ b/framework/Argv/lib/Horde/Argv/HelpFormatter.php @@ -61,23 +61,9 @@ abstract class Horde_Argv_HelpFormatter public $parser = null; - /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - public function __construct($indent_increment, $max_help_position, - $width = null, $short_first = false, - $dict = null) + $width = null, $short_first = false) { - if ($dict) { - $this->_dict = $dict; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Argv', dirname(__FILE__) . '/../../../locale'); - } - $this->indent_increment = $indent_increment; $this->help_position = $this->max_help_position = $max_help_position; if (is_null($width)) { diff --git a/framework/Argv/lib/Horde/Argv/IndentedHelpFormatter.php b/framework/Argv/lib/Horde/Argv/IndentedHelpFormatter.php index bff6815d1..6cd9b579e 100644 --- a/framework/Argv/lib/Horde/Argv/IndentedHelpFormatter.php +++ b/framework/Argv/lib/Horde/Argv/IndentedHelpFormatter.php @@ -26,7 +26,7 @@ class Horde_Argv_IndentedHelpFormatter extends Horde_Argv_HelpFormatter public function formatUsage($usage) { - return sprintf($this->_dict->t("Usage:") . " %s\n", $usage); + return sprintf(Horde_Argv_Translation::t("Usage:") . " %s\n", $usage); } public function formatHeading($heading) diff --git a/framework/Argv/lib/Horde/Argv/Option.php b/framework/Argv/lib/Horde/Argv/Option.php index 85dc9ed99..27137244d 100644 --- a/framework/Argv/lib/Horde/Argv/Option.php +++ b/framework/Argv/lib/Horde/Argv/Option.php @@ -40,13 +40,6 @@ class Horde_Argv_Option */ public static $NO_DEFAULT = array('NO', 'DEFAULT'); - /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - public static function parseNumber($value) { if (!strlen($value)) { @@ -98,8 +91,8 @@ class Horde_Argv_Option $number = self::parseNumber($value); if ($number === false) { $message = $this->type == 'int' - ? $this->_dict->t("option %s: invalid integer value: '%s'") - : $this->_dict->t("option %s: invalid long integer value: '%s'"); + ? Horde_Argv_Translation::t("option %s: invalid integer value: '%s'") + : Horde_Argv_Translation::t("option %s: invalid long integer value: '%s'"); throw new Horde_Argv_OptionValueException( sprintf($message, $opt, $value)); } @@ -108,7 +101,7 @@ class Horde_Argv_Option case 'float': if (!is_numeric($value)) { throw new Horde_Argv_OptionValueException( - sprintf($this->_dict->t("option %s: invalid floating-point value: '%s'"), + sprintf(Horde_Argv_Translation::t("option %s: invalid floating-point value: '%s'"), $opt, $value)); } return floatval($value); @@ -126,7 +119,7 @@ class Horde_Argv_Option } $choices = "'" . implode("', '", $choices) . "'"; throw new Horde_Argv_OptionValueException(sprintf( - $this->_dict->t("option %s: invalid choice: '%s' (choose from %s)"), + Horde_Argv_Translation::t("option %s: invalid choice: '%s' (choose from %s)"), $opt, $value, $choices)); } } @@ -259,8 +252,6 @@ class Horde_Argv_Option */ public function __construct() { - $this->_dict = new Horde_Translation_Gettext('Horde_Argv', dirname(__FILE__) . '/../../../locale'); - // The last argument to this function is an $attrs hash, if it // is present and an array. All other arguments are $opts. $opts = func_get_args(); @@ -291,17 +282,6 @@ class Horde_Argv_Option } } - /** - * Passes a translation handler. - * - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. - */ - public function setDictionary($dict) - { - $this->_dict = $dict; - } - protected function _checkOptStrings($opts) { // Filter out None because early versions of Optik had exactly diff --git a/framework/Argv/lib/Horde/Argv/Parser.php b/framework/Argv/lib/Horde/Argv/Parser.php index 149a45c05..522b79a7c 100644 --- a/framework/Argv/lib/Horde/Argv/Parser.php +++ b/framework/Argv/lib/Horde/Argv/Parser.php @@ -77,21 +77,8 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer protected $_usage; public $optionGroups = array(); - /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - public function __construct($args = array()) { - if (isset($args['translation'])) { - $this->_dict = $args['translation']; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Argv', dirname(__FILE__) . '/../../../locale'); - } - $args = array_merge(array( 'usage' => null, 'optionList' => null, @@ -162,13 +149,13 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer protected function _addHelpOption() { $this->addOption('-h', '--help', array('action' => 'help', - 'help' => $this->_dict->t("show this help message and exit"))); + 'help' => Horde_Argv_Translation::t("show this help message and exit"))); } protected function _addVersionOption() { $this->addOption('--version', array('action' => 'version', - 'help' => $this->_dict->t("show program's version number and exit"))); + 'help' => Horde_Argv_Translation::t("show program's version number and exit"))); } protected function _populateOptionList($optionList, $add_help = true) @@ -196,7 +183,7 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer public function setUsage($usage) { if (is_null($usage)) - $this->_usage = '%prog ' . $this->_dict->t("[options]"); + $this->_usage = '%prog ' . Horde_Argv_Translation::t("[options]"); elseif ($usage == Horde_Argv_Option::SUPPRESS_USAGE) $this->_usage = null; else @@ -492,9 +479,9 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer if (count($rargs) < $nargs) { if (!$option->hasDefault()) { if ($nargs == 1) { - $this->parserError(sprintf($this->_dict->t("%s option requires an argument"), $opt)); + $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires an argument"), $opt)); } else { - $this->parserError(sprintf($this->_dict->t("%s option requires %d arguments"), $opt, $nargs)); + $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires %d arguments"), $opt, $nargs)); } } } elseif ($nargs == 1) { @@ -504,7 +491,7 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer } } elseif ($had_explicit_value) { - $this->parserError(sprintf($this->_dict->t("%s option does not take a value"), $opt)); + $this->parserError(sprintf(Horde_Argv_Translation::t("%s option does not take a value"), $opt)); } else { $value = null; @@ -544,9 +531,9 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer if (count($rargs) < $nargs) { if (!$option->hasDefault()) { if ($nargs == 1) { - $this->parserError(sprintf($this->_dict->t("%s option requires an argument"), $opt)); + $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires an argument"), $opt)); } else { - $this->parserError(sprintf($this->_dict->t("%s option requires %d arguments"), $opt, $nargs)); + $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires %d arguments"), $opt, $nargs)); } } } elseif ($nargs == 1) { @@ -669,7 +656,7 @@ class Horde_Argv_Parser extends Horde_Argv_OptionContainer $formatter = $this->formatter; $formatter->storeOptionStrings($this); $result = array(); - $result[] = $formatter->formatHeading($this->_dict->t("Options")); + $result[] = $formatter->formatHeading(Horde_Argv_Translation::t("Options")); $formatter->indent(); if ($this->optionList) { $result[] = parent::formatOptionHelp($formatter); diff --git a/framework/Argv/lib/Horde/Argv/TitledHelpFormatter.php b/framework/Argv/lib/Horde/Argv/TitledHelpFormatter.php index 800fafb2b..a283d3e64 100644 --- a/framework/Argv/lib/Horde/Argv/TitledHelpFormatter.php +++ b/framework/Argv/lib/Horde/Argv/TitledHelpFormatter.php @@ -26,7 +26,7 @@ class Horde_Argv_TitledHelpFormatter extends Horde_Argv_HelpFormatter public function formatUsage($usage) { - return sprintf("%s %s\n", $this->formatHeading($this->_dict->t("Usage")), $usage); + return sprintf("%s %s\n", $this->formatHeading(Horde_Argv_Translation::t("Usage")), $usage); } public function formatHeading($heading) diff --git a/framework/Argv/lib/Horde/Argv/Translation.php b/framework/Argv/lib/Horde/Argv/Translation.php new file mode 100644 index 000000000..51387aa99 --- /dev/null +++ b/framework/Argv/lib/Horde/Argv/Translation.php @@ -0,0 +1,50 @@ + + * @package Argv + */ +class Horde_Argv_Translation extends Horde_Translation +{ + /** + * Returns the translation of a message. + * + * @var string $message The string to translate. + * + * @return string The string translation, or the original string if no + * translation exists. + */ + static public function t($message) + { + self::$_domain = 'Horde_Argv'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Argv/locale'; + return parent::t($message); + } + + /** + * 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. + */ + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Argv'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Argv/locale'; + return parent::ngettext($singular, $plural, $number); + } +} diff --git a/framework/Argv/package.xml b/framework/Argv/package.xml index 7723805b5..cb9878a36 100644 --- a/framework/Argv/package.xml +++ b/framework/Argv/package.xml @@ -1,5 +1,5 @@ - + Argv pear.horde.org Horde command-line argument parsing package @@ -18,8 +18,8 @@ mike@maintainable.com yes - 2010-03-18 - + 2010-10-22 + 0.1.0 0.1.0 @@ -50,10 +50,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -105,6 +369,10 @@ 1.5.0 + + Translation + pear.horde.org + @@ -122,7 +390,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -170,7 +526,7 @@ beta beta - 2010-03-18 + 2010-10-22 BSD * Initial release, ported from Optik (http://optik.sourceforge.net/) diff --git a/framework/Block/lib/Horde/Block.php b/framework/Block/lib/Horde/Block.php index 006002f16..fcaf444da 100644 --- a/framework/Block/lib/Horde/Block.php +++ b/framework/Block/lib/Horde/Block.php @@ -51,31 +51,15 @@ class Horde_Block protected $_app; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** * Constructor. * * @param array|boolean $params Any parameters the block needs. If false, * the default parameter will be used. * @param integer $row The block row. * @param integer $col The block column. - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. */ - public function __construct($params = array(), $row = null, $col = null, - $dict = null) + public function __construct($params = array(), $row = null, $col = null) { - if ($dict) { - $this->_dict = $dict; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Block', dirname(__FILE__) . '/../../locale'); - } - // @todo: we can't simply merge the default values and stored values // because empty parameter values are not stored at all, so they would // always be overwritten by the defaults. diff --git a/framework/Block/lib/Horde/Block/Collection.php b/framework/Block/lib/Horde/Block/Collection.php index d958e3f6a..c5d29ec14 100644 --- a/framework/Block/lib/Horde/Block/Collection.php +++ b/framework/Block/lib/Horde/Block/Collection.php @@ -38,13 +38,6 @@ class Horde_Block_Collection protected $_blocks = array(); /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** * Returns a single instance of the Horde_Blocks class. * * @param array $apps The applications whose blocks to list. @@ -67,19 +60,11 @@ class Horde_Block_Collection * Constructor. * * @param array $apps The applications whose blocks to list. - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. */ - public function __construct($apps = array(), $dict = null) + public function __construct($apps = array()) { global $session; - if ($dict) { - $this->_dict = $dict; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Block', dirname(__FILE__) . '/../../../locale'); - } - $signature = serialize($apps); if ($this->_blocks = $session['horde:blocks/' . $signature]) { return; @@ -408,7 +393,7 @@ class Horde_Block_Collection { return isset($this->_blocks[$app][$block]) ? $this->_blocks[$app][$block]['name'] - : sprintf($this->_dict->t("Block \"%s\" of application \"%s\" not found."), $block, $app); + : sprintf(Horde_Block_Translation::t("Block \"%s\" of application \"%s\" not found."), $block, $app); } /** diff --git a/framework/Block/lib/Horde/Block/Layout.php b/framework/Block/lib/Horde/Block/Layout.php index 2303a6670..7e97410e1 100644 --- a/framework/Block/lib/Horde/Block/Layout.php +++ b/framework/Block/lib/Horde/Block/Layout.php @@ -31,29 +31,6 @@ class Horde_Block_Layout protected $_viewUrl; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** - * Constructor. - * - * @param array $params Hash with configuration data. Possible values: - * - 'translation': A translation handler - * implementing Horde_Translation. - */ - public function __construct($params = array()) - { - if (isset($params['translation'])) { - $this->_dict = $params['translation']; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Block', dirname(__FILE__) . '/../../../locale'); - } - } - - /** * Returns whether the specified block may be removed. * * @param integer $row A layout row. @@ -127,17 +104,17 @@ class Horde_Block_Layout $icons = ''; if ($edit) { $icons .= Horde::link($this->getActionUrl('edit', $row, $col), - $this->_dict->t("Edit")) - . Horde::img('edit.png', $this->_dict->t("Edit")) + Horde_Block_Translation::t("Edit")) + . Horde::img('edit.png', Horde_Block_Translation::t("Edit")) . ''; } if ($this->isRemovable($row, $col)) { $icons .= Horde::link( - $this->getActionUrl('removeBlock', $row, $col), $this->_dict->t("Remove"), + $this->getActionUrl('removeBlock', $row, $col), Horde_Block_Translation::t("Remove"), '', '', 'return window.confirm(\'' - . addslashes($this->_dict->t("Really delete this block?")) . '\')') - . Horde::img('delete.png', $this->_dict->t("Remove")) + . addslashes(Horde_Block_Translation::t("Really delete this block?")) . '\')') + . Horde::img('delete.png', Horde_Block_Translation::t("Remove")) . ''; } return $icons; diff --git a/framework/Block/lib/Horde/Block/Layout/Manager.php b/framework/Block/lib/Horde/Block/Layout/Manager.php index e740a6579..8460f261f 100644 --- a/framework/Block/lib/Horde/Block/Layout/Manager.php +++ b/framework/Block/lib/Horde/Block/Layout/Manager.php @@ -103,7 +103,6 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout */ function __construct($collection, $layout = array()) { - parent::__construct(); $this->_collection = $collection; $this->_layout = $layout; $this->_editUrl = Horde::selfUrl(); @@ -118,7 +117,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout } for ($col = 0; $col < $cols; $col++) { if (!isset($this->_layout[$row][$col])) { - $this->_blocks[$row][$col] = PEAR::raiseError($this->_dict->t("No block exists at the requested position"), 'horde.error'); + $this->_blocks[$row][$col] = PEAR::raiseError(Horde_Block_Translation::t("No block exists at the requested position"), 'horde.error'); } elseif (is_array($this->_layout[$row][$col])) { $field = $this->_layout[$row][$col]; @@ -242,7 +241,7 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout try { $message = Horde::callHook('perms_denied', array('horde:max_blocks')); } catch (Horde_Exception_HookNotSet $e) { - $message = htmlspecialchars(sprintf($this->_dict->ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks)); + $message = htmlspecialchars(sprintf(Horde_Block_Translation::ngettext("You are not allowed to create more than %d block.", "You are not allowed to create more than %d blocks.", $max_blocks), $max_blocks)); } $GLOBALS['notification']->push($message, 'horde.error', array('content.raw')); break; @@ -573,12 +572,12 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout switch ($type[0]) { case 'expand': - $title = $this->_dict->t("Expand"); + $title = Horde_Block_Translation::t("Expand"); $img = 'large_' . $type[1]; break; case 'shrink': - $title = $this->_dict->t("Shrink"); + $title = Horde_Block_Translation::t("Shrink"); $img = 'large_'; switch ($type[1]) { @@ -603,19 +602,19 @@ class Horde_Block_Layout_Manager extends Horde_Block_Layout case 'move': switch ($type[1]) { case 'up': - $title = $this->_dict->t("Move Up"); + $title = Horde_Block_Translation::t("Move Up"); break; case 'down': - $title = $this->_dict->t("Move Down"); + $title = Horde_Block_Translation::t("Move Down"); break; case 'left': - $title = $this->_dict->t("Move Left"); + $title = Horde_Block_Translation::t("Move Left"); break; case 'right': - $title = $this->_dict->t("Move Right"); + $title = Horde_Block_Translation::t("Move Right"); break; } diff --git a/framework/Block/lib/Horde/Block/Layout/View.php b/framework/Block/lib/Horde/Block/Layout/View.php index 3dc51b973..1db15d147 100644 --- a/framework/Block/lib/Horde/Block/Layout/View.php +++ b/framework/Block/lib/Horde/Block/Layout/View.php @@ -41,7 +41,6 @@ class Horde_Block_Layout_View extends Horde_Block_Layout public function __construct($layout = array(), $editUrl = '', $viewUrl = '') { - parent::__construct(); $this->_layout = $layout; $this->_editUrl = $editUrl; $this->_viewUrl = $viewUrl; @@ -95,7 +94,7 @@ class Horde_Block_Layout_View extends Horde_Block_Layout $html .= ' '; } } catch (Horde_Exception $e) { - $header = $this->_dict->t("Error"); + $header = Horde_Block_Translation::t("Error"); $content = $e->getMessage(); ob_start(); include $tplDir . '/portal/block.inc'; diff --git a/framework/Block/lib/Horde/Block/Translation.php b/framework/Block/lib/Horde/Block/Translation.php new file mode 100644 index 000000000..7affcf2f0 --- /dev/null +++ b/framework/Block/lib/Horde/Block/Translation.php @@ -0,0 +1,50 @@ + + * @package Block + */ +class Horde_Block_Translation extends Horde_Translation +{ + /** + * Returns the translation of a message. + * + * @var string $message The string to translate. + * + * @return string The string translation, or the original string if no + * translation exists. + */ + static public function t($message) + { + self::$_domain = 'Horde_Block'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Block/locale'; + return parent::t($message); + } + + /** + * 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. + */ + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Block'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Block/locale'; + return parent::ngettext($singular, $plural, $number); + } +} diff --git a/framework/Block/lib/Horde/Block/Ui.php b/framework/Block/lib/Horde/Block/Ui.php index 6f9e0e80e..0bdc3b282 100644 --- a/framework/Block/lib/Horde/Block/Ui.php +++ b/framework/Block/lib/Horde/Block/Ui.php @@ -35,26 +35,10 @@ class Horde_Block_UI protected $_vars = null; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** * Constructor. - * - * @param array $params Hash with configuration data. Possible values: - * - 'translation': A translation handler - * implementing Horde_Translation. */ - public function __construct($params = array()) + public function __construct() { - if (isset($params['translation'])) { - $this->_dict = $params['translation']; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Block', dirname(__FILE__) . '/../../../locale'); - } $this->_blocks = Horde_Block_Collection::singleton(); } @@ -86,7 +70,7 @@ class Horde_Block_UI if (!($this->_form instanceof Horde_Form)) { /* No existing valid form object set so set up a new one. */ - $this->setForm(new Horde_Form($this->_vars, $this->_dict->t("Edit Block"))); + $this->setForm(new Horde_Form($this->_vars, Horde_Block_Translation::t("Edit Block"))); } /* Get the current value of the block selection. */ @@ -94,7 +78,7 @@ class Horde_Block_UI /* Field to select apps. */ $apps = $this->_blocks->getBlocksList(); - $v = $this->_form->addVariable($this->_dict->t("Application"), $field . '[app]', 'enum', true, false, null, array($apps)); + $v = $this->_form->addVariable(Horde_Block_Translation::t("Application"), $field . '[app]', 'enum', true, false, null, array($apps)); $v->setOption('trackchange', true); if (empty($value['app'])) { diff --git a/framework/Block/package.xml b/framework/Block/package.xml index d70f5e11c..d9f387574 100644 --- a/framework/Block/package.xml +++ b/framework/Block/package.xml @@ -1,15 +1,11 @@ - + Block pear.horde.org Horde Block API The Horde_Block API provides a mechanism for displaying content blocks from numerous Horde applications or other sources, manipulating those - blocks, configuring them, etc. - + blocks, configuring them, etc. Chuck Hagenbuch chuck @@ -22,7 +18,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> jan@horde.org yes - 2009-12-01 + 2010-10-22 + 0.1.0 0.1.0 @@ -32,11 +29,12 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Removed sidebar-specifc code. + +* Removed sidebar-specifc code. * Initial Horde 4 package. - + @@ -47,11 +45,262 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -67,30 +316,119 @@ http://pear.php.net/dtd/package-2.0.xsd"> pear.horde.org + Translation + pear.horde.org + + Util pear.horde.org - - - gettext - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0.1 + 0.0.1 + + + alpha + alpha + + 2004-02-13 + LGPL + +Initial packaging + + + + 0.0.2 0.0.2 @@ -101,21 +439,24 @@ http://pear.php.net/dtd/package-2.0.xsd"> alpha LGPL - Converted to package.xml 2.0 for pear.horde.org + +Converted to package.xml 2.0 for pear.horde.org - 0.0.1 - 0.0.1 + 0.1.0 + 0.1.0 - alpha - alpha + beta + beta - 2004-02-13 + 2010-10-22 LGPL - Initial packaging + +* Removed sidebar-specifc code. + * Initial Horde 4 package. diff --git a/framework/Cli/lib/Horde/Cli.php b/framework/Cli/lib/Horde/Cli.php index 74b3dfd10..9efc03a69 100644 --- a/framework/Cli/lib/Horde/Cli.php +++ b/framework/Cli/lib/Horde/Cli.php @@ -119,29 +119,13 @@ class Horde_Cli ); /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** * Detect the current environment (web server or console) and sets * internal values accordingly. * * The constructor must not be called after init(). - * - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. */ - public function __construct($dict = null) + public function __construct() { - if ($dict) { - $this->_dict = $dict; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Cli', dirname(__FILE__) . '/../../locale'); - } - $this->_console = $this->runningFromCLI(); if ($this->_console) { @@ -335,7 +319,7 @@ class Horde_Cli } $this->writeln($this->red('====================')); $this->writeln(); - $this->writeln($this->red($this->_dict->t("Fatal Error:"))); + $this->writeln($this->red(Horde_Cli_Translation::t("Fatal Error:"))); $this->writeln($this->red($error)); $this->writeln(); $this->writeln((string)$backtrace); @@ -369,7 +353,7 @@ class Horde_Cli foreach ($choices as $key => $choice) { $this->writeln($this->indent('(' . $this->bold($key) . ') ' . $choice)); } - $this->writeln($this->_dict->t("Type your choice: "), true); + $this->writeln(Horde_Cli_Translation::t("Type your choice: "), true); @ob_flush(); // Get the user choice. @@ -380,7 +364,7 @@ class Horde_Cli if (isset($choices[$response])) { return $response; } else { - $this->writeln($this->red(sprintf($this->_dict->t("\"%s\" is not a valid choice."), $response))); + $this->writeln($this->red(sprintf(Horde_Cli_Translation::t("\"%s\" is not a valid choice."), $response))); } } else { @ob_flush(); @@ -454,16 +438,13 @@ class Horde_Cli * Either use the singleton() method to retrieve a Horde_Cli object after * calling init(), or don't call init() statically. * - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. - * * @return Horde_Cli A Horde_Cli instance. */ - static public function init($dict = null) + static public function init() { /* Run constructor now because it requires $_SERVER['SERVER_NAME'] to * be empty if called with a CGI SAPI. */ - $cli = new self($dict); + $cli = new self(); @set_time_limit(0); ob_implicit_flush(true); diff --git a/framework/Cli/lib/Horde/Cli/Translation.php b/framework/Cli/lib/Horde/Cli/Translation.php new file mode 100644 index 000000000..090e4de98 --- /dev/null +++ b/framework/Cli/lib/Horde/Cli/Translation.php @@ -0,0 +1,50 @@ + + * @package Cli + */ +class Horde_Cli_Translation extends Horde_Translation +{ + /** + * Returns the translation of a message. + * + * @var string $message The string to translate. + * + * @return string The string translation, or the original string if no + * translation exists. + */ + static public function t($message) + { + self::$_domain = 'Horde_Cli'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Cli/locale'; + return parent::t($message); + } + + /** + * 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. + */ + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Cli'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Cli/locale'; + return parent::ngettext($singular, $plural, $number); + } +} diff --git a/framework/Cli/package.xml b/framework/Cli/package.xml index d323caef4..d8d2ef622 100644 --- a/framework/Cli/package.xml +++ b/framework/Cli/package.xml @@ -16,8 +16,8 @@ jan@horde.org yes - 2010-08-15 - + 2010-10-22 + 0.2.0 0.2.0 @@ -42,9 +42,275 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -63,15 +329,100 @@ Translation pear.horde.org - - gettext - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -129,7 +480,7 @@ Add 'default' parameter to Horde_CLI::prompt(). beta beta - 2010-08-15 + 2010-10-22 LGPL * Horde_CLI:: -> Horde_Cli:: diff --git a/framework/Compress/lib/Horde/Compress.php b/framework/Compress/lib/Horde/Compress.php index eb9745760..c76ab87a0 100644 --- a/framework/Compress/lib/Horde/Compress.php +++ b/framework/Compress/lib/Horde/Compress.php @@ -14,13 +14,6 @@ class Horde_Compress { /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_dict; - - /** * Attempts to return a concrete instance based on $driver. * * @param mixed $driver The type of concrete subclass to @@ -52,21 +45,6 @@ class Horde_Compress } /** - * Constructor. - * - * @param Horde_Translation $dict A translation handler implementing - * Horde_Translation. - */ - public function __construct($dict = null) - { - if ($dict) { - $this->_dict = $dict; - } else { - $this->_dict = new Horde_Translation_Gettext('Horde_Compress', dirname(__FILE__) . '/../../locale'); - } - } - - /** * Compress the data. * * @param string $data The data to compress. diff --git a/framework/Compress/lib/Horde/Compress/Dbx.php b/framework/Compress/lib/Horde/Compress/Dbx.php index 04fd0beed..d80669f80 100644 --- a/framework/Compress/lib/Horde/Compress/Dbx.php +++ b/framework/Compress/lib/Horde/Compress/Dbx.php @@ -125,7 +125,7 @@ class Horde_Compress_Dbx extends Horde_Compress } $msg_item = unpack('LFilePos/LUnknown/LItemSize/LNextItem/a512Content', $s); if ($msg_item['FilePos'] != $position) { - throw new Horde_Exception($this->_dict->t("Invalid file format")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid file format")); } $position += 528; $msg .= substr($msg_item['Content'], 0, $msg_item['ItemSize']); @@ -154,7 +154,7 @@ class Horde_Compress_Dbx extends Horde_Compress $message_info = array(); $msg_header = unpack('Lposition/LDataLength/SHeaderLength/SFlagCount', substr($data, $position, 12)); if ($msg_header['position'] != $position) { - throw new Horde_Exception($this->_dict->t("Invalid file format")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid file format")); } $position += 12; $message_info['HeaderPosition'] = $msg_header['position']; @@ -235,7 +235,7 @@ class Horde_Compress_Dbx extends Horde_Compress { $index_header = unpack('LFilePos/LUnknown1/LPrevIndex/LNextIndex/LCount/LUnknown', substr($data, $position, 24)); if ($index_header['FilePos'] != $position) { - throw new Horde_Exception($this->_dict->t("Invalid file format")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid file format")); } // Push it into list of processed items. diff --git a/framework/Compress/lib/Horde/Compress/Gzip.php b/framework/Compress/lib/Horde/Compress/Gzip.php index 1a1ff65fa..466e64ed8 100644 --- a/framework/Compress/lib/Horde/Compress/Gzip.php +++ b/framework/Compress/lib/Horde/Compress/Gzip.php @@ -39,14 +39,14 @@ class Horde_Compress_Gzip extends Horde_Compress { /* If gzip is not compiled into PHP, return now. */ if (!Horde_Util::extensionExists('zlib')) { - throw new Horde_Exception($this->_dict->t("This server can't uncompress gzip files.")); + throw new Horde_Exception(Horde_Compress_Translation::t("This server can't uncompress gzip files.")); } /* Gzipped File - decompress it first. */ $position = 0; $info = @unpack('CCM/CFLG/VTime/CXFL/COS', substr($data, $position + 2)); if (!$info) { - throw new Horde_Exception($this->_dict->t("Unable to decompress data.")); + throw new Horde_Exception(Horde_Compress_Translation::t("Unable to decompress data.")); } $position += 10; @@ -76,7 +76,7 @@ class Horde_Compress_Gzip extends Horde_Compress $result = @gzinflate(substr($data, $position, strlen($data) - $position)); if (empty($result)) { - throw new Horde_Exception($this->_dict->t("Unable to decompress data.")); + throw new Horde_Exception(Horde_Compress_Translation::t("Unable to decompress data.")); } return $result; diff --git a/framework/Compress/lib/Horde/Compress/Rar.php b/framework/Compress/lib/Horde/Compress/Rar.php index 80611b860..c7545f717 100644 --- a/framework/Compress/lib/Horde/Compress/Rar.php +++ b/framework/Compress/lib/Horde/Compress/Rar.php @@ -51,7 +51,7 @@ class Horde_Compress_Rar extends Horde_Compress { $blockStart = strpos($data, "\x52\x61\x72\x21\x1a\x07\x00"); if ($blockStart === false) { - throw new Horde_Exception($this->_dict->t("Invalid RAR data.")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid RAR data.")); } $data_len = strlen($data); diff --git a/framework/Compress/lib/Horde/Compress/Tar.php b/framework/Compress/lib/Horde/Compress/Tar.php index edb130651..3d3d4bd1b 100644 --- a/framework/Compress/lib/Horde/Compress/Tar.php +++ b/framework/Compress/lib/Horde/Compress/Tar.php @@ -71,7 +71,7 @@ class Horde_Compress_Tar extends Horde_Compress while ($position < $data_len) { $info = @unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/a8checksum/Ctypeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor", substr($data, $position)); if (!$info) { - throw new Horde_Exception($this->_dict->t("Unable to decompress data.")); + throw new Horde_Exception(Horde_Compress_Translation::t("Unable to decompress data.")); } $position += 512; diff --git a/framework/Compress/lib/Horde/Compress/Translation.php b/framework/Compress/lib/Horde/Compress/Translation.php new file mode 100644 index 000000000..6d7b6d98c --- /dev/null +++ b/framework/Compress/lib/Horde/Compress/Translation.php @@ -0,0 +1,50 @@ + + * @package Compress + */ +class Horde_Compress_Translation extends Horde_Translation +{ + /** + * Returns the translation of a message. + * + * @var string $message The string to translate. + * + * @return string The string translation, or the original string if no + * translation exists. + */ + static public function t($message) + { + self::$_domain = 'Horde_Compress'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Compress/locale'; + return parent::t($message); + } + + /** + * 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. + */ + static public function ngettext($singular, $plural, $number) + { + self::$_domain = 'Horde_Compress'; + self::$_directory = '@data_dir@' == '@'.'data_dir'.'@' ? '../../../locale' : '@data_dir@/Compress/locale'; + return parent::ngettext($singular, $plural, $number); + } +} diff --git a/framework/Compress/lib/Horde/Compress/Zip.php b/framework/Compress/lib/Horde/Compress/Zip.php index 18c4b2868..3c5d49049 100644 --- a/framework/Compress/lib/Horde/Compress/Zip.php +++ b/framework/Compress/lib/Horde/Compress/Zip.php @@ -90,7 +90,7 @@ class Horde_Compress_Zip extends Horde_Compress public function compress($data, $params = array()) { if (!Horde_Util::extensionExists('zlib')) { - throw new Horde_Exception($this->_dict->t("This server can't compress zip files.")); + throw new Horde_Exception(Horde_Compress_Translation::t("This server can't compress zip files.")); } $this->_ctrldir = array(); @@ -194,7 +194,7 @@ class Horde_Compress_Zip extends Horde_Compress do { if (strlen($data) < $fhStart + 31) { - throw new Horde_Exception($this->_dict->t("Invalid ZIP data")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid ZIP data")); } $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength', substr($data, $fhStart + 10, 20)); $name = substr($data, $fhStart + 46, $info['Length']); @@ -221,7 +221,7 @@ class Horde_Compress_Zip extends Horde_Compress ((($info['Time'] >> 25) & 0x7f) + 1980)); if (strlen($data) < $fhStart + 43) { - throw new Horde_Exception($this->_dict->t("Invalid ZIP data")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid ZIP data")); } $info = unpack('vInternal/VExternal', substr($data, $fhStart + 36, 6)); @@ -241,7 +241,7 @@ class Horde_Compress_Zip extends Horde_Compress do { if ($data_len < $fhStart + 34) { - throw new Horde_Exception($this->_dict->t("Invalid ZIP data")); + throw new Horde_Exception(Horde_Compress_Translation::t("Invalid ZIP data")); } $info = unpack('vMethod/VTime/VCRC32/VCompressed/VUncompressed/vLength/vExtraLength', substr($data, $fhStart + 8, 25)); $name = substr($data, $fhStart + 30, $info['Length']); diff --git a/framework/Compress/package.xml b/framework/Compress/package.xml index d537f17cb..664e5017a 100644 --- a/framework/Compress/package.xml +++ b/framework/Compress/package.xml @@ -1,13 +1,9 @@ - + Compress pear.horde.org Horde Compression API - This package provides an API for various compression techniques. - + This package provides an API for various compression techniques. Chuck Hagenbuch chuck @@ -26,7 +22,8 @@ http://pear.php.net/dtd/package-2.0.xsd"> slusarz@horde.org yes - 2009-07-13 + 2010-10-22 + 0.1.0 0.1.0 @@ -36,10 +33,11 @@ http://pear.php.net/dtd/package-2.0.xsd"> beta LGPL - * Initial Horde 4 package. + +* Initial Horde 4 package. - + @@ -48,11 +46,275 @@ http://pear.php.net/dtd/package-2.0.xsd"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -68,32 +330,136 @@ http://pear.php.net/dtd/package-2.0.xsd"> pear.horde.org + Translation + pear.horde.org + + Util pear.horde.org - gettext - - zlib - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.0.1 + 0.0.1 + + + alpha + alpha + + 2003-07-03 + LGPL + +Initial release as a PEAR package + + + 2006-05-08 @@ -105,22 +471,24 @@ http://pear.php.net/dtd/package-2.0.xsd"> alpha LGPL - * Added rar driver. + +* Added rar driver. * Converted to package.xml 2.0 for pear.horde.org - 0.0.1 - 0.0.1 + 0.1.0 + 0.1.0 - alpha - alpha + beta + beta - 2003-07-03 + 2010-10-22 LGPL - Initial release as a PEAR package + +* Initial Horde 4 package. diff --git a/framework/Core/lib/Horde.php b/framework/Core/lib/Horde.php index ab5cbc9dd..4dca04f54 100644 --- a/framework/Core/lib/Horde.php +++ b/framework/Core/lib/Horde.php @@ -104,9 +104,8 @@ class Horde { $admin = $GLOBALS['registry']->isAdmin(); $cli = Horde_Cli::runningFromCLI(); - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - $errortext = '

' . $dict->t("A fatal error has occurred") . '

'; + $errortext = '

' . Horde_Core_Translation::t("A fatal error has occurred") . '

'; if (($error instanceof PEAR_Error) || (is_object($error) && method_exists($error, 'getMessage'))) { @@ -124,12 +123,12 @@ class Horde $backtrace = new Horde_Support_Backtrace($trace); $errortext .= '
' . (string)$backtrace . '
'; if (is_object($error)) { - $errortext .= '

' . $dict->t("Details") . '

'; - $errortext .= '

' . $dict->t("The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.") . '

'; + $errortext .= '

' . Horde_Core_Translation::t("Details") . '

'; + $errortext .= '

' . Horde_Core_Translation::t("The full error message is logged in Horde's log file, and is shown below only to administrators. Non-administrative users will not see error details.") . '

'; $errortext .= '
' . htmlspecialchars(print_r($error, true)) . '
'; } } elseif ($log) { - $errortext .= '

' . $dict->t("Details have been logged for the administrator.") . '

'; + $errortext .= '

' . Horde_Core_Translation::t("Details have been logged for the administrator.") . '

'; } // Log the error via logMessage() if requested. @@ -375,13 +374,11 @@ HTML; global $conf, $session; if (!isset($session['horde:form_secrets/' . $token])) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - throw new Horde_Exception($dict->t("We cannot verify that this request was really sent by you. It could be a malicious request. If you intended to perform this action, you can retry it now.")); + throw new Horde_Exception(Horde_Core_Translation::t("We cannot verify that this request was really sent by you. It could be a malicious request. If you intended to perform this action, you can retry it now.")); } if (($session['horde:form_secrets/' . $token] + $GLOBALS['conf']['urls']['token_lifetime'] * 60) < time()) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - throw new Horde_Exception(sprintf($dict->t("This request cannot be completed because the link you followed or the form you submitted was only valid for %s minutes. Please try again now."), $GLOBALS['conf']['urls']['token_lifetime'])); + throw new Horde_Exception(sprintf(Horde_Core_Translation::t("This request cannot be completed because the link you followed or the form you submitted was only valid for %s minutes. Please try again now."), $GLOBALS['conf']['urls']['token_lifetime'])); } } @@ -674,8 +671,7 @@ HTML; static public function requireSecureConnection() { if (!self::isConnectionSecure()) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - throw new Horde_Exception($dict->t("The encryption features require a secure web connection.")); + throw new Horde_Exception(Horde_Core_Translation::t("The encryption features require a secure web connection.")); } } @@ -866,20 +862,18 @@ HTML; $fileroot = isset($registry) ? $registry->get('fileroot') : ''; if (!is_array($params) || !count($params)) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); throw new Horde_Exception( - sprintf($dict->t("No configuration information specified for %s."), $name) . "\n\n" . - sprintf($dict->t("The file %s should contain some %s settings."), + sprintf(Horde_Core_Translation::t("No configuration information specified for %s."), $name) . "\n\n" . + sprintf(Horde_Core_Translation::t("The file %s should contain some %s settings."), $fileroot . '/config/' . $file, sprintf("%s['%s']['params']", $variable, $driver))); } foreach ($fields as $field) { if (!isset($params[$field])) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); throw new Horde_Exception( - sprintf($dict->t("Required \"%s\" not specified in %s configuration."), $field, $name) . "\n\n" . - sprintf($dict->t("The file %s should contain a %s setting."), + sprintf(Horde_Core_Translation::t("Required \"%s\" not specified in %s configuration."), $field, $name) . "\n\n" . + sprintf(Horde_Core_Translation::t("The file %s should contain a %s setting."), $fileroot . '/config/' . $file, sprintf("%s['%s']['params']['%s']", $variable, $driver, $field))); } @@ -1614,8 +1608,7 @@ HTML; $ak = self::getAccessKey($label, $nocheck); $attributes = 'title="' . self::stripAccessKey($label); if (!empty($ak)) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - $attributes .= sprintf($dict->t(" (Accesskey %s)"), strtoupper($ak)) + $attributes .= sprintf(Horde_Core_Translation::t(" (Accesskey %s)"), strtoupper($ak)) . '" accesskey="' . $ak; } @@ -2084,8 +2077,7 @@ HTML; $menu = new Horde_Menu(isset($opts['mask']) ? $opts['mask'] : Horde_Menu::MASK_ALL); if (!in_array($registry->get('status', 'horde'), array('notoolbar', 'hidden', 'inactive'))) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../locale'); - $menu->add(Horde::url('services/portal/', false, array('app' => 'horde')), $dict->t("_Home"), 'horde.png'); + $menu->add(Horde::url('services/portal/', false, array('app' => 'horde')), Horde_Core_Translation::t("_Home"), 'horde.png'); } $registry->callAppMethod($opts['app'], 'menu', array( diff --git a/framework/Core/lib/Horde/Core/Ajax/Application.php b/framework/Core/lib/Horde/Core/Ajax/Application.php index b41425c34..a549c4454 100644 --- a/framework/Core/lib/Horde/Core/Ajax/Application.php +++ b/framework/Core/lib/Horde/Core/Ajax/Application.php @@ -181,8 +181,7 @@ abstract class Horde_Core_Ajax_Application } $res = $rfc822->parseAddressList($this->_vars->email, $params); if (!count($res)) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - throw new Horde_Exception($dict->t("No valid email address found")); + throw new Horde_Exception(Horde_Core_Translation::t("No valid email address found")); } return (object)array( diff --git a/framework/Core/lib/Horde/Core/Auth/Application.php b/framework/Core/lib/Horde/Core/Auth/Application.php index 5a47d7d77..4833f5cbd 100644 --- a/framework/Core/lib/Horde/Core/Auth/Application.php +++ b/framework/Core/lib/Horde/Core/Auth/Application.php @@ -67,13 +67,6 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base ); /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** * Constructor. * * @param array $params Required parameters: @@ -102,8 +95,6 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base unset($params['base']); } - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - parent::__construct($params); } @@ -582,7 +573,7 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base isset($GLOBALS['notification']) && ($expire = $this->_base->getCredential('expire'))) { $toexpire = ($expire - time()) / 86400; - $GLOBALS['notification']->push(sprintf($this->_coreDict->ngettext("%d day until your password expires.", "%d days until your password expires.", $toexpire), $toexpire), 'horde.warning'); + $GLOBALS['notification']->push(sprintf(Horde_Core_Translation::ngettext("%d day until your password expires.", "%d days until your password expires.", $toexpire), $toexpire), 'horde.warning'); } if ($this->hasCapability('authenticatecallback')) { diff --git a/framework/Core/lib/Horde/Core/Auth/Signup/Base.php b/framework/Core/lib/Horde/Core/Auth/Signup/Base.php index 3315d7050..0ea1651be 100644 --- a/framework/Core/lib/Horde/Core/Auth/Signup/Base.php +++ b/framework/Core/lib/Horde/Core/Auth/Signup/Base.php @@ -17,21 +17,6 @@ abstract class Horde_Core_Auth_Signup_Base { /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** - * Constructor. - */ - public function __construct() - { - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../../locale'); - } - - /** * Adds a new user to the system and handles any extra fields that may have * been compiled, relying on the hooks.php file. * @@ -93,14 +78,14 @@ abstract class Horde_Core_Auth_Signup_Base 'u' => $signup->name, 'h' => hash_hmac('sha1', $signup->name, $conf['secret_key']) )); - $message = sprintf($this->_coreDict->t("A new account for the user \"%s\" has been requested through the signup form."), $signup->name) + $message = sprintf(Horde_Core_Translation::t("A new account for the user \"%s\" has been requested through the signup form."), $signup->name) . "\n\n" - . $this->_coreDict->t("Approve the account:") + . Horde_Core_Translation::t("Approve the account:") . "\n" . $link->copy()->add('a', 'approve') . "\n" - . $this->_coreDict->t("Deny the account:") + . Horde_Core_Translation::t("Deny the account:") . "\n" . $link->copy()->add('a', 'deny'); $mail = new Horde_Mime_Mail(array( - 'subject' => sprintf($this->_coreDict->t("Account signup request for \"%s\""), $signup->name), + 'subject' => sprintf(Horde_Core_Translation::t("Account signup request for \"%s\""), $signup->name), 'body' => $message, 'to' => $conf['signup']['email'], 'from' => $conf['signup']['email'], @@ -126,7 +111,7 @@ abstract class Horde_Core_Auth_Signup_Base // the signup queue. if ($GLOBALS['auth']->exists($info['user_name']) || $this->exists($info['user_name'])) { - throw new Horde_Exception(sprintf($this->_coreDict->t("Username \"%s\" already exists."), $info['user_name'])); + throw new Horde_Exception(sprintf(Horde_Core_Translation::t("Username \"%s\" already exists."), $info['user_name'])); } } diff --git a/framework/Core/lib/Horde/Core/Auth/Signup/Form.php b/framework/Core/lib/Horde/Core/Auth/Signup/Form.php index 2d2cd888a..765ea2690 100644 --- a/framework/Core/lib/Horde/Core/Auth/Signup/Form.php +++ b/framework/Core/lib/Horde/Core/Auth/Signup/Form.php @@ -20,23 +20,15 @@ class Horde_Core_Auth_Signup_Form extends Horde_Form protected $_useFormToken = true; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** * Constructor * * @var params Horde_Variables TODO */ public function __construct(&$vars) { - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../../locale'); - parent::__construct($vars, sprintf($this->_coreDict->t("%s Sign Up"), $GLOBALS['registry']->get('name'))); + parent::__construct($vars, sprintf(Horde_Core_Translation::t("%s Sign Up"), $GLOBALS['registry']->get('name'))); - $this->setButtons($this->_coreDict->t("Sign up"), true); + $this->setButtons(Horde_Core_Translation::t("Sign up"), true); $this->addHidden('', 'url', 'text', false); @@ -47,10 +39,10 @@ class Horde_Core_Auth_Signup_Form extends Horde_Form if (!empty($extra)) { if (!isset($extra['user_name'])) { - $this->addVariable($this->_coreDict->t("Choose a username"), 'user_name', 'text', true); + $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true); } if (!isset($extra['password'])) { - $this->addVariable($this->_coreDict->t("Choose a password"), 'password', 'passwordconfirm', true, false, $this->_coreDict->t("type the password twice to confirm")); + $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("type the password twice to confirm")); } foreach ($extra as $field_name => $field) { $readonly = isset($field['readonly']) ? $field['readonly'] : null; @@ -63,8 +55,8 @@ class Horde_Core_Auth_Signup_Form extends Horde_Form $desc, $field_params); } } else { - $this->addVariable($this->_coreDict->t("Choose a username"), 'user_name', 'text', true); - $this->addVariable($this->_coreDict->t("Choose a password"), 'password', 'passwordconfirm', true, false, $this->_coreDict->t("type the password twice to confirm")); + $this->addVariable(Horde_Core_Translation::t("Choose a username"), 'user_name', 'text', true); + $this->addVariable(Horde_Core_Translation::t("Choose a password"), 'password', 'passwordconfirm', true, false, Horde_Core_Translation::t("type the password twice to confirm")); } } diff --git a/framework/Core/lib/Horde/Core/Factory/History.php b/framework/Core/lib/Horde/Core/Factory/History.php index 4d235c8e0..cf6e65a55 100644 --- a/framework/Core/lib/Horde/Core/Factory/History.php +++ b/framework/Core/lib/Horde/Core/Factory/History.php @@ -9,8 +9,7 @@ class Horde_Core_Factory_History { if (empty($GLOBALS['conf']['sql']['phptype']) || ($GLOBALS['conf']['sql']['phptype'] == 'none')) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - throw new Horde_Exception($dict->t("The History system is disabled.")); + throw new Horde_Exception(Horde_Core_Translation::t("The History system is disabled.")); } $ob = Horde_History::factory('Sql', $GLOBALS['conf']['sql']); diff --git a/framework/Core/lib/Horde/Core/Factory/Prefs.php b/framework/Core/lib/Horde/Core/Factory/Prefs.php index d0ba2cb7e..de73e57e4 100644 --- a/framework/Core/lib/Horde/Core/Factory/Prefs.php +++ b/framework/Core/lib/Horde/Core/Factory/Prefs.php @@ -42,13 +42,6 @@ class Horde_Core_Factory_Prefs private $_injector; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** * Constructor. * * @param Horde_Injector $injector The injector to use. @@ -56,7 +49,6 @@ class Horde_Core_Factory_Prefs public function __construct(Horde_Injector $injector) { $this->_injector = $injector; - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); } /** @@ -132,7 +124,7 @@ class Horde_Core_Factory_Prefs if (!$GLOBALS['session']['horde:no_prefs']) { $GLOBALS['session']['horde:no_prefs'] = true; if (isset($GLOBALS['notification'])) { - $GLOBALS['notification']->push($this->_coreDict->t("The preferences backend is currently unavailable and your preferences have not been loaded. You may continue to use the system with default preferences.")); + $GLOBALS['notification']->push(Horde_Core_Translation::t("The preferences backend is currently unavailable and your preferences have not been loaded. You may continue to use the system with default preferences.")); } } unset($opts['cache']); @@ -165,7 +157,7 @@ class Horde_Core_Factory_Prefs return false; } - $GLOBALS['notification']->push(sprintf($this->_coreDict->t("The preference \"%s\" could not be saved because its data exceeds the maximum allowable size"), $pref), 'horde.error'); + $GLOBALS['notification']->push(sprintf(Horde_Core_Translation::t("The preference \"%s\" could not be saved because its data exceeds the maximum allowable size"), $pref), 'horde.error'); return true; } diff --git a/framework/Core/lib/Horde/Core/Factory/Share.php b/framework/Core/lib/Horde/Core/Factory/Share.php index da0935497..38e8a8b9a 100644 --- a/framework/Core/lib/Horde/Core/Factory/Share.php +++ b/framework/Core/lib/Horde/Core/Factory/Share.php @@ -79,8 +79,7 @@ class Horde_Core_Factory_Share if (empty($ob)) { $class = 'Horde_Share_' . ucfirst(basename($driver)); if (!class_exists($class)) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - throw new Horde_Exception(sprintf($dict->t("\"%s\" share driver not found."), $driver)); + throw new Horde_Exception(sprintf(Horde_Core_Translation::t("\"%s\" share driver not found."), $driver)); } $ob = new $class($app, $this->_injector->getInstance('Horde_Perms')); diff --git a/framework/Core/lib/Horde/Core/Factory/Twitter.php b/framework/Core/lib/Horde/Core/Factory/Twitter.php index ad6227492..66913ee68 100644 --- a/framework/Core/lib/Horde/Core/Factory/Twitter.php +++ b/framework/Core/lib/Horde/Core/Factory/Twitter.php @@ -39,8 +39,7 @@ class Horde_Core_Factory_Twitter return $twitter; } else { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - throw new Horde_Service_Twitter_Exception($dict->t("No OAuth Key or Secret found for the Twitter API")); + throw new Horde_Service_Twitter_Exception(Horde_Core_Translation::t("No OAuth Key or Secret found for the Twitter API")); } } } diff --git a/framework/Core/lib/Horde/Core/Factory/Vfs.php b/framework/Core/lib/Horde/Core/Factory/Vfs.php index 02063266b..f447d5721 100644 --- a/framework/Core/lib/Horde/Core/Factory/Vfs.php +++ b/framework/Core/lib/Horde/Core/Factory/Vfs.php @@ -78,8 +78,7 @@ class Horde_Core_Factory_Vfs global $conf; if (($name !== 'horde') && !isset($conf[$name]['type'])) { - $dict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - throw new Horde_Exception($dict->t("You must configure a VFS backend.")); + throw new Horde_Exception(Horde_Core_Translation::t("You must configure a VFS backend.")); } $vfs = ($name == 'horde' || $conf[$name]['type'] == 'horde') diff --git a/framework/Core/lib/Horde/Core/Mime/Viewer/Vcard.php b/framework/Core/lib/Horde/Core/Mime/Viewer/Vcard.php index 424794f60..00de31698 100644 --- a/framework/Core/lib/Horde/Core/Mime/Viewer/Vcard.php +++ b/framework/Core/lib/Horde/Core/Mime/Viewer/Vcard.php @@ -34,13 +34,6 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base protected $_imageUrl; /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** * Constructor. * * @param Horde_Mime_Part $mime_part The object with the data to be @@ -57,8 +50,6 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base */ public function __construct(Horde_Mime_Part $part, array $conf = array()) { - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../../locale'); - $this->_required = array_merge($this->_required, array( 'browser', 'notification', @@ -108,11 +99,11 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base $data = $this->_mimepart->getContents(); $html = ''; $import_msg = null; - $title = $this->_coreDict->t("vCard"); + $title = Horde_Core_Translation::t("vCard"); $iCal = new Horde_Icalendar(); if (!$iCal->parsevCalendar($data, 'VCALENDAR', $this->_mimepart->getCharset())) { - $notification->push($this->_coreDict->t("There was an error reading the contact data."), 'horde.error'); + $notification->push(Horde_Core_Translation::t("There was an error reading the contact data."), 'horde.error'); } if (Horde_Util::getFormData('import') && @@ -126,11 +117,11 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base $contacts = $registry->call('contacts/import', array($c, null, $source)); ++$count; } catch (Horde_Exception $e) { - $notification->push($this->_coreDict->t("There was an error importing the contact data:") . ' ' . $e->getMessage(), 'horde.error'); + $notification->push(Horde_Core_Translation::t("There was an error importing the contact data:") . ' ' . $e->getMessage(), 'horde.error'); } } } - $notification->push(sprintf($this->_coreDict->ngettext( + $notification->push(sprintf(Horde_Core_Translation::ngettext( "%d contact was successfully added to your address book.", "%d contacts were successfully added to your address book.", $count), @@ -154,18 +145,18 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base $n = $vc->printableName(); if (!empty($n)) { - $html .= $this->_row($this->_coreDict->t("Name"), $n); + $html .= $this->_row(Horde_Core_Translation::t("Name"), $n); } try { - $html .= $this->_row($this->_coreDict->t("Alias"), implode("\n", $vc->getAttributeValues('ALIAS'))); + $html .= $this->_row(Horde_Core_Translation::t("Alias"), implode("\n", $vc->getAttributeValues('ALIAS'))); } catch (Horde_Icalendar_Exception $e) {} try { $birthdays = $vc->getAttributeValues('BDAY'); $birthday = new Horde_Date($birthdays[0]); $html .= $this->_row( - $this->_coreDict->t("Birthday"), + Horde_Core_Translation::t("Birthday"), $birthday->strftime($prefs->getValue('date_format'))); } catch (Horde_Icalendar_Exception $e) {} @@ -173,7 +164,7 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base foreach ($photos as $p => $photo) { if (isset($photo['params']['VALUE']) && Horde_String::upper($photo['params']['VALUE']) == 'URI') { - $html .= $this->_row($this->_coreDict->t("Photo"), + $html .= $this->_row(Horde_Core_Translation::t("Photo"), '', false); } elseif (isset($photo['params']['ENCODING']) && @@ -181,11 +172,11 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base isset($photo['params']['TYPE'])) { if ($browser->hasFeature('datauri') === true || $browser->hasFeature('datauri') >= strlen($photo['value'])) { - $html .= $this->_row($this->_coreDict->t("Photo"), + $html .= $this->_row(Horde_Core_Translation::t("Photo"), '', false); } elseif ($this->_imageUrl) { - $html .= $this->_row($this->_coreDict->t("Photo"), + $html .= $this->_row(Horde_Core_Translation::t("Photo"), '', false); } @@ -205,36 +196,36 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base foreach ($label['params']['TYPE'] as $type) { switch(Horde_String::upper($type)) { case 'HOME': - $types[] = $this->_coreDict->t("Home Address"); + $types[] = Horde_Core_Translation::t("Home Address"); break; case 'WORK': - $types[] = $this->_coreDict->t("Work Address"); + $types[] = Horde_Core_Translation::t("Work Address"); break; case 'DOM': - $types[] = $this->_coreDict->t("Domestic Address"); + $types[] = Horde_Core_Translation::t("Domestic Address"); break; case 'INTL': - $types[] = $this->_coreDict->t("International Address"); + $types[] = Horde_Core_Translation::t("International Address"); break; case 'POSTAL': - $types[] = $this->_coreDict->t("Postal Address"); + $types[] = Horde_Core_Translation::t("Postal Address"); break; case 'PARCEL': - $types[] = $this->_coreDict->t("Parcel Address"); + $types[] = Horde_Core_Translation::t("Parcel Address"); break; case 'PREF': - $types[] = $this->_coreDict->t("Preferred Address"); + $types[] = Horde_Core_Translation::t("Preferred Address"); break; } } if (!count($types)) { - $types = array($this->_coreDict->t("Address")); + $types = array(Horde_Core_Translation::t("Address")); } $html .= $this->_row(implode('/', $types), $label['value']); } @@ -269,36 +260,36 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base foreach ($item['params']['TYPE'] as $type) { switch(Horde_String::upper($type)) { case 'HOME': - $types[] = $this->_coreDict->t("Home Address"); + $types[] = Horde_Core_Translation::t("Home Address"); break; case 'WORK': - $types[] = $this->_coreDict->t("Work Address"); + $types[] = Horde_Core_Translation::t("Work Address"); break; case 'DOM': - $types[] = $this->_coreDict->t("Domestic Address"); + $types[] = Horde_Core_Translation::t("Domestic Address"); break; case 'INTL': - $types[] = $this->_coreDict->t("International Address"); + $types[] = Horde_Core_Translation::t("International Address"); break; case 'POSTAL': - $types[] = $this->_coreDict->t("Postal Address"); + $types[] = Horde_Core_Translation::t("Postal Address"); break; case 'PARCEL': - $types[] = $this->_coreDict->t("Parcel Address"); + $types[] = Horde_Core_Translation::t("Parcel Address"); break; case 'PREF': - $types[] = $this->_coreDict->t("Preferred Address"); + $types[] = Horde_Core_Translation::t("Preferred Address"); break; } } if (!count($types)) { - $types = array($this->_coreDict->t("Address")); + $types = array(Horde_Core_Translation::t("Address")); } $html .= $this->_row(implode('/', $types), implode("\n", $a)); } @@ -315,19 +306,19 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base } } if (isset($number['params']['FAX'])) { - $html .= $this->_row($this->_coreDict->t("Fax"), $number['value']); + $html .= $this->_row(Horde_Core_Translation::t("Fax"), $number['value']); } else { if (isset($number['params']['HOME'])) { - $html .= $this->_row($this->_coreDict->t("Home Phone"), + $html .= $this->_row(Horde_Core_Translation::t("Home Phone"), $number['value']); } elseif (isset($number['params']['WORK'])) { - $html .= $this->_row($this->_coreDict->t("Work Phone"), + $html .= $this->_row(Horde_Core_Translation::t("Work Phone"), $number['value']); } elseif (isset($number['params']['CELL'])) { - $html .= $this->_row($this->_coreDict->t("Cell Phone"), + $html .= $this->_row(Horde_Core_Translation::t("Cell Phone"), $number['value']); } else { - $html .= $this->_row($this->_coreDict->t("Phone"), + $html .= $this->_row(Horde_Core_Translation::t("Phone"), $number['value']); } } @@ -361,36 +352,36 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base } if (count($emails)) { - $html .= $this->_row($this->_coreDict->t("Email"), implode("\n", $emails), false); + $html .= $this->_row(Horde_Core_Translation::t("Email"), implode("\n", $emails), false); } try { $title = $vc->getAttributeValues('TITLE'); - $html .= $this->_row($this->_coreDict->t("Title"), $title[0]); + $html .= $this->_row(Horde_Core_Translation::t("Title"), $title[0]); } catch (Horde_Icalendar_Exception $e) {} try { $role = $vc->getAttributeValues('ROLE'); - $html .= $this->_row($this->_coreDict->t("Role"), $role[0]); + $html .= $this->_row(Horde_Core_Translation::t("Role"), $role[0]); } catch (Horde_Icalendar_Exception $e) {} try { $org = $vc->getAttributeValues('ORG'); - $html .= $this->_row($this->_coreDict->t("Company"), $org[0]); + $html .= $this->_row(Horde_Core_Translation::t("Company"), $org[0]); if (isset($org[1])) { - $html .= $this->_row($this->_coreDict->t("Department"), $org[1]); + $html .= $this->_row(Horde_Core_Translation::t("Department"), $org[1]); } } catch (Horde_Icalendar_Exception $e) {} try { $notes = $vc->getAttributeValues('NOTE'); - $html .= $this->_row($this->_coreDict->t("Notes"), $notes[0]); + $html .= $this->_row(Horde_Core_Translation::t("Notes"), $notes[0]); } catch (Horde_Icalendar_Exception $e) {} try { $url = $vc->getAttributeValues('URL'); $html .= $this->_row( - $this->_coreDict->t("URL"), + Horde_Core_Translation::t("URL"), '' . htmlspecialchars($url[0]) . '', @@ -412,9 +403,9 @@ class Horde_Core_Mime_Viewer_Vcard extends Horde_Mime_Viewer_Base if (count($sources) > 1) { $html .= '' + . Horde_Core_Translation::t("Add to address book:") . '" />' . '' + . Horde_Core_Translation::t("Address Book") . '' . '' + . Horde_Core_Translation::t("Add to my address book") . '" />' . ''; } diff --git a/framework/Core/lib/Horde/Core/Notification/Status.php b/framework/Core/lib/Horde/Core/Notification/Status.php index acba9f840..5730c2f21 100644 --- a/framework/Core/lib/Horde/Core/Notification/Status.php +++ b/framework/Core/lib/Horde/Core/Notification/Status.php @@ -14,13 +14,6 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status { /** - * Translation provider. - * - * @var Horde_Translation - */ - protected $_coreDict; - - /** * Constructor. * * @param mixed $data Message: either a string or an Exception or @@ -30,8 +23,6 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status */ public function __construct($data, $type = null, array $flags = array()) { - $this->_coreDict = new Horde_Translation_Gettext('Horde_Core', dirname(__FILE__) . '/../../../../locale'); - if (empty($type)) { $type = ($data instanceof PEAR_Error || $data instanceof Exception) ? 'horde.error' @@ -74,15 +65,15 @@ class Horde_Core_Notification_Status extends Horde_Notification_Event_Status return $e->getMessage(); } $opts = array( - '-1' => $this->_coreDict->t("Dismiss"), - '5' => $this->_coreDict->t("5 minutes"), - '15' => $this->_coreDict->t("15 minutes"), - '60' => $this->_coreDict->t("1 hour"), - '360' => $this->_coreDict->t("6 hours"), - '1440' => $this->_coreDict->t("1 day") + '-1' => Horde_Core_Translation::t("Dismiss"), + '5' => Horde_Core_Translation::t("5 minutes"), + '15' => Horde_Core_Translation::t("15 minutes"), + '60' => Horde_Core_Translation::t("1 hour"), + '360' => Horde_Core_Translation::t("6 hours"), + '1440' => Horde_Core_Translation::t("1 day") ); $id = 'snooze_' . md5($alarm['id']); - $text .= ' [' . $this->_coreDict->t("Snooze...") . '