Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-web
Commits
427e7184
Commit
427e7184
authored
3 months ago
by
Léopold Chappuis
Browse files
Options
Downloads
Patches
Plain Diff
locales: set language based on system
Change-Id: I015d71380d4881e2d53148ba8d5d023a8df966bd
parent
6e2948f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
client/src/i18n.ts
+7
-1
7 additions, 1 deletion
client/src/i18n.ts
with
7 additions
and
1 deletion
client/src/i18n.ts
+
7
−
1
View file @
427e7184
...
...
@@ -58,7 +58,13 @@ const languagesInfosPromises = availableLanguages.map(async (item: any) => ({
export
const
languagesInfos
:
readonly
LanguageInfo
[]
=
await
Promise
.
all
(
languagesInfosPromises
)
const
lastLanguage
=
localStorage
.
getItem
(
'
language
'
)
const
defaultLanguage
=
lastLanguage
?
lastLanguage
:
'
en
'
// transifex uses underscores instead of dashes
const
systemLanguage
=
navigator
.
language
.
replace
(
'
-
'
,
'
_
'
)
const
defaultLanguage
=
lastLanguage
?
lastLanguage
:
availableLanguages
.
includes
(
systemLanguage
)
?
systemLanguage
:
'
en
'
const
initialResources
=
await
getTranslation
(
defaultLanguage
)
...
...
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
register
or
sign in
to comment