Improvements - Top bar translate script

I added the code on the top to translate to other languages, it is not perfect, but it should work. If you see any way to improve it I can make changes.

5 Likes

Thank you very much for working on this.

I notice as an English speaker, that when I visit a thread with posts in another language, I don’t see a way to translate from that language to English.

For example, is is a thread which includes some posts in French. Is the translation bar at the top meant to be able to allow me to translate the posts from French to English?

https://goingtoseed.discourse.group/t/bonjour-from-france/274/5

Oh, you are right, I put that the page is in english, so it knows of wich language translate, maybe there is an autodetect language setting.

I will tweak with the code, let’s see if something can be done.

Good job Richard! Works great. My English is second language, but after work if people in Europe or elsewhere are too tired to read or something, i think it will helpc, click put it in your own language and it’s almost like reading a newspaper!
You mean to say with improvements that you could translate the buttons as well? In discourse for google… I don’t know how you do these things, but bravo.

I’m unsure how to put this – but I beg you to reconsider the need for this top bar :smiling_face_with_tear:
Chrome can handle automatic translations.

Not everyone use a computer here… I for one do not. I only use my computer for work and I do all forum activity from phone/tablet. Until… yesterday, that is. I have no option but to leave if I can’t use it from the mobile devices anymore.

The top bar completely breaks mobile layout to the point where private messages can’t be used at all. The site has already been buggy enough for me to spend here much less time than I’d like to: I’ve been typing “blind” for months (the virtual keyboard covers the input field). I don’t see at all what I wrote, that’s why I type like I’m constantly drunk or something. I’ve learnt to live with that and in the beginning of every chat I tell people that I don’t see what I type…

But now it’s a new ballgame: since yesterday, there’s no input field at all. That translate bar on top pushes down the page in a way that there’s nowhere to type the message. Both on iPhone and iPad.

I’m ripping IKEA bags of hair out!

Alternatively, someone give me access to the site and I fix it so that it will auto-hide. I work with code. I don’t wrok with frontend but I will find a way to fix it.

Oh no, I did not checked with iphone. Tonight I will try to fix it. Yo can add extensions on iphone, like tampermonkey? You can display none the top bar with it in the meantime. What other parts do not work for you? The chat? Maybe we need to modify the template or update it.

This issue with the hidden input field occurs for me when replying to threads with Firefox browser on a Google Pixel phone. I have learned to live with it like Cathy, but since it’s come up come up I want to report that it is not just iPhone.

For what it’s worth on my device the new translation bar does not seem to be interfering though, not like Cathy in that regard.

Can you check it now? I Fixed the default language and should work now. I tested with my phone too. Most likely you will have to do a refresh on the page, in the worst case, a couple of time.

Translation to English is working for me, very cool.

Let me try to report how it is working at this point. There are two translation bars across the top of the page, the topmost is light colored, and stays visible at all times as you scroll down the page. When you change the selected language in either of the bars, it also changes in the other one.

When I visit the thread that I linked earlier that has mixed English and French, and then I click “Translate” on the top bar, the French posts are translated. It seems to be working perfectly.

The second bar is darker colored in my screenshot, and as I scroll downward, it disappears.

Previously, English was not an option in this darker colored translation bar when it was the only one. Now I can select English is on the list.

1 Like

I have reproduced your error. Sometimes it is very tricky all those scrolls. But refreshing the page or clicking some menus seems to do the trick and it fixes it for me.

When entering the page “that the chatbox is gone” just refresh the page. Sometimes the browser do not want to refresh the page. So in that cases I copy the url, I close the current tab, close the browser, I enter the browser again, and then paste the copied url.

Another big option is to delete “the cookies and other site data” and “the cached images and files” from your browser, and make a logout of your account. Some things can remain and cause interference.

Can you try with the phone or desktop version? Go back and forth a couple of times.
image

image

Can you try with the expland or contract the full screen chat? Go back and forth a couple of times.

image

image

Sometimes this zone is tricky with the scroll. It stops being clickable. For me the refreshing the page makes the trick. I can scroll again and see the chat box.

Which version of ipad/iphone and browser you have and use? I tested with my ipad with chrome and is fine.
I also tried like 20 different apple emulators and I did not encounter that blocking error.
I made another account and I am sending messages to myself :sweat_smile:.

Can you try with the previous tricks? I tried with multiple pixel versions and I did not encounter the error. Can you share the pixel version and google version if the tricks do not work.

I hadn’t seen your list of tricks to try before my last message. Good news. Toggling desktop mode when replying to a thread sets the various user interface boxes to good sizes on my end. I wish I had taken more time to figure this out sooner, thank you! I’m optimistic that solves my problem. No more copy pasting messages when I’m writing on my phone :grin:

2 Likes

toggling desktop mode helped you? What is that then? And where do i find those buttons Richard is pointing arrows at?

At the bottom of the menu

Here:

Not for me

Interesting.

Can you change the toolbar on the top?

Settings → configure → toolbar → top

And also

Settings → configure → gestures → scroll to hide toolbar

Where is the “settings” thing please Richard?