Language items in `wcf.global.` do not support template scripting by default. Instead of "manually" adding support for template scripting for this specific case, the relevant language item has been moved to a different language item category.
'wcf.global.button.close': '{jslang}wcf.global.button.close{/jslang}',
'wcf.global.button.collapsible': '{jslang}wcf.global.button.collapsible{/jslang}',
'wcf.global.button.delete': '{jslang}wcf.global.button.delete{/jslang}',
- 'wcf.global.button.delete.confirmMessage': '{jslang __literal=true}wcf.global.button.delete.confirmMessage{/jslang}',
+ 'wcf.button.delete.confirmMessage': '{jslang __literal=true}wcf.button.delete.confirmMessage{/jslang}',
'wcf.global.button.disable': '{jslang}wcf.global.button.disable{/jslang}',
'wcf.global.button.disabledI18n': '{jslang}wcf.global.button.disabledI18n{/jslang}',
'wcf.global.button.edit': '{jslang}wcf.global.button.edit{/jslang}',
'wcf.global.button.close': '{jslang}wcf.global.button.close{/jslang}',
'wcf.global.button.collapsible': '{jslang}wcf.global.button.collapsible{/jslang}',
'wcf.global.button.delete': '{jslang}wcf.global.button.delete{/jslang}',
- 'wcf.global.button.delete.confirmMessage': '{jslang __literal=true}wcf.global.button.delete.confirmMessage{/jslang}',
+ 'wcf.button.delete.confirmMessage': '{jslang __literal=true}wcf.button.delete.confirmMessage{/jslang}',
'wcf.global.button.disable': '{jslang}wcf.global.button.disable{/jslang}',
'wcf.global.button.disabledI18n': '{jslang}wcf.global.button.disabledI18n{/jslang}',
'wcf.global.button.edit': '{jslang}wcf.global.button.edit{/jslang}',
* attributes of the button
*
* One of the following aguments for `delete` action is required:
- * - `objectTitle`: name of the object used in the `wcf.global.button.delete.confirmMessage`
+ * - `objectTitle`: name of the object used in the `wcf.button.delete.confirmMessage`
* confirmation language item
* - `confirmMessage`: confirmation message or confirmation language item
*
switch ($action) {
case 'delete':
if (isset($tagArgs['objectTitle'])) {
- $confirmMessage = StringUtil::encodeHTML($tplObj->fetchString(
- $tplObj->getCompiler()->compileString(
- 'wcf.global.button.delete.confirmMessage',
- $language->get('wcf.global.button.delete.confirmMessage')
- )['template'],
- [
- 'objectTitle' => $tagArgs['objectTitle'],
- ]
- ));
- } elseif (isset($tagArgs['confirmMessage'])) {
$confirmMessage = StringUtil::encodeHTML(
- $tplObj->fetchString(
- $tplObj->getCompiler()->compileString(
- $tagArgs['confirmMessage'],
- $language->get($tagArgs['confirmMessage'])
- )['template']
+ $language->getDynamicVariable(
+ 'wcf.button.delete.confirmMessage',
+ [
+ 'objectTitle' => $tagArgs['objectTitle'],
+ ]
)
);
+ } elseif (isset($tagArgs['confirmMessage'])) {
+ $confirmMessage = StringUtil::encodeHTML(
+ $language->getDynamicVariable($tagArgs['confirmMessage'])
+ );
} else {
throw new \InvalidArgumentException("Missing 'objectTitle' or 'confirmMessage' argument for 'delete' action.");
}
<item name="wcf.bbcode.spoiler.text"><![CDATA[(Versteckter Text)]]></item>
<item name="wcf.bbcode.spoiler.simplified"><![CDATA[(Versteckter Text)]]></item>
</category>
+ <category name="wcf.button">
+ <item name="wcf.button.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} <span class="confirmationObject">{$objectTitle}</span> wirklich löschen?]]></item>
+ </category>
<category name="wcf.captcha">
<item name="wcf.captcha.useNoCaptcha"><![CDATA[(Kein Captcha)]]></item>
<item name="wcf.captcha.com.woltlab.wcf.recaptcha"><![CDATA[reCAPTCHA]]></item>
<item name="wcf.global.button.close"><![CDATA[Schließen]]></item>
<item name="wcf.global.button.collapsible"><![CDATA[Auf- und Zuklappen]]></item>
<item name="wcf.global.button.delete"><![CDATA[Löschen]]></item>
- <item name="wcf.global.button.delete.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} <span class="confirmationObject">{$objectTitle}</span> wirklich löschen?]]></item>
<item name="wcf.global.button.disable"><![CDATA[Deaktivieren]]></item>
<item name="wcf.global.button.disabledI18n"><![CDATA[einsprachig]]></item>
<item name="wcf.global.button.edit"><![CDATA[Bearbeiten]]></item>
<item name="wcf.bbcode.spoiler.text"><![CDATA[(Hidden Content)]]></item>
<item name="wcf.bbcode.spoiler.simplified"><![CDATA[(Hidden Content)]]></item>
</category>
+ <category name="wcf.button">
+ <item name="wcf.button.delete.confirmMessage"><![CDATA[Do you really want to delete <strong>{$objectTitle}</strong>?]]></item>
+ </category>
<category name="wcf.captcha">
<item name="wcf.captcha.useNoCaptcha"><![CDATA[(No Captcha)]]></item>
<item name="wcf.captcha.com.woltlab.wcf.recaptcha"><![CDATA[reCAPTCHA]]></item>
<item name="wcf.global.button.close"><![CDATA[Close]]></item>
<item name="wcf.global.button.collapsible"><![CDATA[Expand and Collapse]]></item>
<item name="wcf.global.button.delete"><![CDATA[Delete]]></item>
- <item name="wcf.global.button.delete.confirmMessage"><![CDATA[Do you really want to delete <strong>{$objectTitle}</strong>?]]></item>
<item name="wcf.global.button.disable"><![CDATA[Disable]]></item>
<item name="wcf.global.button.disabledI18n"><![CDATA[monolingual]]></item>
<item name="wcf.global.button.edit"><![CDATA[Edit]]></item>