[1.0.4] mChat Google Translate

Allows translating mChat messages.
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

[1.0.4] mChat Google Translate

Post by kasimi »

mChat Google Translate

Image Image



This extension adds a button next to each mChat message that allows to translate it to English using Google Translate.

There is no configuration. Once enabled, the Translate button will appear for all users.

Requirements
  • PHP at least 5.4.7
  • phpBB at least 3.2.0
  • mChat at least 2.0.1

Download

https://github.com/kasimi/phpbb-ext-mch ... slate/tags

How to install, update and uninstall extensions: https://www.phpbb.com/extensions/installing/
Install path: ext/kasimi/mchatgoogletranslate/
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [1.0.1] mChat Google Translate

Post by kasimi »

Version 1.0.1 is available. It adds support for various other mChat add-on extensions such as Infinite Scroll.
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [1.0.2] mChat Google Translate

Post by kasimi »

Quick update to version 1.0.2 which fixes compatibility with earlier mChat versions.
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [1.0.3] mChat Google Translate

Post by kasimi »

Another update to version 1.0.3. It removes an unnecessary delay when adding the [Translate] link, and more importantly it translates the messages to the individual user's board language, as configured in the UCP.
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [1.0.4] mChat Google Translate

Post by kasimi »

Version 1.0.4 correctly translates edited messages.
dimassamid
Posts: 18
Joined: 11 Jan 2019, 04:19

Re: [1.0.4] mChat Google Translate

Post by dimassamid »

Thank you for this small, but very useful extension! :+1:
miri4ever
Posts: 57
Joined: 16 Aug 2020, 00:33
Location: Germany

Re: [1.0.4] mChat Google Translate

Post by miri4ever »

On Firefox it works well, but on Chrome I got a white page if I press translate button.
User avatar
kasimi
mChat developer
Posts: 1173
Joined: 06 Oct 2016, 09:56
Location: Germany

Re: [1.0.4] mChat Google Translate

Post by kasimi »

What style are you using? Did you try prosilver? Can you check the browser console for errors?
dimassamid
Posts: 18
Joined: 11 Jan 2019, 04:19

Re: [1.0.4] mChat Google Translate

Post by dimassamid »

miri4ever wrote: 04 Oct 2020, 19:50 On Firefox it works well, but on Chrome I got a white page if I press translate button.
The same problem :|
Here is a demo: http://dimassp1.beget.tech/mchat
But it worked before, I don't understand what happened :? The new Chrome version? Or the Google blocked the translation function in Chromium browsers?

The Translate link contains href="about:invalid#zClosurez", as a result of which a new empty window opens.

Chrome 86.0.4240.75 - not working
Edge 86.0.622.38 - not working
Vivaldi 3.3.2022.45 - not working

SeaMonkey 2.49.5 - working
Firefox 81.0.1 - working
dimassamid
Posts: 18
Joined: 11 Jan 2019, 04:19

Re: [1.0.4] mChat Google Translate

Post by dimassamid »

I have found the trick
https://stackoverflow.com/questions/641 ... -in-chrome

OPEN:
ext/kasimi/mchatgoogletranslate/styles/prosilver/template/event/overall_footer_body_after.html

FIND:

Code: Select all

{% endif %}
ADD BEFORE:

Code: Select all

	<!-- Translate button fix -->
	<script>
		$(document).ready(function(){
		setInterval( function() {
			$(".goog-te-gadget-link").click(function(){
				$(this).attr('href', 'javascript:;');
			});
		}, 1000);
	});
	</script>
	<!-- Translate button fix -->

This works, but I hope Kasimi offers a better solution :)

Who is online

Users browsing this forum: CCBot [Bot] and 0 guests