1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-28 02:50:27 +00:00

Add dropdown for filtering translatable strings

The user can now choose between showing all strings, just those that
haven’t been translated, or just those that have been translated.
This commit is contained in:
Jermolene 2014-10-24 12:50:23 +01:00
parent 39e37d5776
commit a2672482c9
2 changed files with 28 additions and 1 deletions

View File

@ -39,6 +39,22 @@ Delete translation
</tr>
\end
\define translatableStringEditorWrapperAll(tiddlerTitle)
<<translatableStringEditorInner "$tiddlerTitle$">>
\end
\define translatableStringEditorWrapperTranslated(tiddlerTitle)
<$list filter="[all[current]is[tiddler]]">
<<translatableStringEditorInner "$tiddlerTitle$">>
</$list>
\end
\define translatableStringEditorWrapperNotTranslated(tiddlerTitle)
<$list filter="[all[current]!is[tiddler]]">
<<translatableStringEditorInner "$tiddlerTitle$">>
</$list>
\end
\define translatableStringEditorOuter()
<div class="tc-translators-string-table">
@ -47,6 +63,12 @@ Delete translation
<$radio tiddler="$:/plugins/tiddlywiki/translators/editorTag" value="textarea"> Multi-line editors</$radio><br>
<$radio tiddler="$:/plugins/tiddlywiki/translators/editorTag" value="input"> Single-line editors</$radio>
<$select tiddler="$:/plugins/tiddlywiki/translators/editorView">
<option value="translatableStringEditorWrapperAll">Show all strings</option>
<option value="translatableStringEditorWrapperTranslated">Only show translated strings</option>
<option value="translatableStringEditorWrapperNotTranslated">Only show strings that have not been translated</option>
</$select>
<table>
<tbody>
<tr>
@ -60,9 +82,11 @@ Fields: $(editFieldsFilter)$
&nbsp;
</th>
</tr>
<$set name="editorView" value={{$:/plugins/tiddlywiki/translators/editorView}}>
<$list filter=<<translatableTiddlerTitles>>>
<$macrocall $name="translatableStringEditorInner" tiddlerTitle=<<currentTiddler>>/>
<$macrocall $name=<<editorView>> tiddlerTitle=<<currentTiddler>>/>
</$list>
</$set>
</tbody>
</table>
\end

View File

@ -0,0 +1,3 @@
title: $:/plugins/tiddlywiki/translators/editorView
translatableStringEditorWrapperAll