In the current version the list of languages is not translated. They probably should be.

There are 3 issues to tackle here:
1. Language names must be translated (Spanish should be español, etc.). People don;t recognize their own language expressed in English.
2. "Translate to" should be in the browser language.
3. The default language offered in the language pulldown should be the browser language.

Proposed implementation:

1. Just get a static list of language name translations, keyed by langcode into the js. (These can be obtained via the translate service I imagine; there might be other ways.)
2. Get a static list of "Translate to:" in there also. Same exact implementations. Might be in the same array.
3. Use those lists for presentation based on the current browser language.
4. Make sure that each select is presented in the current browser language (defaulting with the key from the current browser language).

Comments

rfay’s picture

Issue summary: View changes

Updated description and proposed fix

chrisarusso’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev

Committed to 6.x-1.x

Commits of 2fa731b81ec..629b45c9f4 include:

  1. A new js file with a static object of all the languages and their native translations of all other languages and the English string "Translate to"
  2. The derivative file that was used to create the static language object, with notes
  3. Addition of new static object js file in the .module file via drupal_add_js
  4. Changes to translatableregions.js to incorporate proper languages and proper "Translate to" string on page load based on browser language.

This pretty much achieves the three desired scenarios above, however, it needs another set of eyes. The submit "Translate to" button may have regressed when toggling different languages. It shows weird things every so often, but I'm not sure that this wasn't the case before. Another concern is the large size of the static js file ~56K.

rfay’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Active » Patch (to be ported)

Thanks for the great work on this.

I found that the jquery.translate already had excellent support for native language names; I think it was probably something I did (or he did) along the way that got it lost. Anyway, brought that back in.

I used your excellent array creator to create an array of TranslateTo and just included it as a one-liner in the js.

Committed: http://drupalcode.org/project/translatableregions.git/commitdiff/dcad6510

rfay’s picture

Status: Patch (to be ported) » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.