From a53c38ea27124e4471c5a09c0296a95550c4aaec Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 13 Jul 2019 17:25:29 +0200 Subject: [PATCH] Consistently use `getTitle()` in templates and language items See #2976 --- .../templates/__labelFormField.tpl | 4 ++-- com.woltlab.wcf/templates/__menu.tpl | 6 +++--- com.woltlab.wcf/templates/ampFooter.tpl | 4 ++-- com.woltlab.wcf/templates/article.tpl | 2 +- com.woltlab.wcf/templates/articleAdd.tpl | 4 ++-- com.woltlab.wcf/templates/articleList.tpl | 4 ++-- .../templates/articleListItems.tpl | 2 +- .../templates/boxPaidSubscriptions.tpl | 2 +- .../templates/boxPaidSubscriptionsSidebar.tpl | 2 +- com.woltlab.wcf/templates/captchaQuestion.tpl | 2 +- .../templates/categoryArticleList.tpl | 4 ++-- .../templates/customOptionFieldList.tpl | 4 ++-- .../templates/messageFormSmilies.tpl | 2 +- com.woltlab.wcf/templates/pageHeaderUser.tpl | 2 +- com.woltlab.wcf/templates/pageMenuMobile.tpl | 4 ++-- .../templates/paidSubscriptionList.tpl | 4 ++-- com.woltlab.wcf/templates/team.tpl | 4 ++-- .../templates/unreadArticleList.tpl | 4 ++-- com.woltlab.wcf/templates/userMenuSidebar.tpl | 2 +- .../templates/watchedArticleList.tpl | 4 ++-- com.woltlab.wcf/templates/wysiwygToolbar.tpl | 4 ++-- .../files/acp/templates/__labelFormField.tpl | 4 ++-- .../acp/templates/__messageFormSmilies.tpl | 2 +- .../files/acp/templates/articleAdd.tpl | 4 ++-- .../files/acp/templates/articleList.tpl | 2 +- .../files/acp/templates/captchaQuestion.tpl | 2 +- .../acp/templates/captchaQuestionList.tpl | 2 +- .../files/acp/templates/contactSettings.tpl | 4 ++-- .../files/acp/templates/cronjobList.tpl | 6 +++--- .../install/files/acp/templates/labelList.tpl | 2 +- .../files/acp/templates/languageExport.tpl | 2 +- .../files/acp/templates/menuItemAdd.tpl | 2 +- .../files/acp/templates/menuItemList.tpl | 4 ++-- .../install/files/acp/templates/menuList.tpl | 2 +- .../acp/templates/messageFormSmilies.tpl | 2 +- .../install/files/acp/templates/package.tpl | 6 +++--- .../files/acp/templates/packageList.tpl | 2 +- .../install/files/acp/templates/pageAdd.tpl | 2 +- .../files/acp/templates/pageHeaderUser.tpl | 2 +- .../acp/templates/paidSubscriptionAdd.tpl | 4 ++-- .../acp/templates/paidSubscriptionList.tpl | 2 +- .../paidSubscriptionTransactionLog.tpl | 2 +- .../paidSubscriptionTransactionLogList.tpl | 2 +- .../acp/templates/paidSubscriptionUserAdd.tpl | 2 +- .../templates/paidSubscriptionUserList.tpl | 2 +- .../files/acp/templates/smileyList.tpl | 4 ++-- .../files/acp/templates/userGroupList.tpl | 4 ++-- .../files/acp/templates/userGroupOption.tpl | 2 +- .../files/acp/templates/userRankAdd.tpl | 2 +- .../files/acp/templates/userRankList.tpl | 2 +- .../files/acp/templates/wysiwygToolbar.tpl | 4 ++-- .../files/lib/data/bbcode/BBCode.class.php | 10 +++++++++ .../question/CaptchaQuestion.class.php | 10 +++++++++ .../files/lib/data/cronjob/Cronjob.class.php | 11 ++++++++++ .../data/custom/option/CustomOption.class.php | 21 ++++++++++++++++++- .../files/lib/data/menu/Menu.class.php | 8 +++---- .../lib/data/menu/item/MenuItem.class.php | 11 +++++++++- .../files/lib/data/package/Package.class.php | 10 +++++++++ .../files/lib/data/smiley/Smiley.class.php | 13 ++++++++++-- .../lib/data/user/group/UserGroup.class.php | 10 +++++++++ .../user/menu/item/UserMenuItem.class.php | 11 +++++++++- .../lib/data/user/rank/UserRank.class.php | 11 +++++++++- wcfsetup/install/lang/de.xml | 18 ++++++++-------- wcfsetup/install/lang/en.xml | 18 ++++++++-------- 64 files changed, 211 insertions(+), 105 deletions(-) diff --git a/com.woltlab.wcf/templates/__labelFormField.tpl b/com.woltlab.wcf/templates/__labelFormField.tpl index 971066d4b1..e683b7a9bc 100644 --- a/com.woltlab.wcf/templates/__labelFormField.tpl +++ b/com.woltlab.wcf/templates/__labelFormField.tpl @@ -9,7 +9,7 @@ @@ -20,7 +20,7 @@ diff --git a/com.woltlab.wcf/templates/__menu.tpl b/com.woltlab.wcf/templates/__menu.tpl index 6798493162..e3db63dc83 100644 --- a/com.woltlab.wcf/templates/__menu.tpl +++ b/com.woltlab.wcf/templates/__menu.tpl @@ -5,19 +5,19 @@ {foreach from=$menuItemNodeList item=menuItemNode}
  • isExternalLink()}{if EXTERNAL_LINK_REL_NOFOLLOW} rel="nofollow"{/if}{if EXTERNAL_LINK_TARGET_BLANK} target="_blank"{/if}{/if}{if $menuItemNode->isActiveNode()} aria-current="page"{/if}> - {lang}{$menuItemNode->title}{/lang} + {$menuItemNode->getTitle()} {if $menuItemNode->getOutstandingItems() > 0} {#$menuItemNode->getOutstandingItems()} {/if} {if $menuItemNode->hasChildren()}
      {else}{/if} - + {if !$menuItemNode->hasChildren() && $menuItemNode->isLastSibling()} {@"
  • "|str_repeat:$menuItemNode->getOpenParentNodes()} {/if} {/foreach} - + {event name='menuAfter'} diff --git a/com.woltlab.wcf/templates/ampFooter.tpl b/com.woltlab.wcf/templates/ampFooter.tpl index 5b68e6a8c0..68dfff497e 100644 --- a/com.woltlab.wcf/templates/ampFooter.tpl +++ b/com.woltlab.wcf/templates/ampFooter.tpl @@ -8,7 +8,7 @@ {foreach from=$__wcf->getBoxHandler()->getBoxByIdentifier('com.woltlab.wcf.MainMenu')->getMenu()->getMenuItemNodeList() item=menuItemNode} {if $menuItemNode->getDepth() == 1 || $menuItemNode->getParentNode()->isActiveNode()}
  • - {lang}{$menuItemNode->title}{/lang} + {$menuItemNode->getTitle()} {if $menuItemNode->hasChildren() && $menuItemNode->isActiveNode()}
      {else}{/if} @@ -21,7 +21,7 @@ {if $__wcf->getBoxHandler()->getBoxByIdentifier('com.woltlab.wcf.FooterMenu')}
        {foreach from=$__wcf->getBoxHandler()->getBoxByIdentifier('com.woltlab.wcf.FooterMenu')->getMenu()->getMenuItemNodeList() item=menuItemNode} -
      1. {lang}{$menuItemNode->title}{/lang}
      2. +
      3. {$menuItemNode->getTitle()}
      4. {/foreach}
      {/if} diff --git a/com.woltlab.wcf/templates/article.tpl b/com.woltlab.wcf/templates/article.tpl index 31e8509263..4b317e87e8 100644 --- a/com.woltlab.wcf/templates/article.tpl +++ b/com.woltlab.wcf/templates/article.tpl @@ -12,7 +12,7 @@
        {foreach from=$article->getLabels() item=label} -
      • {lang}{$label->label}{/lang}
      • +
      • {$label->getTitle()}
      • {/foreach}
      diff --git a/com.woltlab.wcf/templates/articleAdd.tpl b/com.woltlab.wcf/templates/articleAdd.tpl index 355012dcdc..9f9e8dec19 100644 --- a/com.woltlab.wcf/templates/articleAdd.tpl +++ b/com.woltlab.wcf/templates/articleAdd.tpl @@ -133,7 +133,7 @@ @@ -142,7 +142,7 @@ diff --git a/com.woltlab.wcf/templates/articleList.tpl b/com.woltlab.wcf/templates/articleList.tpl index c6d18d18dd..e580bd3499 100644 --- a/com.woltlab.wcf/templates/articleList.tpl +++ b/com.woltlab.wcf/templates/articleList.tpl @@ -54,7 +54,7 @@ @@ -66,7 +66,7 @@ {foreach from=$labelGroup item=label} - + {/foreach} {/foreach} diff --git a/com.woltlab.wcf/templates/articleListItems.tpl b/com.woltlab.wcf/templates/articleListItems.tpl index 13f4a11144..c967515ace 100644 --- a/com.woltlab.wcf/templates/articleListItems.tpl +++ b/com.woltlab.wcf/templates/articleListItems.tpl @@ -21,7 +21,7 @@ {if $article->hasLabels()}
      {foreach from=$article->getLabels() item=label} - {lang}{$label->label}{/lang} + {$label->getTitle()} {/foreach}
      {/if} diff --git a/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl b/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl index 15a0555d9d..a5ecf3aeb3 100644 --- a/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl +++ b/com.woltlab.wcf/templates/boxPaidSubscriptions.tpl @@ -2,7 +2,7 @@ {foreach from=$subscriptions item=subscription}
    1. -

      {$subscription->title|language}

      +

      {$subscription->getTitle()}

      {lang}wcf.paidSubscription.formattedCost{/lang}
      diff --git a/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl b/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl index 1d67d59fb9..15d3696670 100644 --- a/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl +++ b/com.woltlab.wcf/templates/boxPaidSubscriptionsSidebar.tpl @@ -2,7 +2,7 @@ {foreach from=$subscriptions item=subscription}
    2. -

      {$subscription->title|language}

      +

      {$subscription->getTitle()}

      {lang}wcf.paidSubscription.formattedCost{/lang}
      diff --git a/com.woltlab.wcf/templates/captchaQuestion.tpl b/com.woltlab.wcf/templates/captchaQuestion.tpl index 92a6763ad5..af441f48f5 100644 --- a/com.woltlab.wcf/templates/captchaQuestion.tpl +++ b/com.woltlab.wcf/templates/captchaQuestion.tpl @@ -6,7 +6,7 @@
      -
      +
      {if (($errorType|isset && $errorType|is_array && $errorType[captchaAnswer]|isset) || ($errorField|isset && $errorField == 'captchaAnswer'))} diff --git a/com.woltlab.wcf/templates/categoryArticleList.tpl b/com.woltlab.wcf/templates/categoryArticleList.tpl index a6d7cac427..7ff59dd426 100644 --- a/com.woltlab.wcf/templates/categoryArticleList.tpl +++ b/com.woltlab.wcf/templates/categoryArticleList.tpl @@ -52,7 +52,7 @@ @@ -64,7 +64,7 @@ {foreach from=$labelGroup item=label} - + {/foreach} {/foreach} diff --git a/com.woltlab.wcf/templates/customOptionFieldList.tpl b/com.woltlab.wcf/templates/customOptionFieldList.tpl index 23fb04c808..d8c25f5cac 100644 --- a/com.woltlab.wcf/templates/customOptionFieldList.tpl +++ b/com.woltlab.wcf/templates/customOptionFieldList.tpl @@ -1,9 +1,9 @@ {foreach from=$options item=optionData} {assign var=option value=$optionData[object]}
      - {if $option->required} *{/if} + {if $option->required} *{/if}
      {@$optionData[html]} - {lang __optional=true}{$option->optionDescription}{/lang} + {$option->getDescription()} {if $errorType|is_array && $errorType[$option->optionName]|isset} diff --git a/com.woltlab.wcf/templates/messageFormSmilies.tpl b/com.woltlab.wcf/templates/messageFormSmilies.tpl index cf632e523a..593c5a80b9 100644 --- a/com.woltlab.wcf/templates/messageFormSmilies.tpl +++ b/com.woltlab.wcf/templates/messageFormSmilies.tpl @@ -3,7 +3,7 @@ {foreach from=$smileyCategories item=smileyCategory} {assign var=__tabCount value=$__tabCount + 1} {assign var='__smileyAnchor' value='smilies-'|concat:$smileyCategory->categoryID} -
    3. {$smileyCategory->title|language}
    4. +
    5. {$smileyCategory->getTitle()}
    6. {/foreach} {/capture} diff --git a/com.woltlab.wcf/templates/pageHeaderUser.tpl b/com.woltlab.wcf/templates/pageHeaderUser.tpl index 17732d83e3..3432a0a627 100644 --- a/com.woltlab.wcf/templates/pageHeaderUser.tpl +++ b/com.woltlab.wcf/templates/pageHeaderUser.tpl @@ -56,7 +56,7 @@
      -

      {lang}{$menuCategory->menuItem}{/lang}

      +

      {$menuCategory->getTitle()}

        {foreach from=$__wcf->getUserMenu()->getMenuItems($menuCategory->menuItem) item=menuItem} diff --git a/com.woltlab.wcf/templates/pageMenuMobile.tpl b/com.woltlab.wcf/templates/pageMenuMobile.tpl index 03be406cd3..587d4cd3ea 100644 --- a/com.woltlab.wcf/templates/pageMenuMobile.tpl +++ b/com.woltlab.wcf/templates/pageMenuMobile.tpl @@ -9,7 +9,7 @@ + {foreach from=$__wcf->getUserMenu()->getMenuItems($menuCategory->menuItem) item=menuItem}
      • -

        {$subscription->title|language} {lang}wcf.paidSubscription.formattedCost{/lang}

        +

        {$subscription->getTitle()} {lang}wcf.paidSubscription.formattedCost{/lang}

        {@$subscription->getFormattedDescription()}
        @@ -66,7 +66,7 @@ {foreach from=$userSubscriptions item=userSubscription}
      • -

        {$userSubscription->getSubscription()->title|language}

        +

        {$userSubscription->getSubscription()->getTitle()}

        {@$userSubscription->getSubscription()->getFormattedDescription()}
        diff --git a/com.woltlab.wcf/templates/team.tpl b/com.woltlab.wcf/templates/team.tpl index 117b3aa8b3..5be88c3716 100644 --- a/com.woltlab.wcf/templates/team.tpl +++ b/com.woltlab.wcf/templates/team.tpl @@ -3,8 +3,8 @@ {foreach from=$objects->getTeams() item=team}
        -

        {$team->groupName|language} {#$team->getMembers()|count}

        -

        {$team->groupDescription|language}

        +

        {$team->getTitle()} {#$team->getMembers()|count}

        +

        {$team->getDescription()}

          diff --git a/com.woltlab.wcf/templates/unreadArticleList.tpl b/com.woltlab.wcf/templates/unreadArticleList.tpl index 144cd88944..4d8dd072eb 100644 --- a/com.woltlab.wcf/templates/unreadArticleList.tpl +++ b/com.woltlab.wcf/templates/unreadArticleList.tpl @@ -31,7 +31,7 @@ @@ -43,7 +43,7 @@ {foreach from=$labelGroup item=label} - + {/foreach} {/foreach} diff --git a/com.woltlab.wcf/templates/userMenuSidebar.tpl b/com.woltlab.wcf/templates/userMenuSidebar.tpl index 964ca303f9..a94cd4e9bc 100644 --- a/com.woltlab.wcf/templates/userMenuSidebar.tpl +++ b/com.woltlab.wcf/templates/userMenuSidebar.tpl @@ -12,7 +12,7 @@
          {foreach from=$__wcf->getUserMenu()->getMenuItems('') item=menuCategory} -

          {lang}{$menuCategory->menuItem}{/lang}

          +

          {$menuCategory->getTitle()}

      diff --git a/wcfsetup/install/files/acp/templates/smileyList.tpl b/wcfsetup/install/files/acp/templates/smileyList.tpl index a9dff1627e..ac9d542107 100644 --- a/wcfsetup/install/files/acp/templates/smileyList.tpl +++ b/wcfsetup/install/files/acp/templates/smileyList.tpl @@ -41,7 +41,7 @@ @@ -52,7 +52,7 @@ {foreach from=$objects item=smiley}
    7. - {@$smiley->getHtml()} {lang}{$smiley->smileyTitle}{/lang} {$smiley->smileyCode}{foreach from=$smiley->getAliases() item='alias'} {$alias}{/foreach} + {@$smiley->getHtml()} {$smiley->getTitle()} {$smiley->smileyCode}{foreach from=$smiley->getAliases() item='alias'} {$alias}{/foreach} diff --git a/wcfsetup/install/files/acp/templates/userGroupList.tpl b/wcfsetup/install/files/acp/templates/userGroupList.tpl index d525eb1438..a1c0383d1f 100644 --- a/wcfsetup/install/files/acp/templates/userGroupList.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupList.tpl @@ -65,9 +65,9 @@ {@$group->groupID} {if $group->isEditable()} - {lang}{$group->groupName}{/lang} + {$group->getTitle()} {else} - {lang}{$group->groupName}{/lang} + {$group->getTitle()} {/if} {if $group->isOwner()} diff --git a/wcfsetup/install/files/acp/templates/userGroupOption.tpl b/wcfsetup/install/files/acp/templates/userGroupOption.tpl index b7be485a44..9b5031d904 100644 --- a/wcfsetup/install/files/acp/templates/userGroupOption.tpl +++ b/wcfsetup/install/files/acp/templates/userGroupOption.tpl @@ -124,7 +124,7 @@
      {if VISITOR_USE_TINY_BUILD && $guestGroupID == $group->groupID && $userGroupOption->excludedInTinyBuild} {/if} {if $ownerGroupID == $group->groupID && $userGroupOption->optionName|in_array:$ownerGroupPermissions} {/if} - +
      {@$formElements[$group->groupID]} diff --git a/wcfsetup/install/files/acp/templates/userRankAdd.tpl b/wcfsetup/install/files/acp/templates/userRankAdd.tpl index 035791ca85..7758939831 100644 --- a/wcfsetup/install/files/acp/templates/userRankAdd.tpl +++ b/wcfsetup/install/files/acp/templates/userRankAdd.tpl @@ -138,7 +138,7 @@
      {if $errorField == 'groupID'} diff --git a/wcfsetup/install/files/acp/templates/userRankList.tpl b/wcfsetup/install/files/acp/templates/userRankList.tpl index 320466f694..0aa2d4765d 100644 --- a/wcfsetup/install/files/acp/templates/userRankList.tpl +++ b/wcfsetup/install/files/acp/templates/userRankList.tpl @@ -52,7 +52,7 @@ {event name='rowButtons'} {@$userRank->rankID} - {$userRank->rankTitle|language} + {$userRank->getTitle()} {if $userRank->rankImage}{@$userRank->getImage()}{/if} {$userRank->groupName|language} {if $userRank->requiredGender}{if $userRank->requiredGender == 1}{lang}wcf.user.gender.male{/lang}{else}{lang}wcf.user.gender.female{/lang}{/if}{/if} diff --git a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl index 642d5076d3..155af844e2 100644 --- a/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwygToolbar.tpl @@ -80,11 +80,11 @@ buttons.push('woltlabQuote'); {foreach from=$__wcf->getBBCodeHandler()->getButtonBBCodes(true) item=__bbcode} {* the HTML bbcode must be handled differently, it conflicts with the `source` toggle-button *} {if $__bbcode->bbcodeTag === 'html'} - buttonOptions['woltlabHtml'] = { icon: '{$__bbcode->wysiwygIcon}', title: '{lang}{$__bbcode->buttonLabel}{/lang}' }; + buttonOptions['woltlabHtml'] = { icon: '{$__bbcode->wysiwygIcon}', title: '{$__bbcode->getButtonLabel()}' }; buttons.push('woltlabHtml'); customButtons.push('woltlabHtml'); {else} - buttonOptions['{$__bbcode->bbcodeTag}'] = { icon: '{$__bbcode->wysiwygIcon}', title: '{lang}{$__bbcode->buttonLabel}{/lang}' }; + buttonOptions['{$__bbcode->bbcodeTag}'] = { icon: '{$__bbcode->wysiwygIcon}', title: '{$__bbcode->getButtonLabel()}' }; buttons.push('{$__bbcode->bbcodeTag}'); customButtons.push('{$__bbcode->bbcodeTag}'); {/if} diff --git a/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php b/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php index 007c7600d7..21366d5165 100644 --- a/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php +++ b/wcfsetup/install/files/lib/data/bbcode/BBCode.class.php @@ -78,6 +78,16 @@ class BBCode extends ProcessibleDatabaseObject implements IRouteController { return $this->bbcodeTag; } + /** + * Returns the button label in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getButtonLabel() { + return WCF::getLanguage()->get($this->buttonLabel); + } + /** * Returns BBCode object with the given tag. * diff --git a/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php b/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php index ddc745108f..279722cfbc 100644 --- a/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php +++ b/wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestion.class.php @@ -19,6 +19,16 @@ use wcf\util\StringUtil; * @property-read integer $isDisabled is `1` if the captcha question is disabled and thus not offered to answer, otherwise `0` */ class CaptchaQuestion extends DatabaseObject { + /** + * Returns the question in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getQuestion() { + return WCF::getLanguage()->get($this->question); + } + /** * Returns true if the given user input is an answer to this question. * diff --git a/wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php b/wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php index d0341ef3f6..ae552fd811 100644 --- a/wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/Cronjob.class.php @@ -2,6 +2,7 @@ namespace wcf\data\cronjob; use wcf\data\DatabaseObject; use wcf\data\TDatabaseObjectOptions; +use wcf\system\WCF; use wcf\util\CronjobUtil; /** @@ -120,4 +121,14 @@ class Cronjob extends DatabaseObject { public function canBeDisabled() { return $this->canBeDisabled; } + + /** + * Returns the cronjob description in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getDescription() { + return WCF::getLanguage()->get($this->description); + } } diff --git a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php index 3ddf288688..2f62097235 100644 --- a/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php +++ b/wcfsetup/install/files/lib/data/custom/option/CustomOption.class.php @@ -1,5 +1,6 @@ get($this->optionTitle); + } + + /** + * Returns the option description in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getDescription() { + return WCF::getLanguage()->get($this->optionDescription); + } + /** * Returns true if the option is visible * diff --git a/wcfsetup/install/files/lib/data/menu/Menu.class.php b/wcfsetup/install/files/lib/data/menu/Menu.class.php index 889b3ff5dc..77b86a5bcf 100644 --- a/wcfsetup/install/files/lib/data/menu/Menu.class.php +++ b/wcfsetup/install/files/lib/data/menu/Menu.class.php @@ -1,6 +1,7 @@ get($this->title); diff --git a/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php b/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php index 20aae68139..ca9b48f8ea 100644 --- a/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php +++ b/wcfsetup/install/files/lib/data/menu/item/MenuItem.class.php @@ -1,5 +1,6 @@ get($this->title); + } + /** * Returns true if the active user can delete this menu item. * diff --git a/wcfsetup/install/files/lib/data/package/Package.class.php b/wcfsetup/install/files/lib/data/package/Package.class.php index 1a4a287223..9c5d9e0c42 100644 --- a/wcfsetup/install/files/lib/data/package/Package.class.php +++ b/wcfsetup/install/files/lib/data/package/Package.class.php @@ -111,6 +111,16 @@ class Package extends DatabaseObject { return $this->getName(); } + /** + * Returns the description of this package in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getDescription() { + return WCF::getLanguage()->get($this->packageDescription); + } + /** * Returns the abbreviation of the package name. * diff --git a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php index 77dfe9010c..7e0dd94bf5 100644 --- a/wcfsetup/install/files/lib/data/smiley/Smiley.class.php +++ b/wcfsetup/install/files/lib/data/smiley/Smiley.class.php @@ -1,6 +1,7 @@ get($this->smileyTitle); + } + /** * Returns the url to this smiley. * diff --git a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php index 43a9e4312c..d9b9313785 100644 --- a/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php +++ b/wcfsetup/install/files/lib/data/user/group/UserGroup.class.php @@ -444,6 +444,16 @@ class UserGroup extends DatabaseObject implements ITitledObject { return WCF::getLanguage()->get($this->groupName); } + /** + * Returns the user group description in the active user's language. + * + * @return string + * @since 5.2 + */ + public function getDescription() { + return WCF::getLanguage()->get($this->groupDescription); + } + /** * The `Everyone`, `Guests` and `Users` group can never be mentioned. * diff --git a/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php b/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php index a633cdd8dc..147602ff9d 100644 --- a/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php +++ b/wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php @@ -1,5 +1,6 @@ getLink($this->controller, ['application' => $this->application], $this->menuItemLink); } + /** + * @inheritDoc + * @since 5.2 + */ + public function getTitle() { + return WCF::getLanguage()->get($this->menuItem); + } + /** * Returns application abbreviation. * diff --git a/wcfsetup/install/files/lib/data/user/rank/UserRank.class.php b/wcfsetup/install/files/lib/data/user/rank/UserRank.class.php index f7b2ea0870..513e4c4259 100644 --- a/wcfsetup/install/files/lib/data/user/rank/UserRank.class.php +++ b/wcfsetup/install/files/lib/data/user/rank/UserRank.class.php @@ -1,6 +1,7 @@ get($this->rankTitle); + } + /** * Returns true if the generic rank title should be displayed. * diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index e1b7c0b917..40c18fb7c6 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -271,7 +271,7 @@ - {$question->question|language} wirklich löschen?]]> + {$question->getQuestion()} wirklich löschen?]]> @@ -327,7 +327,7 @@ - {$cronjob->description|language} wirklich löschen?]]> + {$cronjob->getDescription()} wirklich löschen?]]> @@ -653,7 +653,7 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in - {$group->groupName|language} wirklich löschen?]]> + {$group->getTitle()} wirklich löschen?]]> @@ -939,7 +939,7 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in - {$group->groupName|language} wirklich löschen?]]> + {$group->getTitle()} wirklich löschen?]]> @@ -1151,7 +1151,7 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in - {$menuItemNode->title|language} wirklich löschen?]]> + {$menuItemNode->getTitle()} wirklich löschen?]]> @@ -1773,7 +1773,7 @@ Die Datenbestände werden sorgfältig gepflegt, aber es ist nicht ausgeschlossen - {$option->optionTitle|language} wirklich löschen?]]> + {$option->getTitle()} wirklich löschen?]]> @@ -1811,7 +1811,7 @@ Die Datenbestände werden sorgfältig gepflegt, aber es ist nicht ausgeschlossen - packageName|language}“ kann mit dem angegebenen Archiv nicht aktualisiert werden.]]> + getName()}“ kann mit dem angegebenen Archiv nicht aktualisiert werden.]]> @@ -2749,7 +2749,7 @@ Kein Abschnitt darf leer sein und alle Abschnitten dürfen nur folgende Zeichen - {$smiley->smileyTitle|language} wirklich löschen?]]> + {$smiley->getTitle()} wirklich löschen?]]> @@ -3073,7 +3073,7 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} unter „Konfiguration CSS-Klasse nutzen.]]> - {$userRank->rankTitle|language} wirklich löschen?]]> + {$userRank->getTitle()} wirklich löschen?]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index 3a602f4714..f90ce2edb3 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -270,7 +270,7 @@ - question|language}”?]]> + getQuestion()}”?]]> @@ -304,7 +304,7 @@ - {$cronjob->description|language}?]]> + {$cronjob->getDescription()}?]]> @@ -629,7 +629,7 @@ This protocol file contains {$data[count]} new entries. The first three error me - {$group->groupName|language}?]]> + {$group->getTitle()}?]]> @@ -916,7 +916,7 @@ This protocol file contains {$data[count]} new entries. The first three error me - {$group->groupName|language}?]]> + {$group->getTitle()}?]]> @@ -1128,7 +1128,7 @@ This protocol file contains {$data[count]} new entries. The first three error me - {$menuItemNode->title|language}?]]> + {$menuItemNode->getTitle()}?]]> @@ -1758,7 +1758,7 @@ The database is carefully maintained, but there will be always be a margin of er - {$option->optionTitle|language}?]]> + {$option->getTitle()}?]]> @@ -1796,7 +1796,7 @@ The database is carefully maintained, but there will be always be a margin of er - packageName|language}” cannot be updated using the selected archive.]]> + getName()}” cannot be updated using the selected archive.]]> @@ -2677,7 +2677,7 @@ If you have already bought the licenses for the listed apps, th - {$smiley->smileyTitle|language}?]]> + {$smiley->getTitle()}?]]> @@ -3001,7 +3001,7 @@ You can define the default sender in “Configuration » Options » General » E CSS class name.]]> - {$userRank->rankTitle|language}?]]> + {$userRank->getTitle()}?]]> -- 2.20.1