mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
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?
This commit is contained in:
parent
8adcfc97c5
commit
789ba1e85d
10
core/images/globe.tid
Normal file
10
core/images/globe.tid
Normal file
@ -0,0 +1,10 @@
|
||||
title: $:/core/images/globe
|
||||
tags: $:/tags/Image
|
||||
|
||||
<svg class="tw-image-globe tw-image-button" width="128px" height="128px" viewBox="0 0 128 128">
|
||||
<g fill-rule="evenodd">
|
||||
<path d="M72.8111354,37.1275855 C72.8111354,37.9789875 72.8111354,38.8303894 72.8111354,39.6817913 C72.8111354,41.8784743 73.7885604,46.5631866 72.8111354,48.5143758 C71.3445471,51.4420595 68.1617327,52.0543531 66.4170946,54.3812641 C65.2352215,55.9575873 61.7987417,64.9821523 62.7262858,67.3005778 C66.6959269,77.2228204 74.26087,70.4881886 80.6887657,76.594328 C81.5527211,77.415037 83.5758191,78.8666631 83.985137,79.8899578 C87.2742852,88.1128283 76.4086873,94.8989524 87.7419325,106.189751 C88.9872885,107.430443 91.555495,102.372895 91.8205061,101.575869 C92.6726866,99.0129203 98.5458765,96.1267309 100.908882,94.5234439 C102.928056,93.1534443 105.782168,91.8557166 107.236936,89.7775886 C109.507391,86.5342557 108.717505,82.2640435 110.334606,79.0328716 C112.473794,74.7585014 114.163418,69.3979002 116.332726,65.0674086 C120.230862,57.2857361 121.054075,67.1596684 121.400359,67.5059523 C121.757734,67.8633269 122.411167,67.5059523 122.916571,67.5059523 C123.011132,67.5059523 124.364019,67.6048489 124.432783,67.5059523 C125.0832,66.5705216 123.390209,49.5852316 123.114531,48.2089091 C121.710578,41.1996597 116.17083,32.4278331 111.249523,27.7092761 C104.975994,21.6942076 104.160516,11.5121686 92.9912146,12.7547535 C92.7872931,12.7774397 87.906794,22.9027026 85.2136766,26.2672064 C81.486311,30.9237934 82.7434931,22.1144904 78.6876623,22.1144904 C78.6065806,22.1144904 77.5045497,22.0107615 77.4353971,22.1144904 C76.8488637,22.9942905 75.9952305,26.0101404 75.1288269,26.5311533 C74.8635477,26.6906793 73.4071369,26.2924966 73.2826811,26.5311533 C71.0401728,30.8313939 81.5394677,28.7427264 79.075427,34.482926 C76.7225098,39.9642538 72.747373,32.4860199 72.747373,43.0434079"></path>
|
||||
<path d="M44.4668556,7.01044608 C54.151517,13.1403033 45.1489715,19.2084878 47.1611905,23.2253896 C48.8157833,26.5283781 51.4021933,28.6198851 48.8753629,33.038878 C46.8123257,36.6467763 42.0052989,37.0050492 39.251679,39.7621111 C36.2115749,42.8060154 33.7884281,48.7028116 32.4624592,52.6732691 C30.8452419,57.5158356 47.0088721,59.5388126 44.5246867,63.6811917 C43.1386839,65.9923513 37.7785192,65.1466282 36.0880227,63.8791519 C34.9234453,63.0059918 32.4946425,63.3331166 31.6713597,62.0997342 C29.0575851,58.1839669 29.4107339,54.0758543 28.0457962,49.9707786 C27.1076833,47.1493864 21.732611,47.8501656 20.2022714,49.3776393 C19.6790362,49.8998948 19.8723378,51.1703278 19.8723378,51.8829111 C19.8723378,57.1682405 26.9914913,55.1986414 26.9914913,58.3421973 C26.9914913,72.9792302 30.9191897,64.8771867 38.1313873,69.6793121 C48.1678018,76.3618966 45.9763926,76.981595 53.0777543,84.0829567 C56.7511941,87.7563965 60.8192437,87.7689005 62.503478,93.3767069 C64.1046972,98.7081071 53.1759798,98.7157031 50.786754,100.825053 C49.663965,101.816317 47.9736094,104.970571 46.5680513,105.439676 C44.7757187,106.037867 43.334221,105.93607 41.6242359,107.219093 C39.1967302,109.040481 37.7241465,112.151588 37.6034934,112.030935 C35.4555278,109.88297 34.0848666,96.5511248 33.7147244,93.7726273 C33.1258872,89.3524817 28.1241923,88.2337027 26.7275443,84.7420826 C25.1572737,80.8164061 28.2518481,75.223612 25.599097,70.9819941 C19.0797019,60.557804 13.7775712,56.4811506 10.2493953,44.6896152 C9.3074899,41.5416683 13.5912267,38.1609942 15.1264825,35.8570308 C17.0029359,33.0410312 17.7876232,30.0028946 19.8723378,27.2224065 C22.146793,24.1888519 40.8551166,9.46076832 43.8574051,8.63490613 L44.4668556,7.01044608 Z"></path>
|
||||
<path d="M64,126 C98.2416545,126 126,98.2416545 126,64 C126,29.7583455 98.2416545,2 64,2 C29.7583455,2 2,29.7583455 2,64 C2,98.2416545 29.7583455,126 64,126 Z M64,120 C94.927946,120 120,94.927946 120,64 C120,33.072054 94.927946,8 64,8 C33.072054,8 8,33.072054 8,64 C8,94.927946 33.072054,120 64,120 Z"></path>
|
||||
</g>
|
||||
</svg>
|
@ -28,6 +28,8 @@ Info/Caption: info
|
||||
Info/Hint: Show information for this tiddler
|
||||
Home/Caption: home
|
||||
Home/Hint: Refresh the page and open the home tiddlers
|
||||
Language/Caption: language
|
||||
Language/Hint: Choose the user interface language
|
||||
NewTiddler/Caption: new tiddler
|
||||
NewTiddler/Hint: Create a new tiddler
|
||||
More/Caption: more
|
||||
|
13
core/language/en-GB/Flag.tid
Normal file
13
core/language/en-GB/Flag.tid
Normal file
@ -0,0 +1,13 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 30" width="1200" height="600">
|
||||
<clipPath id="t">
|
||||
<path d="M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"/>
|
||||
</clipPath>
|
||||
<path d="M0,0 v30 h60 v-30 z" fill="#00247d"/>
|
||||
<path d="M0,0 L60,30 M60,0 L0,30" stroke="#fff" stroke-width="6"/>
|
||||
<path d="M0,0 L60,30 M60,0 L0,30" clip-path="url(#t)" stroke="#cf142b" stroke-width="4"/>
|
||||
<path d="M30,0 v30 M0,15 h60" stroke="#fff" stroke-width="10"/>
|
||||
<path d="M30,0 v30 M0,15 h60" stroke="#cf142b" stroke-width="6"/>
|
||||
</svg>
|
33
core/ui/PageControls/language.tid
Normal file
33
core/ui/PageControls/language.tid
Normal file
@ -0,0 +1,33 @@
|
||||
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>
|
@ -7,24 +7,44 @@ description: {{$:/language/Buttons/More/Hint}}
|
||||
$:/config/PageControlButtons/Visibility/$(listItem)$
|
||||
\end
|
||||
<$button popup=<<qualify "$:/state/popup/more">> title={{$:/language/Buttons/More/Hint}} aria-label={{$:/language/Buttons/More/Caption}} class=<<tw-config-toolbar-class>> selectedClass="tw-selected">
|
||||
|
||||
<$list filter="[<tw-config-toolbar-icons>prefix[yes]]">
|
||||
|
||||
{{$:/core/images/down-arrow}}
|
||||
|
||||
</$list>
|
||||
|
||||
<$list filter="[<tw-config-toolbar-text>prefix[yes]]">
|
||||
|
||||
<$text text={{$:/language/Buttons/More/Caption}}/>
|
||||
|
||||
</$list>
|
||||
|
||||
</$button>
|
||||
|
||||
<$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes">
|
||||
|
||||
<div class="tw-drop-down">
|
||||
|
||||
<$set name="tw-config-toolbar-icons" value="yes">
|
||||
|
||||
<$set name="tw-config-toolbar-text" value="yes">
|
||||
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" variable="listItem">
|
||||
|
||||
<$reveal type="match" state=<<config-title>> text="hide">
|
||||
<$transclude tiddler=<<listItem>>/>
|
||||
</$reveal>
|
||||
</$list>
|
||||
</$set>
|
||||
</$set>
|
||||
</div>
|
||||
|
||||
<$transclude tiddler=<<listItem>> mode="inline"/>
|
||||
|
||||
</$reveal>
|
||||
|
||||
</$list>
|
||||
|
||||
</$set>
|
||||
|
||||
</$set>
|
||||
|
||||
</div>
|
||||
|
||||
</$reveal>
|
||||
|
||||
|
8
languages/de-AT/Flag.tid
Normal file
8
languages/de-AT/Flag.tid
Normal file
@ -0,0 +1,8 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600">
|
||||
<rect fill="#ed2939" width="900" height="600"/>
|
||||
<rect fill="#fff" y="200" width="900" height="200"/>
|
||||
</svg>
|
12
languages/de-DE/Flag.tid
Normal file
12
languages/de-DE/Flag.tid
Normal file
@ -0,0 +1,12 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1000" height="600" viewBox="0 0 5 3">
|
||||
<desc>Flag of Germany</desc>
|
||||
<rect id="black_stripe" width="5" height="3" y="0" x="0" fill="#000"/>
|
||||
<rect id="red_stripe" width="5" height="2" y="1" x="0" fill="#D00"/>
|
||||
<rect id="gold_stripe" width="5" height="1" y="2" x="0" fill="#FFCE00"/>
|
||||
</svg>
|
5
languages/fr-FR/Flag.tid
Normal file
5
languages/fr-FR/Flag.tid
Normal file
@ -0,0 +1,5 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600"><rect width="900" height="600" fill="#ED2939"/><rect width="600" height="600" fill="#fff"/><rect width="300" height="600" fill="#002395"/></svg>
|
32
languages/it-IT/Flag.tid
Normal file
32
languages/it-IT/Flag.tid
Normal file
@ -0,0 +1,32 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg
|
||||
height="1000"
|
||||
width="1500"
|
||||
version="1.1"
|
||||
viewBox="0 0 3 2"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<desc>Bandiera della Repubblica Italiana PMS 20060414</desc>
|
||||
<!--
|
||||
from http://commons.wikimedia.org/wiki/Image:Bandiera_della_Repubblica_Italiana_PMS_20060414.svg
|
||||
this text is in the public domain
|
||||
-->
|
||||
<rect
|
||||
fill="#009246"
|
||||
height="2"
|
||||
width="1" />
|
||||
<rect
|
||||
fill="#f1f2f1"
|
||||
height="2"
|
||||
width="1"
|
||||
x="1" />
|
||||
<rect
|
||||
fill="#ce2b37"
|
||||
height="2"
|
||||
width="1"
|
||||
x="2" />
|
||||
</svg>
|
8
languages/ja-JP/Flag.tid
Normal file
8
languages/ja-JP/Flag.tid
Normal file
@ -0,0 +1,8 @@
|
||||
title: $:/language/Flag
|
||||
type: image/svg+xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="900" height="600">
|
||||
<rect fill="#fff" height="600" width="900"/>
|
||||
<circle fill="#bc002d" cx="450" cy="300" r="180"/>
|
||||
</svg>
|
@ -238,7 +238,7 @@ a.tw-tiddlylink-external:hover {
|
||||
** Buttons
|
||||
*/
|
||||
|
||||
button svg {
|
||||
button svg, button img {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
@ -408,6 +408,10 @@ button svg {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.tw-page-controls img {
|
||||
width: 1em;
|
||||
}
|
||||
|
||||
.tw-page-controls svg {
|
||||
fill: <<colour sidebar-controls-foreground>>;
|
||||
}
|
||||
@ -618,7 +622,7 @@ button svg {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
.tw-tiddler-controls button svg {
|
||||
.tw-tiddler-controls button svg, .tw-tiddler-controls button img {
|
||||
height: 0.75em;
|
||||
fill: <<colour tiddler-controls-foreground>>;
|
||||
}
|
||||
@ -839,7 +843,7 @@ canvas.tw-edit-bitmapeditor {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.btn-dropdown svg {
|
||||
.btn-dropdown svg, .btn-dropdown img {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
fill: <<colour muted-foreground>>;
|
||||
@ -852,6 +856,8 @@ canvas.tw-edit-bitmapeditor {
|
||||
padding: 7px 0 7px 0;
|
||||
margin: 4px 0 0 0;
|
||||
white-space: nowrap;
|
||||
text-shadow: none;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.tw-drop-down button svg {
|
||||
@ -872,6 +878,7 @@ canvas.tw-edit-bitmapeditor {
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
color: <<colour foreground>>;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.tw-drop-down a:hover, .tw-drop-down button:hover {
|
||||
|
Loading…
Reference in New Issue
Block a user