Tiddler translate by Google button

186 views
Skip to first unread message

A Gloom

unread,
Mar 24, 2020, 8:49:00 AM3/24/20
to TiddlyWiki
A way to translate tiddler content by leveraging Google translate-- button opens Google Translate in a separate window prefilled with instructions that can be translated -- to instruct fo simply paste (control-V) which will insert the tiddler's text (which was loaded into clipboard by the translate button) so the tiddler's text can be translated quickly and easily in 3 steps-- click button, select language to translate to, read translated instruction and paste which will translate the tiddlers contents.  A macro is planned

The copy to clipboard param can also be a macro with the text to translate if you only wish to translate a portion of the tiddlers text

<$button message="tm-copy-to-clipboard" param={{!!text}} tooltip='Use Google Translate to translate tiddler and instructions'>
<$action-sendmessage $message="tm-open-external-window" $param="https://www.google.com/search?&q=translate%3A+%22paste+%28control-V%29+to+insert+instructions%22&oq=translate%3A+%22paste+%28control-V%29+to+insert+instructions%22
" windowName="_translate" windowFeatures="height=400, width=600"/>
TRANSLATE en-US > {{$:/info/browser/language}}
</$button>

Mohammad

unread,
Mar 24, 2020, 10:47:12 AM3/24/20
to TiddlyWiki
Hi A. Gloom,
 I did a little modification to your original solution and attached it to simply translate every tiddler you like.


  1. drag and drop the attached tiddler into your wiki. This tiddler is called template/translate
  2. tag any tiddler you like to get the TRANSLATE button with translate
  3. a button will appear at the bottom of tiddlers tagged with translate
  4. click the button, the Google Translate will be opened with your text in source language and its translation in the target language
  5. the current languages are set to en-US > fa-IR
  6. to change source and target languages, open the template/translate tiddler and in the first two line set the source and target languages as you like

Thank you A Gloom.

--Mohammad
template_translate.tid

Joshua Fontany

unread,
Mar 24, 2020, 5:53:56 PM3/24/20
to TiddlyWiki
Nice idea!!

A Gloom

unread,
Mar 25, 2020, 12:52:45 AM3/25/20
to TiddlyWiki
bug alert >.<!1!

the Translate button isn't working for me any longer-- not even translate: words in the search bar isn't working-- whatever sorcery I pulled off initially, the mad god Google ain't allowing now

but i has alternate mumble-jumble to use... in the action-sendmessage param --
https://translate.google.com/?text=Hello,+how+are+you%3F#view=home&op=translate&sl=en&tl=hi&text=paste%20(contril-V)%20to%20insert%20instructions
which brings up an more interesting ui instanve of Google Translate

a fix will be a lil slow-- eyes aren't cooperating-- I think i pushed them too far the last couple days-- but I'll get to a fix

@Mohammad

you're AWESOME!1! I love seeing collabrative work! Will it be incorporated into the Covid19 wiki? (that is if your template isn't effected by my malfunctioning code)

Mohammad

unread,
Mar 25, 2020, 1:15:50 AM3/25/20
to TiddlyWiki
Thank you! The idea is yours!
Yes, I use it in my WIki :-) and have documented under your name in TW-Scripts. 

A Gloom

unread,
Mar 25, 2020, 3:04:05 AM3/25/20
to TiddlyWiki

Thank you! The idea is yours!
Yes, I use it in my WIki :-) and have documented under your name in TW-Scripts. 

Thank you for the credit, I do this because this is what i used to do and even though my country may not need me any longer, my efforts may be needed elsewhere

Is the original button still working for you?

The alternate url for the translate works for me-- and its shorter-- though I'll find out for sure after clearing browser cache

<$button message="tm-copy-to-clipboard" param={{!!text}} tooltip='Use Google Translate to translate tiddler and instructions'>
<$action-sendmessage $message="tm-open-external-window" $param="https://translate.google.com/?text=paste%20(control-V)%20to%20insert%20instructions" windowName="_translate" windowFeatures="height=400, width=600"/>

TRANSLATE en-US > {{$:/info/browser/language}}
</$button>

and do you use a foriegn language edition of TW/  I'm wondering how my use of core lingo (words maked with *) are dispalying in other language wikis.

Mohammad

unread,
Mar 25, 2020, 3:20:48 AM3/25/20
to TiddlyWiki


On Wednesday, March 25, 2020 at 11:34:05 AM UTC+4:30, A Gloom wrote:

Thank you! The idea is yours!
Yes, I use it in my WIki :-) and have documented under your name in TW-Scripts. 

Thank you for the credit, I do this because this is what i used to do and even though my country may not need me any longer, my efforts may be needed elsewhere

Is the original button still working for you?

I used the revised version! No need to use ctrl+v 

The alternate url for the translate works for me-- and its shorter-- though I'll find out for sure after clearing browser cache
 

<$button message="tm-copy-to-clipboard" param={{!!text}} tooltip='Use Google Translate to translate tiddler and instructions'>
<$action-sendmessage $message="tm-open-external-window" $param="https://translate.google.com/?text=paste%20(control-V)%20to%20insert%20instructions" windowName="_translate" windowFeatures="height=400, width=600"/>
TRANSLATE en-US > {{$:/info/browser/language}}
</$button>

and do you use a foriegn language edition of TW/  I'm wondering how my use of core lingo (words maked with *) are dispalying in other language wikis.

I use the wiki in Persian! 

Birthe C

unread,
Mar 25, 2020, 3:35:48 AM3/25/20
to TiddlyWiki
Gloom, Mohammad

I tested the first Gloom button. It worked. Then I tested Mohammads version. Changing the language to danish of course. That worked very well.
Now in another of my Wikies I tried the latest Gloom button, and were offered translation into Persian. I could try to clear browser cache of course. But instead I tried first version Gloom button and that still works without that.
I want to use your great solutions in more wikies and that seems to work nicely.

Using my wiki translated into danish the button is in english but the translation windows is of course fine.


Birthe

A Gloom

unread,
Mar 25, 2020, 4:39:15 AM3/25/20
to TiddlyWiki
Birthe,

much gratitude for your testing and feedback
I tested the first Gloom button. It worked. Then I tested Mohammads version. Changing the language to danish of course. That worked very well.
Now in another of my Wikies I tried the latest Gloom button, and were offered translation into Persian. I could try to clear browser cache of course. But instead I tried first version Gloom button and that still works without that.
lol I got Hindi.  So my first version still works?  Good.  I wonder why it stopped for me...
 
I want to use your great solutions in more wikies and that seems to work nicely.

Mohammad's solution is perfect for applying translate tiddlers to an entire wiki, the original button would be good for a trandlate button for single tiddlers (like for attaching to a post here) or self-contained stand-alone tiddlers (like I usually produce).
 
Using my wiki translated into danish the button is in english but the translation windows is of course fine.

The "Translate" in the button would be English-- couldn't find a core language tiddler for translate.  Did the button show En/US > (danish)? (the part after the > should be reading your browser's language setting which I thought might be a visual clue the button was for the user's language)

The "public health agency search bookmarks" tiddler (over in the Additions to Mohammad's Covid wiki) was where I used some core lingo to translate some of the tiddler text without needing to use thr translate button-- if you want to chezk that as well-- its a single self contained tiddler that works by itself (it creates its own temp tiddlers)


Birthe

Birthe C

unread,
Mar 25, 2020, 4:47:05 AM3/25/20
to TiddlyWiki
A. Gloom,
The button show: TRANSLATE en-US>en-US
But opening the window the translation offered is en-US to danish.

Birthe

onsdag den 25. marts 2020 kl. 09.39.15 UTC+1 skrev A Gloom:
Birthe,

Birthe C

unread,
Mar 25, 2020, 4:51:32 AM3/25/20
to TiddlyWiki
Google translate is getting better, but not great for Danish, too small a population.

Birthe

A Gloom

unread,
Mar 25, 2020, 3:45:00 PM3/25/20
to TiddlyWiki

Birthe


The button show: TRANSLATE en-US>en-US
But opening the window the translation offered is en-US to danish.

your browser is set to English then, the en-us > is just text but the second part is reading the browser's language setting

cat attempting wiki coding again ><

Clipboard01.jpg


Birthe C

unread,
Mar 25, 2020, 8:16:19 PM3/25/20
to TiddlyWiki
A Gloom
My browser is not set to English. ( How would I understand that). Totally Danish. Opening the translation window it is offering translation from English to Danish.


Birthe

A Gloom

unread,
Mar 31, 2020, 5:20:23 AM3/31/20
to TiddlyWiki
Birthe

 
My browser is not set to English. ( How would I understand that). Totally Danish. Opening the translation window it is offering translation from English to Danish.

strange-- what the button reads for the second half of the button text is TRANSLATE en-US > {{$:/info/browser/language}}

$:/info/browser/language is where TW stores the language that the browser reports it is using

elsewhere in the tiddler that the translate button originally came from, I've tested the other lingo macros I used in German and Dutch edition TWs and I see translations by using existing core lingo tiddlers
Reply all
Reply to author
Forward
0 new messages