dfcd5665212551d342fec94d23b43884a5730de8
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / messageFormMultilingualism.tpl
1 {if $availableContentLanguages|count}
2 {if $availableContentLanguages|count == 1}
3 {foreach from=$availableContentLanguages item=contentLanguage}
4 <input type="hidden" name="languageID" value="{$contentLanguage->languageID}">
5 {/foreach}
6 {else}
7 <dl{if $errorField == 'languageID'} class="formError"{/if}>
8 <dt>{lang}wcf.user.language{/lang}</dt>
9 <dd id="languageIDContainer">
10 <noscript>
11 <select name="languageID" id="languageID">
12 {foreach from=$availableContentLanguages item=contentLanguage}
13 <option value="{$contentLanguage->languageID}">{$contentLanguage}</option>
14 {/foreach}
15 </select>
16 </noscript>
17 </dd>
18 </dl>
19
20 <script data-relocate="true">
21 require(['WoltLabSuite/Core/Language/Chooser'], function(LanguageChooser) {
22 var languages = {
23 {implode from=$availableContentLanguages item=_language}
24 '{@$_language->languageID}': {
25 iconPath: '{@$_language->getIconPath()|encodeJS}',
26 languageName: '{@$_language|encodeJS}'
27 }
28 {/implode}
29 };
30
31 LanguageChooser.init('languageIDContainer', 'languageID', {$languageID}, languages)
32 });
33 </script>
34 {/if}
35 {/if}