Multilanguage tiddler - a use case for the new $slot and $fill widgets

Hi, everyone,

recently I’ve read the thread How to make $slot and $fill palatable

and then tried to become familiar with these new widgets.

I think $transclude, $slot and $fill are a very powerful set of new tools, which can ease our life with TW.
Only the current examples in the documentation are so dust dry. On the first sight it is hard to imagine, to find a useful application for it.

a real life example from my TW project: I need
to translate a text in another language and hold a text section of the source language and the translation in one tiddler. This seems to be easy, but what if you want to display this tiddlers in diffent use cases?

for example:
a) compile all the text sections as translation one after the other
b) compile all text sections to show only the source or
c) compile them to show only the translation…

It is possible with fields but not really easy going.

Here is my demo with the use of the new $slot and $fill widgets, the new mode of $transclude and the \parameter pragma.

https://slot-and-fill-demo.tiddlyhost.com/

slot-and-fill-demo.json (2.7 KB)

Hope some of you will find it useful as I do…

regards Michael

1 Like

Thanks for sharing @Michael_Schroder that is an interesting application, and one which I would like to be able to make less verbose in the future.