barreeeiroo
(Diego Barreiro)
2 בינואר, 2020, 3:06am
1
Hi,
At the moment, only Microsoft and Google services are supported on the plugin, which both are paid services. However, Yandex provides a free translation API, which could be really useful used in Discourse forums.
I started modifying the plugin to add its support, but I am stuck here:
https://github.com/barreeeiroo/discourse-translator/commit/3ef433473a7314b580a63fc8c8794e219899ddc4
Any idea of what am I missing? The translation button does not appear in posts.
Tested a post in Spanish, with both Discourse and Profile locale in English
6 לייקים
sam
(Sam Saffron)
2 בינואר, 2020, 4:24am
2
naive guess, but maybe you did not enable the plugin in side settings? maybe there is a hardcoded check for either google or ms keys?
2 לייקים
barreeeiroo
(Diego Barreiro)
2 בינואר, 2020, 12:49pm
4
Yeah, I did
And also inputted my Yandex API Key
I searched for Microsoft and Google references in the plugin, and I think I’ve already modified all of them
BTW, is there a way to print to the console from a plugin?
I would like to check which piece of code gets executed
לייק 1
david
(David Taylor)
2 בינואר, 2020, 12:59pm
5
In development, you can use puts
to print to your console
If you want to print something to /logs
, then
Rails.logger.warn("Message to log")
5 לייקים
barreeeiroo
(Diego Barreiro)
2 בינואר, 2020, 4:04pm
6
Well, after so much trial and error…
I got it working!
Will submit a PR after polishing the last details
https://github.com/discourse/discourse-translator/pull/27
8 לייקים
ashledombos
(Raphaël Jadot)
27 בינואר, 2020, 7:12am
7
Hello,
Thanks for this contribution
Just a question, it’s marked as merged, but the doc does not mention it, what is the current status of Yandex translator in the T++ plugin?
לייק 1
Just to round this out, I believe Yandex is currently one of the supported services:
Translation Services Supported