Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
AURA
dashboard
Commits
86285b8c
Commit
86285b8c
authored
1 year ago
by
Konrad Mohrfeldt
Browse files
Options
Downloads
Patches
Plain Diff
feat: add language selector
fixes
#210
parent
7150c824
No related branches found
No related tags found
No related merge requests found
Pipeline
#7000
passed
1 year ago
Stage: test
Stage: release
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Pages/LoginScreen.vue
+18
-2
18 additions, 2 deletions
src/Pages/LoginScreen.vue
src/i18n/index.ts
+4
-0
4 additions, 0 deletions
src/i18n/index.ts
with
22 additions
and
2 deletions
src/Pages/LoginScreen.vue
+
18
−
2
View file @
86285b8c
...
...
@@ -8,6 +8,22 @@
<header
class=
"tw-mb-9 tw-flex tw-flex-col tw-justify-center"
>
<div
class=
"tw-flex tw-items-center tw-justify-between tw-gap-6 tw-mb-6"
>
<Logo
class=
"tw-w-1/2 tw-h-auto tw-flex-none"
/>
<div
class=
"tw-relative tw-shrink tw-min-w-0 tw-flex"
>
<icon-fa-language
class=
"tw-absolute tw-top-0 tw-bottom-0 tw-my-auto tw-left-2 tw-pointer-events-none"
role=
"presentation"
/>
<select
v-model=
"locale"
class=
"tw-py-2 tw-pl-9 tw-pr-2 btn btn-default tw-text-left tw-min-w-0"
:aria-label=
"t('languageSelector.label')"
>
<option
v-for=
"_locale in availableLocales"
:key=
"_locale"
:value=
"_locale"
>
{{
getLanguageName
(
_locale
)
}}
</option>
</select>
</div>
</div>
<p
class=
"tw-text-sm tw-m-0 tw-hyphens-auto tw-text-justify"
>
...
...
@@ -38,9 +54,9 @@ import Logo from '../../public/assets/logo.svg?component'
import
{
loginRedirect
}
from
'
@/oidc
'
import
Dots
from
'
@/components/generic/Dots.vue
'
import
{
useAuthStore
}
from
'
@/stores
'
import
{
useI18n
}
from
'
@/i18n
'
import
{
getLanguageName
,
useI18n
}
from
'
@/i18n
'
import
Splash
from
'
@/components/Splash.vue
'
const
{
locale
,
t
}
=
useI18n
()
const
{
availableLocales
,
locale
,
t
}
=
useI18n
()
const
authStore
=
useAuthStore
()
<
/script
>
This diff is collapsed.
Click to expand it.
src/i18n/index.ts
+
4
−
0
View file @
86285b8c
...
...
@@ -53,6 +53,10 @@ function updateLocale(newLocale: string): void {
}
}
export
function
getLanguageName
(
languageCode
:
string
)
{
return
new
Intl
.
DisplayNames
([
languageCode
],
{
type
:
'
language
'
}).
of
(
languageCode
)
}
export
function
useI18n
()
{
// This interface is intentionally similar to the one provided by
// Vue I18n to make it easier for newcomers already familiar with it
...
...
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