1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 06:44:50 +00:00
TiddlyWiki5/core/ui/PageControls/language.tid

54 lines
1.7 KiB
Plaintext

title: $:/core/ui/Buttons/language
tags: $:/tags/PageControls
caption: {{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}}
description: {{$:/language/Buttons/Language/Hint}}
\define flag-title()
$(languagePluginTitle)$/icon
\end
<span class="tc-popup-keep">
<$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
<$list filter="[<tv-config-toolbar-icons>prefix[yes]]">
<span class="tc-image-button">
<$set name="languagePluginTitle" value={{$:/language}}>
<$image source=<<flag-title>>/>
</$set>
</span>
</$list>
<$list filter="[<tv-config-toolbar-text>prefix[yes]]">
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span>
</$list>
</$button>
</span>
<$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes">
<div class="tc-drop-down tc-drop-down-language-chooser">
<$linkcatcher to="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[description]]">
<$link>
<span class="tc-drop-down-bullet">
<$reveal type="match" state="$:/language" text=<<currentTiddler>>>
&bull;
</$reveal>
<$reveal type="nomatch" state="$:/language" text=<<currentTiddler>>>
&nbsp;
</$reveal>
</span>
<span class="tc-image-button">
<$set name="languagePluginTitle" value=<<currentTiddler>>>
<$transclude subtiddler=<<flag-title>>>
<$list filter="[all[current]field:title[$:/languages/en-GB]]">
<$transclude tiddler="$:/languages/en-GB/icon"/>
</$list>
</$transclude>
</$set>
</span>
<$view field="description">
<$view field="name">
<$view field="title"/>
</$view>
</$view>
</$link>
</$list>
</$linkcatcher>
</div>
</$reveal>