Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Tor Browser
Commits
4a11f33d
Commit
4a11f33d
authored
Oct 20, 2020
by
Alex Catarineu
Committed by
Richard Pospesel
Feb 9, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Bug 40199: Avoid using system locale for intl.accept_languages in GeckoView
parent
0795a034
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!545
Rebase tor-browser to esr102.8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
+17
-11
17 additions, 11 deletions
...main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
with
17 additions
and
11 deletions
mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoRuntimeSettings.java
+
17
−
11
View file @
4a11f33d
...
...
@@ -792,19 +792,25 @@ public final class GeckoRuntimeSettings extends RuntimeSettings {
private
String
computeAcceptLanguages
()
{
final
ArrayList
<
String
>
locales
=
new
ArrayList
<
String
>();
// Explicitly-set app prefs come first:
if
(
mRequestedLocales
!=
null
)
{
for
(
final
String
locale
:
mRequestedLocales
)
{
locales
.
add
(
locale
.
toLowerCase
(
Locale
.
ROOT
));
// In Desktop, these are defined in the `intl.accept_languages` localized property.
// At some point we should probably use the same values here, but for now we use a simple
// strategy which will hopefully result in reasonable acceptLanguage values.
if
(
mRequestedLocales
!=
null
&&
mRequestedLocales
.
length
>
0
)
{
String
locale
=
mRequestedLocales
[
0
].
toLowerCase
(
Locale
.
ROOT
);
// No need to include `en-us` twice.
if
(!
locale
.
equals
(
"en-us"
))
{
locales
.
add
(
locale
);
if
(
locale
.
contains
(
"-"
))
{
String
lang
=
locale
.
split
(
"-"
)[
0
];
// No need to include `en` twice.
if
(!
lang
.
equals
(
"en"
))
{
locales
.
add
(
lang
);
}
}
// OS prefs come second:
for
(
final
String
locale
:
getDefaultLocales
())
{
final
String
localeLowerCase
=
locale
.
toLowerCase
(
Locale
.
ROOT
);
if
(!
locales
.
contains
(
localeLowerCase
))
{
locales
.
add
(
localeLowerCase
);
}
}
locales
.
add
(
"en-us"
);
locales
.
add
(
"en"
);
return
TextUtils
.
join
(
","
,
locales
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment