[TW5] change "hint" of core button w/ multi-language support

112 views
Skip to first unread message

Tobias Beer

unread,
Oct 10, 2016, 6:30:06 AM10/10/16
to TiddlyWiki
Hi everyone,

How can I override / define something like...

$:/language/Buttons/Home/Hint

for each of the languages I want to support?

Apparently, I cannot use any macro or markup as that gets rendered as is.

Best wishes,

Tobias.

Jeremy Ruston

unread,
Oct 10, 2016, 6:33:40 AM10/10/16
to tiddl...@googlegroups.com
Hi Tobias

How can I override / define something like...

$:/language/Buttons/Home/Hint

for each of the languages I want to support?

The usual way would be to use a different language plugin for each language. The language plugin switching mechanism takes care of switching in and out the right shadow tiddlers, and then the transclusion mechanism ensures that translatable text in the widget tree switches to the new language.

Apparently, I cannot use any macro or markup as that gets rendered as is.

Can you explain the context a little?

Best wishes

Jeremy


Best wishes,

Tobias.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/056c0acd-3a29-4cd1-b101-0a53719c3ee0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobias Beer

unread,
Oct 10, 2016, 12:54:40 PM10/10/16
to TiddlyWiki
Hi Jeremy,

I do not wish to define an entire language plugin.
I simple want to override individual keys,
i.e. for each language, of course.

Could it be that that's not possible, atm?

Best wishes,

Tobias.

Jeremy Ruston

unread,
Oct 10, 2016, 1:00:39 PM10/10/16
to tiddl...@googlegroups.com
Hi Tobias

I do not wish to define an entire language plugin.
I simple want to override individual keys,
i.e. for each language, of course.

Are you transcluding $:/core/ui/Buttons/home, or do you wish to change the tooltip of the button in the sidebar?

Best wishes

Jeremy




Could it be that that's not possible, atm?

Best wishes,

Tobias.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Message has been deleted

Tobias Beer

unread,
Oct 10, 2016, 2:45:34 PM10/10/16
to TiddlyWiki
Hi Jeremy,
 
Are you transcluding $:/core/ui/Buttons/home,
or do you wish to change the tooltip of the button in the sidebar?

As of now, I tried the latter but I didn't find a way
to have it adapt to a language change.

One extensible way could perhaps be,
to allow an override pattern like so:

title: $:/language/Buttons/Home/Hint/de-DE

Zurück zum Anfang vom Anfang vom Anfang

Meaning: for the name of the language plugin at the end,
override the language key before it.

Best wishes,

Tobias. 

Jeremy Ruston

unread,
Oct 10, 2016, 2:50:28 PM10/10/16
to tiddl...@googlegroups.com
Hi Tobias

I don't quite understand what you're trying to do. If you're changing the sidebar "Home" button to have a different hint text in each language, then perhaps it's best just to override the entire button?

As ever, it would help enormously to understand your objective,

Best wishes

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Tobias Beer

unread,
Oct 10, 2016, 3:58:01 PM10/10/16
to tiddl...@googlegroups.com
Hi Jeremy,
 
As ever, it would help enormously to understand your objective

I believe the title of this thread states the objective quite clearly.
What I wish to do is to override the displayed hint,
for each language that I wish to avail to a visitor.

Of course, I could create an entire custom button.
But that doesn't feel like what needs doing,
if all I wanted to do to do was to modify the hint,
or caption of a button, rather than the button internals.

Best wishes,

Tobias.

Tobias Beer

unread,
Oct 10, 2016, 4:02:55 PM10/10/16
to TiddlyWiki
Hi again,

I'm starting to think that all localisations
need to be fetched via macro.
rather than transclusion, e.g.:

$:/core/ui/Buttons/home

contains:

tooltip={{$:/language/Buttons/Home/Hint}}

Whereas it should contain:

tooltip=<<lang Buttons/Home/Hint>>

With a tbd lang macro providing the necessary
means for overrides or fall-backs.

Best wishes,

Tobias.

Jeremy Ruston

unread,
Oct 10, 2016, 4:17:18 PM10/10/16
to tiddl...@googlegroups.com
Hi Tobias

I believe the title of this thread states the objective quite clearly.

Just to be absolutely clear, the title of the thread, and your posts so far have categorically not clarified your objective, at least not to me, and since your question is presumably directed at me, you might want to take note of my feedback that it is not clear.

As I already asked, you could have been trying to use the shadow button intact, via a transclusion in some other context.

The fundamental thing that is not clear is why you want to change the tooltip of an existing page control button? It already has a tooltip that is multilingual, and has been translated into each of the languages that TiddlyWiki supports. You’ve given me no way to understand why that built-in behaviour doesn’t meet your needs in this case, other than to ask the (ambiguous) question in the post title.

Why make it hard for me to help you?

Best wishes

Jeremy.


What I wish to do is to override the displayed hint,
for each language that I wish to avail to a visitor.

Of course, I could create an entire custom button.
But that doesn't feel like what needs doing,
if all I wanted to do to do was modify was change the hint,
or caption of a button, rather than the entire button design.

Best wishes,

Tobias.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Tobias Beer

unread,
Oct 10, 2016, 5:50:09 PM10/10/16
to TiddlyWiki
Hi Jeremy,

Of course, I'm not trying to make it hard for you,
just trying to give a button a different title or tooltip,
thinking it should be possible and that it shouldn't be hard.

For example, say I had a TiddlyWiki based flavour called Foo,
and I wanted to have the button read: "Save your Foo".
That's it.

Of course, there's always overriding core components.
And, had I taken a closer look at the buttons to begin with,
I would have seen that that's possibly the thing I need to do,
and at this point the thing I will do.

Best wishes,

Tobias.

Mat

unread,
Oct 12, 2016, 4:10:10 AM10/12/16
to TiddlyWiki
@Tobias
If(!) the button, or better yet the label, is css targettable, you can possibly style the label to (1) not show and (2) add a pseudo :after element with content:"Foo".
The content property is - if(!) usable here - IMO particularly suitable because it is made to show pure text strings, which labels typically are.

<:-)

Jeremy Ruston

unread,
Oct 12, 2016, 4:17:36 AM10/12/16
to tiddl...@googlegroups.com
Hi Tobias

For example, say I had a TiddlyWiki based flavour called Foo,
and I wanted to have the button read: "Save your Foo".
That's it.

OK, that’s helpful. It’s a request that has come up before, particularly people who want to change the word “tiddler” across the user interface to something else.

One possible approach would be to rejig the translations so that certain noun words (tiddler, TiddlyWiki, wiki) are translated via a separate transclusion mechanism.

So, the translation for $:/language/Buttons/Home/Hint might be:

Open the default <<vocab tiddlers-plural>>

Seems like a lot of work, but would be a robust way of achieving what you’re after.

I guess one quick and dirty solution would be to automate the creation of variant language plugins within which you’ve used search and replace to change the vocabulary.

Best wishes

Jeremy


Of course, there's always overriding core components.
And, had I taken a closer look at the buttons to begin with,
I would have seen that that's possibly the thing I need to do,
and at this point the thing I will do.

Best wishes,

Tobias.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
Reply all
Reply to author
Forward
0 new messages