Switch the language by macro call

Hello,

I am learning the tiddlywiki possibilities and have simple question?
How to swich the language by call a macro?
I foud out that the $:/language is switching from $:/languages/en-GB to $:/languages/de-DE if I use the banner.

In my tiddlywiki I have the same content but in differen languages. Therfore I developed a buuton to switch from english to german and other languages.

What I have to add to my macro to switch also the $:/language ???

\define myActions()
<$list filter="Inhaltsverzeichnis" >
  <$action-listops $tags="+$:/tags/SideBar"/>
</$list>
<$list filter="TableOfContents" >
  <$action-listops $tags="-$:/tags/SideBar"/>
</$list>
<$action-navigate $to="0.0.0.1. Willkommen"/>
**??? switch the $:/language to $:/languages/de-DE ???**
\end

Thx in advance

Did you read the action-listops docs? https://tiddlywiki.com/#ActionListopsWidget
There is a $tiddler parameter. So you do not need the <list widgets in your macro.

Also see: https://tiddlywiki.com/#toggle%20Operator

For testing try this:

\define myActions()

<$action-listops $tiddler="Inhaltsverzeichnis" $tags="+[toggle[$:/tags/SideBar],[]]"/>
<$action-listops $tiddler="TableOfContents" $tags="+[toggle[$:/tags/SideBar],[]]"/>

<$action-listops $tiddler="language" $field=text $subfilter="+[toggle[german],[english]]"/>

\end

<$button actions=<<myActions>>>click</$button>

If it works with the “language” tiddler you can use the real system tiddlers.

Thank you for your support.
But I don’t want to toggle I want to offer the user buttons to switch to their language and content.
I found this what solved my requirement:

<$action-setfield $tiddler="$:/language" text="$:/languages/de-DE"/>

Thank you

OK. … But you still do not need the list-widget as shown in the OP. You only need to set the $tiddler parameter. … just an info :wink:

1 Like