From 6ec02f0709f4ee33227ea1d98fc1b8c86b6ea1fe Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Mon, 26 Sep 2011 13:37:48 +0200 Subject: [PATCH] Adds wcf\data\language\Language::__toString() Fixes a bug when `LanguageFactory::getInstance()->getLanguages()` is used for html check boxes. Additionally the documentation has been updated a bit. --- .../lib/data/language/Language.class.php | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/lib/data/language/Language.class.php b/wcfsetup/install/files/lib/data/language/Language.class.php index 6bd3ef2666..1cf68beb43 100644 --- a/wcfsetup/install/files/lib/data/language/Language.class.php +++ b/wcfsetup/install/files/lib/data/language/Language.class.php @@ -27,32 +27,37 @@ class Language extends DatabaseObject { /** * list of language items - * - * @var array + * @var array */ protected $items = array(); /** * list of dynamic language items - * - * @param array + * @var array */ protected $dynamicItems = array(); /** * instance of LanguageEditor - * - * @var LanguageEditor + * @var wcf\data\language\LanguageEditor */ private $editor = null; /** - * Active package id - * + * id of the active package * @var integer */ public $packageID = PACKAGE_ID; + /** + * Returns the name of this language in the language of the active user. + * + * @return string + */ + public function __toString() { + return WCF::getLanguage()->get('wcf.global.language.'.$this->languageCode); + } + /** * Returns the fixed language code of this language. * -- 2.20.1