From: Matthias Schmidt Date: Wed, 10 Jul 2019 11:52:08 +0000 (+0200) Subject: Replace lang prefilter with language modifier in template variables X-Git-Tag: 5.2.0_Alpha_2~27 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a41ce9459e97d83a620d5c3743907f4850f35eb5;p=GitHub%2FWoltLab%2FWCF.git Replace lang prefilter with language modifier in template variables (or with a dedicated `getTitle()` method) See #2963 --- diff --git a/wcfsetup/install/files/lib/data/user/option/UserOption.class.php b/wcfsetup/install/files/lib/data/user/option/UserOption.class.php index f2b11a1e49..c4731bb8d1 100644 --- a/wcfsetup/install/files/lib/data/user/option/UserOption.class.php +++ b/wcfsetup/install/files/lib/data/user/option/UserOption.class.php @@ -1,5 +1,6 @@ get('wcf.user.option.' . $this->optionName); + } + /** * Sets target user object. * diff --git a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php index 5ca920c657..d3de76094b 100644 --- a/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php +++ b/wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php @@ -1,6 +1,7 @@ categoryName; } + /** + * @inheritDoc + */ + public function getTitle() { + return WCF::getLanguage()->get('wcf.user.option.category.' . $this->categoryName); + } + /** * Returns an instance of UserOptionCategory by name. * diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index f9f932ffde..8999471bec 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -1147,11 +1147,11 @@ Das Fehlerprotokoll enthält {$data[count]} neue Einträge. Die ersten drei, in - {lang}{$menu->title}{/lang} wirklich löschen?]]> + {$menu->getTitle()} wirklich löschen?]]> - {lang}{$menuItemNode->title}{/lang} wirklich löschen?]]> + {$menuItemNode->title|language} wirklich löschen?]]> @@ -1908,14 +1908,14 @@ Die Datenbestände werden sorgfältig gepflegt, aber es ist nicht ausgeschlossen - - + + {foreach from=$packages item=package}
  • „{$package}“ ({$package->package})
  • {/foreach}]]>
    {foreach from=$packages item=package}
  • „{$package}“ ({$package->package})
  • {/foreach}]]>
    packageVersion}“ installiert.{/if}]]>
  • Die Datei wurde dem Archiv nicht hinzugefügt
  • Die Datei existiert, jedoch sind der Dateiname und die Angabe in den Anweisungen abweichend (Tippfehler)
  • ]]>
    - + @@ -3021,14 +3021,14 @@ Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du{else}Sie{/if} unter „Konfiguration - {lang}wcf.user.option.category.{$category->categoryName}{/lang} wirklich löschen?]]> + {$category->getTitle()} wirklich löschen?]]> - {lang}wcf.user.option.{$option->optionName}{/lang} wirklich löschen?]]> + {$option->getTitle()} wirklich löschen?]]> @@ -5163,9 +5163,9 @@ Benachrichtigungen auf {PAGE_TITLE|language - optionName}{/lang}“:]]> - optionName}{/lang}“ enthält:]]> - optionName}{/lang}“:]]> + getTitle()}“:]]> + getTitle()}“ enthält:]]> + getTitle()}“:]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index a8608438e4..e5040b1882 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -1124,11 +1124,11 @@ This protocol file contains {$data[count]} new entries. The first three error me - {lang}{$menu->title}{/lang}?]]> + {$menu->getTitle()}?]]> - {lang}{$menuItemNode->title}{/lang}?]]> + {$menuItemNode->title|language}?]]> @@ -1893,14 +1893,14 @@ The database is carefully maintained, but there will be always be a margin of er - - + + {foreach from=$packages item=package}
  • “{$package}” ({$package->package})
  • {/foreach}]]>
    {foreach from=$packages item=package}
  • “{$package}” ({$package->package})
  • {/foreach}]]>
    packageVersion}” is installed.{/if}]]>
  • The file has not been added to the archive at all
  • The file exists but under a (slightly) different name (typo)
  • ]]>
    - + @@ -2949,14 +2949,14 @@ You can define the default sender in “Configuration » Options » General » E - {lang}wcf.user.option.category.{$category->categoryName}{/lang}?]]> + {$category->getTitle()}?]]> - {lang}wcf.user.option.{$option->optionName}{/lang}?]]> + {$option->getTitle()}?]]> @@ -5162,9 +5162,9 @@ your notifications on
    {PAGE_TITLE|language} - optionName}{/lang}”:]]> - optionName}{/lang}” contains:]]> - optionName}{/lang}”:]]> + getTitle()}”:]]> + getTitle()}” contains:]]> + getTitle()}”:]]>