Ticket #42 (closed enhancement: fixed)

Opened 3 years ago

Last modified 2 years ago

Serve the translated page transparently

Reported by: mail@… Owned by: ofer
Priority: major Milestone: 0.5 - Beta wordpress plugin
Component: WordPress Plugin Version: 0.3.6
Keywords: Cc: datapharmer

Description

I got this idea from the  xlanguage plugin which basically sees what language a person's browser is set to and serves that, if available.

I think implementing something like this for transposh would go a long way in usability by providing the audience with their prefered language, without them having to discover the widget.

This should also be set with a cookie as well (when someone uses the widget), so then next time someone visits, their preferences are remembered.

So this could work in 2 ways. One is to leave things as they are but include an option the plugin for a smart redirect. If checked, once a call to a webpage is made, the plugin will request the browser language, if not available (or the default), it will do nothing and simply serve the default content. But if the language is available and well translated (We don't want people redirected to a simple google-translation) then they would be redirected to the appropriate language version.

The other option would be to avoid redirects altogether and do it in a similar way that xlanguage does it. I don't know how much this way is possible since the translations are not in the content and it might also play merry hell with caching plugins.

Change History

comment:1 Changed 3 years ago by anonymous

  • Component changed from Parser to WordPress Plugin

comment:2 Changed 3 years ago by ofer

  • Status changed from new to accepted

Thanks for the idea, accepted.

comment:3 Changed 2 years ago by ofer

  • Cc datapharmer added
  • Version changed from 0.2.2 to 0.3.6

Starting work on this soon after coming version, split into two parts

  1. remember selected language for site
  2. auto-negotiate language

the well translated stuff is still in the future

any ideas are welcomed

comment:4 Changed 2 years ago by ofer

Here are our options for cookies...

  1. change the widget urls to contain a setcookie param (ugly) might be troublesome to get back
  2. add a user site confirmation dialog on such click (do you want to set as default?)
  3. add a "set as default language" link which appears when looking at a non default language (favorite)

other ideas?

comment:5 Changed 2 years ago by datapharmer

I like the idea of the third option. This allows us to detect a default language based on browser preference instead of site default but allows the user to override this and remember it. The one thing to consider is that the "set as default language" link needs to appear even in the default language IF the browser language is not the default.

For example, if the site default is english but the user's browser is set to spanish, the site should initially display in spanish, but if the user prefers english they need to be able to set a cookie so that english appears on subsequent visits via the "set as default language" link.

comment:6 Changed 2 years ago by ofer

  • Status changed from accepted to closed
  • Resolution set to fixed

Fixed in commit [313] language detection is now configurable and will redirect first visit

Note: See TracTickets for help on using tickets.