canada-ca / ore-ero

Open Resource Exchange - Échange de ressources ouvert
https://code.open.canada.ca/
MIT License
39 stars 35 forks source link

Automate translations of fields value #612

Closed fredericlestage-vdm closed 1 year ago

fredericlestage-vdm commented 5 years ago

The idea is to find a way to not oblige users to add both french and english values to a field when they fill the form. They would instead only have to fill the form in their current language (english OR french). We'd still give them the option to do both if they're familiar with both languages. However, if it could be great if we could find a solution for creating an automatic translation when it's not the case.

fredericlestage-vdm commented 5 years ago

I'm not sure about any requirements for this solution, either being open-source and/or being free?

fredericlestage-vdm commented 5 years ago

From my preliminary research, what I found wasn't really conclusive. Most open source solutions seems to be only free up to a certain amount of character translated. Even the non-open source (like google translate api) has a price per usage.

fredericlestage-vdm commented 5 years ago

@smellems @imadeDev @BassamAjam @j-rewerts Any thoughts?

fredericlestage-vdm commented 5 years ago

Some of the solutions I found:

But none of them seems to meet our requirements

smellems commented 5 years ago

I imagine we keep both fields (en-fr) but have a button to do an automatic translation to the other language.

We could use Termium if it have an API. I think that's what GCconnex is using.

https://www.btb.termiumplus.gc.ca/tpv2alpha/alpha-eng.html

wardi commented 5 years ago

Possibly related: we set up automated translation for open data metadata that was federated from the Alberta open data portal using deepl.com. Internally and via API all our language metadata is tagged with BCP-47 labels so we used its extension to indicate "translated fields" i.e. fr-t-en for French text machine translated from English vs. fr for original French text.

On the web site we indicate these translations with little icons on the titles, descriptions and keywords, e.g. https://ouvert.canada.ca/data/fr/dataset/18801116-2014-43df-84fd-408bc2382051

fredericlestage-vdm commented 5 years ago

@wardi I've look at the API and it would seem like a solution we could adopt. However, I'd like to know if there's already a setup for the API for Canada or do you only have your personal/Alberta setup?

wardi commented 5 years ago

Do you mean the deepl API? We use a few simple scripts https://github.com/open-data/ckanext-canada/tree/master/bin/harvest

fredericlestage-vdm commented 5 years ago

I guess my question is could we use it for our project to automatically translate fields after a user submit a form?