openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.16k stars 908 forks source link

One-click embedded translation of diary entries, etc. #1441

Open grischard opened 7 years ago

grischard commented 7 years ago

The diary section is full of interesting entries that I don't understand. Chrome doesn't detect the pages as written in a foreign language, and doesn't offer translation.

It would be nice to have a link to replace diary entries with their translation. The Google Translate tools can be embedded, and the diary entries are usually tagged with a language.

https://stackoverflow.com/questions/6967445/google-translate-on-my-website has examples.

tomhughes commented 7 years ago

I suspect embedding anything google related would just cause no end of grief...

grischard commented 7 years ago

There's a similar widget API from bing: https://msdn.microsoft.com/en-us/library/mt146808.aspx

SomeoneElseOSM commented 7 years ago

@grischard Does MS translator support https via that method? The web front-end still doesn't.

zerebubuth commented 7 years ago

Is it possible to do the translation dynamically, so that Google / Bing trackers aren't embedded and don't load by default, but will load when the user clicks a "translate" button? Or perhaps the auto-translate could be something opted into in the user settings?

simonpoole commented 7 years ago

@all pls no auto-translate (because that means "un-translating" for languages the user can read), translating on click to one of the preferred languages or whatever the browser is set to: yes.

tyrasd commented 7 years ago

Chrome doesn't detect the pages as written in a foreign language

Isn't the main issue here that for some reason the browser isn't able to properly detect in what language the respective diary entry is written in? Maybe this whole issue can be solved simply by exposing the diary entry's language field to the browser (for example by adding an appropriate meta HTML element)?

HolgerJeromin commented 7 years ago

@tyrasd good point! As many blog entries could be visible at once the correct way seems to have the lang HTML attribute on each diary posts (the div with the css class diary_post)

In the single diary view a <meta http-equiv="content-language" content="XX"> element could be added to the HTML head for extra clarity.

systemed commented 7 years ago

The diary section is full of interesting entries that I don't understand. Chrome doesn't detect the pages as written in a foreign language, and doesn't offer translation.

FWIW, I find Chromium detects the language of individual diary entries about half the time (as in, the top 'translate' bar appears); but even when not, you can right-click the page and select 'Translate to English' (or your language of choice).

RobJN commented 6 years ago

There is perception that you should post in English to the diary section. We should tackle this to help with spreading the word of OSM. Adding a button to translate posts (just like twitter, facebook etc) would be a good step in the right direction.

What do we need to move this forward?

P.S. Feels like a good GSOC topic if not too late.

tomhughes commented 6 years ago

Well somebody to do the work would be a good start.

Also a team of people to do PR when the shit hits the fan.

RobJN commented 6 years ago

I'll volunteer for the later. I'm afraid I cannot help with the former (other than reaching out to members who may be able to help).

kcne commented 1 week ago

I use the Translate Web Pages extension for Firefox, and similar extensions exist for other browsers. Given that implementing an embedded translation feature would likely require significant time, effort, and operational costs (such as self-hosting if we align with OSM’s values), we would need strong arguments to justify looking deeper into this.