1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-07 20:44:23 +00:00
TiddlyWiki5/core/ui/PageControls/language.tid
Jermolene 789ba1e85d Add language toolbar button
Also adds flag icon for each language.

One limitation is that the language button doesn’t work properly when
accessed via the “more” menu of the page controls.

@BramChen - could you help me choose the most appropriate flags to use
for the variants of Chinese?
2014-07-31 18:07:37 +01:00

34 lines
1.2 KiB
Plaintext

title: $:/core/ui/Buttons/language
tags: $:/tags/PageControls
caption: {{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}}
description: {{$:/language/Buttons/Language/Hint}}
<$button popup=<<qualify "$:/state/popup/language">> title={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tw-config-toolbar-class>> selectedClass="tw-selected">
<$list filter="[<tw-config-toolbar-icons>prefix[yes]]">
<$transclude tiddler="$:/language/Flag"/>
</$list>
<$list filter="[<tw-config-toolbar-text>prefix[yes]]">
<$text text={{$:/language/Buttons/Language/Caption}}/>
</$list>
</$button>
<$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes">
<div class="tw-drop-down">
<$linkcatcher to="$:/language">
<$list filter="[[$:/languages/en-GB]] [plugin-type[language]sort[title]]">
<$link>
<$transclude subtiddler="$:/language/Flag">
<$list filter="[all[current]field:title[$:/languages/en-GB]]">
<$transclude tiddler="$:/core" subtiddler="$:/language/Flag"/>
</$list>
</$transclude>
<$view field="description">
<$view field="name">
<$view field="title"/>
</$view>
</$view>
</$link>
</$list>
</$linkcatcher>
</div>
</$reveal>