(CTW) Alternative SiteSubtitle (multi-language)

55 views
Skip to first unread message

Joe Shirk

unread,
Feb 24, 2014, 9:27:58 AM2/24/14
to tiddl...@googlegroups.com
I made a nifty resume on my tiddlyspace, in Portuguese but with the intention to later add a version in English. I put the main index in the SiteSubtitle to easily navigate from the [[resume]], to [[work history]], to [[contact]] (all in Portuguese, linking to tiddlers in Portuguese). I put it there because it's always there at the top, no matter what tiddler is displayed. It seemed a good idea at the time...

Now that I want to add the English version, I thought it would be best to put an [[EN]] link in the SiteSubtitle that swaps the SiteSubtitle for one with links in English to tiddlers in English (that includes a link to switch it back to Portuguese). I don't know how to do that.

To make matters complicated, the current default is the Portuguese but now I would rather make the English version the default. What needs to be done to accomplish this? I was going to try to avoid linking to a new site and maintaining them separately because the tags in each would be isolated and duplicated (I tagged all tiddlers with [[Portuguese]] with the intention of tagging the English versions as such.

If the only way is really convoluted, maybe I need to re-think my strategy and start over again. At least that way I have an excuse to start fresh with TW5.

Thank you

Eric Shulman

unread,
Feb 24, 2014, 9:03:37 PM2/24/14
to tiddl...@googlegroups.com
On Monday, February 24, 2014 6:27:58 AM UTC-8, Joe Shirk wrote:
Now that I want to add the English version, I thought it would be best to put an [[EN]] link in the SiteSubtitle that swaps the SiteSubtitle for one with links in English to tiddlers in English (that includes a link to switch it back to Portuguese). I don't know how to do that.

To make matters complicated, the current default is the Portuguese but now I would rather make the English version the default. What needs to be done to accomplish this?

Here's a quick way to achieve the results you want:

1) Create a tiddler called [[SetSiteSubtitle]] with the following HTML content:
------------------------------
<html><input type="button" value="$1" title="$2" style="cursor:pointer" onclick="
   store.setValue('SiteSubtitle','text','<<tiddler SiteSubtitle$1>>');
"></html>
------------------------------

2) Create [[SiteSubtitleEN]] containing:
------------------------------
This is in English <<tiddler SetSiteSubtitle with: "PT" "Change to Portuguese">>
------------------------------

3) Create [[SiteSubtitlePT]] containing:
------------------------------
Isto é em Português <<tiddler SetSiteSubtitle with: "EN" "Mudar para Inglês">>
------------------------------

4) Set the content of [[SiteSubtitle]] to transclude the desired default, like this:
   <<tiddler SiteSubtitleEN>>

That's it.  You should now be able to toggle between the two alternative SiteSubtitleEN and SiteSubtitlePT definitions with a single click!

enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios

YOUR DONATIONS ARE VERY IMPORTANT!
HELP ME TO HELP YOU - MAKE A CONTRIBUTION TO MY "TIP JAR"...

Professional TiddlyWiki Consulting Services...
Analysis, Design, and Custom Solutions:

Joe Shirk

unread,
Feb 24, 2014, 10:19:08 PM2/24/14
to tiddl...@googlegroups.com
This is great! Thank you so much!

Two notes:

While executing your directions, I discovered that my site anatomy was wrong, the thing I really need to change is the MainMenu - so I just did everything you said exchanging SiteSubtitle for MainMenu (I discovered that the siteSubtitle is obscured by the mainMenu - this is probably because I must have moved it to the top if it was by default to the left side - I don't really remember from a year ago.)

In SetMainMenu, the parameters names for the button had to be swapped: title="$1" value="$2"
because they came out swapped on rendering the button (and setting the tiddler suffix. Not exactly sure why (at this late hour) but the bottom line:

This works beautifully!


--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/ZUF4csFHri4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/groups/opt_out.



--
--------------------------------------------
If you are a human being and not a robot, please note that I am vacating gmail gradually and permanently. If you don't know why, please see: EFF Surveillance Self-Defense Project

Please note my new preferred secure email address: infomaniac(at)i2pmail(dot)org
For more information, please see: About I2P

If you prefer to send to this gmail account, I strongly encourage  using OpenPGP plugin for Thunderbird. My Public key is: 

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

mQENBE0JK8gBCAC9k+1SReyXF2fw3IDddKKfGH7ELUhewwTN58VmLTxHuYgxU/Af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yKKfgCG+II4KBkgh9X29E25iLnc6/nnh
FCSqaETiwZWVUNrD0nvPWFlna9GRHJElYFoB0JICmEqC1wQ=
=Sgmo
-----END PGP PUBLIC KEY BLOCK-----


Joe Shirk

unread,
Feb 25, 2014, 5:07:04 AM2/25/14
to tiddl...@googlegroups.com
After having slept peacefully with this solution, I realized this morning that there is still something that I did not think about.

After re-writing the MainMenu transclusion, what should happen next is to open the corresponding DefaultTiddler (English or Portuguese version). I could easily use the same technique but I doubt that DefaultTiddler will run again and open the right tiddler, as it is defined as the setting that opens the default tiddler when the app is first loaded, so I am thinking that isn't the way to go. There must be a macro that calls the right tiddler after the menu reloads, but I have not been able to find it in the Help.


On Tuesday, February 25, 2014 12:19:08 AM UTC-3, Joe Shirk wrote:
This is great! Thank you so much!

This works beautifully!
Reply all
Reply to author
Forward
0 new messages