Development of 'trans_tray' (translation program)

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
stemsee

#91 Post by stemsee »

Hi Fred

Great job with the layouts and preferences!

When simple keyboard layout selector is open, it is good that another cannot be opened, but when variant layouts opens, you CAN open more (proliferates).

Where is strans?? I thought you would use it in place of main trans window!

Also selecting target language, gui could it be also select to change/stay open?

It's a very comprehensive and well implemented application now.

stemsee

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#92 Post by fredx181 »

Here's another variant of v5
Only difference is that the keyboard layout list from 'Set keyboard layout' is one large list (variants included) and that every last layout used will be added as the first next time opening the layout GUI, so all recently used will appear on top then.

Fred
Attachments
trans_tray5b.gz
fake .gz
(77.47 KiB) Downloaded 122 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#93 Post by fredx181 »

stemsee wrote:Where is strans?? I thought you would use it in place of main trans window!
It's when opening "Type or paste text to be translated"

EDIT:
When simple keyboard layout selector is open, it is good that another cannot be opened, but when variant layouts opens, you CAN open more (proliferates).
yes, that's a mistake, can be easily fixed, will do later

Will reply more later , have to run now.

Fred

stemsee

#94 Post by stemsee »

Hi Fred

Also: 'currently $KBLAYOUT' should appear in menu as with select language. or use country flags as the menu icon for keyboard selection option!!!

Code: Select all

clear_all (){
bash -c clearA
bash -c ClearB
}
is sufficient.... :lol:
stemsee

edit: it would be nice if the tooltip showed two more lines; one for translate to language/s and one for keyboard layout.

EDIT2: the variant of version 5 requires that after selecting a language the gui must be closed then that layout appears at the top of the list. Doing this multiple times arranges the layouts in your list.

EDIT3: essential preference to add is font selection. because i have superimposed characters with pt layout.
Attachments
2019-09-14-124530_1280x800_scrot.png
(44.02 KiB) Downloaded 564 times
2019-09-14-124247_802x634_scrot.png
accumulative translations, individual clearing
(66.71 KiB) Downloaded 130 times

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#95 Post by fredx181 »

Hi All, new trans_tray v6, changes:
- Fixed bug that the keyboard layout GUI proliferated (only single instance now)
- Double click an item will restart the keyboard layout GUI with selected on top and added reset button (to get back to original list without recently used on top)
- Added font selection for text-info dialogs to Preferences
- Added option "Run at Start up" to menu (start trans_tray at X start)
- Icon tooltip also shows Target languages and Keyboard layout selection now
- Added some more info to the Help

Probably this will be the last version from me (unless there are bugs to be fixed), main reason is that IMO the program is very nice and comprehensive now, and the script is already very big and complicated, so don't want to over-complicate it even more.

@stemsee, many thanks again for your suggestions ! (but we can't go on meeting like this ! :lol: )

EDIT: Bug: once started from /root/Startup symlink after restarting X or reboot, toggle "Run at Start up" didn't work well.
Fixed, re-attached trans_tray6

Fred
Attachments
trans_tray6.gz
See EDIT above, fixed trans_tray6, fake .gz
(85.74 KiB) Downloaded 169 times
2019-09-14-201553_937x462_scrot_787x388.jpg
(68.19 KiB) Downloaded 556 times
Last edited by fredx181 on Sat 14 Sep 2019, 21:37, edited 1 time in total.

stemsee

#96 Post by stemsee »

fredx181 wrote: Probably this will be the last version from me (unless there are bugs to be fixed), main reason is that IMO the program is very nice and comprehensive now, and the script is already very big and complicated, so don't want to over-complicate it even more.
It's already surpassed expectations.
@stemsee, many thanks again for your suggestions ! (but we can't go on meeting like this ! :lol: )

Fred
Agreed! The trans affair is over :lol:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#97 Post by fredx181 »

Found a small bug :? , fixed, see EDIT and new attachment here:
http://murga-linux.com/puppy/viewtopic. ... 14#1037014

Fred

stemsee

#98 Post by stemsee »

Hi all

I have customised my version a little.

The dialogue mode has a button to activate a virtual keyboard....xvkbd (touchscreen use).

I have the print option working on the floating menu.

I am exploring yad options --enable-spell and --spell-lang for text fields.
Attachments
2019-09-14-223810_200x120_scrot.png
(5.23 KiB) Downloaded 488 times
2019-09-14-223835_802x634_scrot.png
(54.42 KiB) Downloaded 195 times
2019-09-14-223843_702x634_scrot.png
(53.48 KiB) Downloaded 488 times

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#99 Post by step »

Thank you very much, fredx181 and stemsee! I don't understand how to set the two source languages for dialog mode. I mean, if I'm talking to someone in Portuguese, I would want to set side A en -> pt and side B pt -> en, right? How would I do that - having two different source languages at once? Or did I misunderstand the purpose of dialogue mode?
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

stemsee

#100 Post by stemsee »

Hi step

you can copy and paste into either input in any language, because google/bing/yandex autodetects input language. That's why only target languages are set.

There is the keyboard layout selection gui if you want to type in another language, you may have to install additional fonts and input methods.

stemsee

stemsee

#101 Post by stemsee »

technosaurus wrote:Where is the microphone icon for input / text?
Pocket Sphinx
and the speaker icon for translation?
Espeak or Flite

I had a thread with pocket sphinx continuous and associated bash helpers, but the binary itself got lost when the forum lowered the limit on file size.
Fred's experiments with sound seemed to prove the facility is too limited.

Have you any code to test/implement?

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#102 Post by technosaurus »

stemsee wrote:
technosaurus wrote:Where is the microphone icon for input / text?
Pocket Sphinx
and the speaker icon for translation?
Espeak or Flite

I had a thread with pocket sphinx continuous and associated bash helpers, but the binary itself got lost when the forum lowered the limit on file size.
Fred's experiments with sound seemed to prove the facility is too limited.

Have you any code to test/implement?
I'm too exhausted to put together functional code, but here are the links to the building blocks of it:
http://www.murga-linux.com/puppy/viewto ... 912#729912
http://www.murga-linux.com/puppy/viewto ... 247#731247
http://murga-linux.com/puppy/viewtopic. ... 998#583998
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#103 Post by fredx181 »

Hi All, posted in Additional Software (PETs, n' stuff) » Utilities a .pet package based on above v6 (small addition is "first run" message).
http://murga-linux.com/puppy/viewtopic. ... 73#1037573

If there's any more development going on here, I'll update the pet accordingly.

Fred

step
Posts: 1349
Joined: Fri 04 May 2012, 11:20

#104 Post by step »

Hi,
I started trans_tray from a terminal, right-clicked the icon and selected "Type or paste text to be translated". The terminal printed this error message:

Code: Select all

yad: wrong boolean value ''
I suppose it's nothing to worry about, but I wanted you to know.

Output from bash -vx trans_tray to give you some context for the error message.

Code: Select all

+ POPUP_TEXT='Left-click for Trans-Paste\nRight-click for Menu'
echo tooltip:"$POPUP_TEXT \nTarget language(s): $TGTLANG \nKeyboard layout: $KBL" 2> /dev/null >&3
+ echo 'tooltip:Left-click for Trans-Paste\nRight-click for Menu \nTarget language(s): English \nKeyboard layout: us,it'

yad --notification --kill-parent --listen \
--image="$ICON" \
--no-middle \
--text-align=center --icon-size=22 \
--command="bash -c trans_paste" <&3
+ yad --notification --kill-parent --listen --image=/root/.trans_tray/icons/google.svg --no-middle --text-align=center --icon-size=22 '--command=bash -c trans_paste'
yad: wrong boolean value ''
[url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Fatdog64-810[/url]|[url=http://goo.gl/hqZtiB]+Packages[/url]|[url=http://goo.gl/6dbEzT]Kodi[/url]|[url=http://goo.gl/JQC4Vz]gtkmenuplus[/url]

Post Reply