Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-07-30 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
---+--
 Reporter:  igt0   |  Owner:  tbb-team
 Type:  defect | Status:  closed
 Priority:  Medium |  Milestone:
Component:  Applications/Tor Browser   |Version:
 Severity:  Normal | Resolution:  fixed
 Keywords:  tbb-mobile, TorBrowserTeam201807R  |  Actual Points:
Parent ID:  #25703 | Points:
 Reviewer: |Sponsor:
---+--
Changes (by gk):

 * status:  needs_review => closed
 * resolution:   => fixed


Comment:

 Fixed with commit d352f450f3edd120df9b7ab973db45069ef22bb2 on `tor-
 browser-60.1.0esr-8.0-1`.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-07-27 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
---+---
 Reporter:  igt0   |  Owner:  tbb-team
 Type:  defect | Status:
   |  needs_review
 Priority:  Medium |  Milestone:
Component:  Applications/Tor Browser   |Version:
 Severity:  Normal | Resolution:
 Keywords:  tbb-mobile, TorBrowserTeam201807R  |  Actual Points:
Parent ID:  #25703 | Points:
 Reviewer: |Sponsor:
---+---

Comment (by igt0):

 LGTM

 Replying to [comment:6 gk]:
 > `bug_26018` (https://gitweb.torproject.org/user/gk/tor-
 browser.git/commit/?h=bug_26018=eb9f502a3a5f1d2f8780f516aaa9a2290d62276e)
 has the backport in question. It applied cleanly, please have a look.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-07-27 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
---+---
 Reporter:  igt0   |  Owner:  tbb-team
 Type:  defect | Status:
   |  needs_review
 Priority:  Medium |  Milestone:
Component:  Applications/Tor Browser   |Version:
 Severity:  Normal | Resolution:
 Keywords:  tbb-mobile, TorBrowserTeam201807R  |  Actual Points:
Parent ID:  #25703 | Points:
 Reviewer: |Sponsor:
---+---
Changes (by gk):

 * status:  new => needs_review
 * keywords:  tbb-mobile => tbb-mobile, TorBrowserTeam201807R


Comment:

 `bug_26018` (https://gitweb.torproject.org/user/gk/tor-
 browser.git/commit/?h=bug_26018=eb9f502a3a5f1d2f8780f516aaa9a2290d62276e)
 has the backport in question. It applied cleanly, please have a look.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-06-04 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
--+--
 Reporter:  igt0  |  Owner:  tbb-team
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:
Component:  Applications/Tor Browser  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tbb-mobile|  Actual Points:
Parent ID:  #25703| Points:
 Reviewer:|Sponsor:
--+--

Comment (by igt0):

 It was merged https://hg.mozilla.org/mozilla-central/rev/a25b2c7238f4

 However It will not be available in the FF61, so we will need to cherry
 pick it.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-05-03 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
--+--
 Reporter:  igt0  |  Owner:  tbb-team
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:
Component:  Applications/Tor Browser  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tbb-mobile|  Actual Points:
Parent ID:  #25703| Points:
 Reviewer:|Sponsor:
--+--

Comment (by igt0):

 Mozilla bug used to track this bug:
 https://bugzilla.mozilla.org/show_bug.cgi?id=1459089

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-05-03 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
--+--
 Reporter:  igt0  |  Owner:  tbb-team
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:
Component:  Applications/Tor Browser  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tbb-mobile|  Actual Points:
Parent ID:  #25703| Points:
 Reviewer:|Sponsor:
--+--

Comment (by igt0):

 It leaks even when the user doesn't change the OS locale.

--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-05-03 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
--+--
 Reporter:  igt0  |  Owner:  tbb-team
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:
Component:  Applications/Tor Browser  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tbb-mobile|  Actual Points:
Parent ID:  #25703| Points:
 Reviewer:|Sponsor:
--+--
Changes (by igt0):

 * parent:   => #25703


--
Ticket URL: 
Tor Bug Tracker & Wiki 
The Tor Project: anonymity online
___
tor-bugs mailing list
tor-bugs@lists.torproject.org
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs

Re: [tor-bugs] #26018 [Applications/Tor Browser]: intl.accept_languages changes when the user changes their OS language

2018-05-03 Thread Tor Bug Tracker & Wiki
#26018: intl.accept_languages changes when the user changes their OS language
--+--
 Reporter:  igt0  |  Owner:  tbb-team
 Type:  defect| Status:  new
 Priority:  Medium|  Milestone:
Component:  Applications/Tor Browser  |Version:
 Severity:  Normal| Resolution:
 Keywords:  tbb-mobile|  Actual Points:
Parent ID:| Points:
 Reviewer:|Sponsor:
--+--
Description changed by igt0:

Old description:

> When the OS language changes, FF mobile updates the intl.locale.os and
> intl.accept_languages.
>

> {{{
>   case "Locale:OS": {
> // We know the system locale. We use this for generating Accept-
> Language headers.
> let languageTag = data.languageTag;
> console.log("Locale:OS: " + languageTag);
> let currentOSLocale = this.getOSLocalePref();
> if (currentOSLocale == languageTag) {
>   break;
> }
>
> console.log("New OS locale.");
>
> // Ensure that this choice is immediately persisted, because
> // Gecko won't be told again if it forgets.
> Services.prefs.setCharPref("intl.locale.os", languageTag);
> Services.prefs.savePrefFile(null);
>
> let appLocale = this.getUALocalePref();
>
> this.computeAcceptLanguages(languageTag, appLocale);
>
> // Rebuild strings, in case we're mirroring OS locale.
> Strings.flush();
> break;
>   }
>
> }}}
>
> the method *computeAcceptLanguages* is the one responsible to keep the
> intl.accept_languages up to date.
>

> {{{
>   computeAcceptLanguages(osLocale, appLocale) {
> let defaultBranch = Services.prefs.getDefaultBranch(null);
> let defaultAccept =
> defaultBranch.getComplexValue("intl.accept_languages",
> Ci.nsIPrefLocalizedString).data;
> console.log("Default intl.accept_languages = " + defaultAccept);
>
> // A guard for potential breakage. Bug 438031.
> // This should not be necessary, because we're reading from the
> default branch,
> // but better safe than sorry.
> if (defaultAccept && defaultAccept.startsWith("chrome://")) {
>   defaultAccept = null;
> } else {
>   // Ensure lowercase everywhere so we can compare.
>   defaultAccept = defaultAccept.toLowerCase();
> }
>
> if (appLocale) {
>   appLocale = appLocale.toLowerCase();
> }
>
> if (osLocale) {
>   osLocale = osLocale.toLowerCase();
> }
>
> // Eliminate values if they're present in the default.
> let chosen;
> if (defaultAccept) {
>   // intl.accept_languages is a comma-separated list, with no q-value
> params. Those
>   // are added when the header is generated.
>   chosen = defaultAccept.split(",")
> .map((x) => x.trim())
> .filter((x) => (x != appLocale && x !=
> osLocale));
> } else {
>   chosen = [];
> }
>
> if (osLocale) {
>   chosen.unshift(osLocale);
> }
>
> if (appLocale && appLocale != osLocale) {
>   chosen.unshift(appLocale);
> }
>
> let result = chosen.join(",");
> console.log("Setting intl.accept_languages to " + result);
> this.setLocalizedPref("intl.accept_languages", result);
>   },
> }}}

New description:

 When the OS language changes, FF mobile updates the intl.locale.os and
 intl.accept_languages preferences.


 {{{
   case "Locale:OS": {
 // We know the system locale. We use this for generating Accept-
 Language headers.
 let languageTag = data.languageTag;
 console.log("Locale:OS: " + languageTag);
 let currentOSLocale = this.getOSLocalePref();
 if (currentOSLocale == languageTag) {
   break;
 }

 console.log("New OS locale.");

 // Ensure that this choice is immediately persisted, because
 // Gecko won't be told again if it forgets.
 Services.prefs.setCharPref("intl.locale.os", languageTag);
 Services.prefs.savePrefFile(null);

 let appLocale = this.getUALocalePref();

 this.computeAcceptLanguages(languageTag, appLocale);

 // Rebuild strings, in case we're mirroring OS locale.
 Strings.flush();
 break;
   }

 }}}

 the method *computeAcceptLanguages* is the one responsible to keep the
 intl.accept_languages up to date.


 {{{
   computeAcceptLanguages(osLocale, appLocale) {
 let defaultBranch = Services.prefs.getDefaultBranch(null);
 let defaultAccept =
 defaultBranch.getComplexValue("intl.accept_languages",
 Ci.nsIPrefLocalizedString).data;
 console.log("Default intl.accept_languages = " + defaultAccept);

 // A guard for potential breakage. Bug 438031.
 // This should not be