Loomio
Tue 10 Aug 2021 6:16AM

Support for using loomio for multilingual groups

PM Pete Masters Public Seen by 89

Hi, I work for the Humanitarian OpenStreetMap Team and we host an instance of Loomio, which we use for many things! One of the uses is a community working group forum.

It's great that the static content in Loomio is available in multiple languages (and kudos to the translators here!), but I wondered two things about support for further localisation...

Firstly, whether it's possible to support multiple languages in the dynamic content? So, for example, when someone comes to our landing page - https://loomio.hotosm.org/community-working-group/ - and their preferences are set to French, they can see the Description text in French (assuming it's available).

I also wondered whether anything had been done to integrate translation functionality into dynamic content, so discussions could more easily traverse language barriers?

Thanks in advance for your help. I couldn't find the answers to the above online anywhere - I hope this is the appropriate place to ask....

RG

Robert Guthrie Tue 10 Aug 2021 6:47AM

Hi, @Pete Masters, so pleased to hear you have a humming Loomio instance!

We have support for inline translation of user content via Google Translate, when the config is provided.

How it works: We use a library called cld to detect and save the the language of comments etc as they are saved. When a user views the content, if it is in a different language to their own (which is detected from the browser or selected from the profile page), we show a translate button, and the content is replaced with a google translation.

Configuring the google translate cloud server and API keys is the challenging bit and it will be great to get some documentation about them pulled together. This seems like a good starting place for that. I'll see what I can pull together for you.

RG

Robert Guthrie Tue 10 Aug 2021 7:05AM

Ok @Pete Masters - We use the google-cloud-translate gem, and to make it work you need to configure a google cloud account.

https://github.com/googleapis/google-cloud-ruby is the starting point to learn how to configure a google cloud account and generate a translation credentials json file.

The finished state is a simply a TRANSLATE_CREDENTIALS environment variable configured on your server, with the content of that json file as a string. Once this is present the translation features will show up when they can be used.

The json file looks like what you can see on this page: https://cloud.google.com/iam/docs/creating-managing-service-account-keys

I hope that's enough to help you on your way, please let me know how you get on.

PM

Pete Masters Tue 10 Aug 2021 7:52AM

Hi @Rob Guthrie thanks a million (and for the speedy response)! I will flag it with my colleague who manages the instance (and who has the technical chops for this kind of instruction 😉)

Will get back to you on how we get on...!

PM

Pete Masters Fri 8 Oct 2021 6:20AM

Just wanted to feed back that we have managed the configuration and now have inline translation for our community working group! Thanks for the pointers - really appreciate them... Now'let's see how we leverage this for better global collaboration, support and learning!

RG

Robert Guthrie Mon 11 Oct 2021 11:41AM

Great news! So pleased Loomio is useful for you.