Closed Bug 1117863 Opened 5 years ago Closed 5 years ago

Hello stand-alone app fall backs to English instead of using other languages in accept languages

Categories

(Hello (Loop) :: Client, defect, P2)

defect
Points:
2

Tracking

(Not tracked)

RESOLVED FIXED
mozilla37
Iteration:
37.3 - 12 Jan
Blocking Flags:
backlog Fx35+

People

(Reporter: flod, Assigned: standard8)

References

Details

Attachments

(1 file)

1) Create a new conversation in Hello, copy and open the link.

2) In about:config set intl.accept_languages to 'it-IT, it, en-US, en' (default header for Italian). Open the link again, it will be in English

3) Not put 'it' in intl.accept_languages as first locale, it will display the page in Italian.
We won't block the release for this, but we want to fix it asap. We believe this affects the standalone code only (no uplift required).
backlog: --- → Fx35+
Priority: -- → P2
Assignee: nobody → standard8
(In reply to Maire Reavy [:mreavy] (Plz needinfo me) from comment #1)
> We won't block the release for this, but we want to fix it asap. We believe
> this affects the standalone code only (no uplift required).

Does the code live outside of mozilla-central? Just wondering if this needs to wait 6 weeks for a fix.

Clearly your call about priority, but I have no idea how many other locales are affected. Italian alone is not exactly small, if I'm right all Spanish variants are affected too.
http://transvision.mozfr.org/string/?entity=toolkit/chrome/global/intl.properties:intl.accept_languages&repo=release
This code resides in the standalone app, which is a web app released approximately every 2 weeks (separate from the browser) -- though we can "hotfix" it quickly if we need to.  It resides on the Loop/Hello server.  My hope is that Mark (standard8) can find the root cause problem today, and we can deploy a fix tomorrow or Wednesday.  

The standalone app is completely separate from the browser and the browser release schedule, and Hello itself (as a feature) is in "Beta".  I think as long as we can fix this issue pretty quickly, we'll be fine.
Depends on: 1118444
The navigator.languages array is passed into the negotiate function - currently it only checks the first item in the array to see if it is a supported locale, this makes it check all items.
Attachment #8544811 - Flags: review?(mdeboer)
I forgot to say, in bug 1118444 I'm looking to get this backported to gaia so that we can keep consistent versions.
Comment on attachment 8544811 [details] [diff] [review]
Correct Loop's language fallback to use all of accept languages properly.

Review of attachment 8544811 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/components/loop/standalone/content/libs/l10n-gaia-02ca67948fe8.js
@@ +1241,5 @@
>      // Getting ready
>  
>      function negotiate(available, requested, defaultLocale) {
> +      var supportedLocale;
> +      for (var i = 0; i < requested.length; ++i) {

nit: I usually cache the `length` property like this: `for (var i = 0, l = requested.length; i < l; ++i) {`. Your choice.

@@ +1249,5 @@
> +          break;
> +        }
> +      }
> +      if (!supportedLocale ||
> +          supportedLocale === defaultLocale) {

nit: you can use `==` here and I think this can fit on one line.

@@ +1254,2 @@
>          return [defaultLocale];
>        } else {

we don't need the `} else {` here.
Attachment #8544811 - Flags: review?(mdeboer) → review+
(In reply to Mike de Boer [:mikedeboer] from comment #6)
> @@ +1249,5 @@
> > +          break;
> > +        }
> > +      }
> > +      if (!supportedLocale ||
> > +          supportedLocale === defaultLocale) {
> 
> nit: you can use `==` here and I think this can fit on one line.

Using strict equality is standard practice in gaia, and Loop content files, so I'll keep it.
https://hg.mozilla.org/integration/fx-team/rev/88c4d076e3db
Iteration: --- → 37.3 - 12 Jan
Points: --- → 2
Target Milestone: --- → mozilla37
(In reply to Mark Banner (:standard8) from comment #7)
> Using strict equality is standard practice in gaia, and Loop content files,
> so I'll keep it.

How naive! Never worth starting an argument over, though.
https://hg.mozilla.org/mozilla-central/rev/88c4d076e3db
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.