Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beta.ordbok.uib.no
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Språksamlingane
beta.ordbok.uib.no
Commits
59911dc4
Commit
59911dc4
authored
3 years ago
by
Henrik Askjer
Browse files
Options
Downloads
Patches
Plain Diff
modular locale menu
parent
cd39510c
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/LocaleMenu.vue
+35
-0
35 additions, 0 deletions
src/components/LocaleMenu.vue
src/components/Menu.vue
+4
-30
4 additions, 30 deletions
src/components/Menu.vue
src/components/TopBar.vue
+20
-7
20 additions, 7 deletions
src/components/TopBar.vue
with
59 additions
and
37 deletions
src/components/LocaleMenu.vue
0 → 100644
+
35
−
0
View file @
59911dc4
<
template
>
<v-list
subheader
max-width=
"250"
>
<v-subheader>
{{
$t
(
"
settings.locale
"
)
}}
</v-subheader>
<v-select
rounded
v-model=
"updateLocale"
prepend-inner-icon=
"language"
outlined
:items=
"locales"
dense
>
</v-select>
</v-list>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
locales
:
[{
text
:
"
norsk (bokmål)
"
,
value
:
"
nob
"
},
{
text
:
"
norsk (nynorsk)
"
,
value
:
"
nno
"
},
{
text
:
"
english
"
,
value
:
"
eng
"
}],
localesMap
:
{
"
nob
"
:
"
norsk (bokmål)
"
,
"
nno
"
:
"
norsk (nynorsk)
"
,
"
eng
"
:
"
english
"
},
}
},
computed
:
{
updateLocale
:
{
get
()
{
return
{
text
:
this
.
localesMap
[
this
.
$store
.
state
.
currentLocale
],
value
:
this
.
$store
.
state
.
currentLocale
}},
set
(
value
)
{
this
.
$store
.
commit
(
"
setLocale
"
,
{
value
:
value
,
i18n
:
this
.
_i18n
})
}
}
},
}
</
script
>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/components/Menu.vue
+
4
−
30
View file @
59911dc4
...
@@ -18,17 +18,7 @@
...
@@ -18,17 +18,7 @@
<v-subheader>
Hjelp og informasjon
</v-subheader>
<v-subheader>
Hjelp og informasjon
</v-subheader>
<v-btn
text
to=
"/om"
>
Om ordbøkene
<v-icon>
chevron_right
</v-icon></v-btn>
<v-btn
text
to=
"/om"
>
Om ordbøkene
<v-icon>
chevron_right
</v-icon></v-btn>
</v-list>
</v-list>
<v-list
subheader
max-width=
"250"
>
<LocaleMenu/>
<v-subheader>
{{
$t
(
"
settings.locale
"
)
}}
</v-subheader>
<v-select
rounded
v-model=
"updateLocale"
prepend-inner-icon=
"language"
outlined
:items=
"locales"
dense
>
</v-select>
</v-list>
<Settings/>
<Settings/>
</v-card-text>
</v-card-text>
...
@@ -43,29 +33,13 @@
...
@@ -43,29 +33,13 @@
<
script
>
<
script
>
import
Settings
from
'
./Settings.vue
'
import
Settings
from
'
./Settings.vue
'
import
LocaleMenu
from
'
./LocaleMenu.vue
'
export
default
{
export
default
{
name
:
"
Menu
"
,
name
:
"
Menu
"
,
props
:
{
activatorClass
:
null
},
data
()
{
return
{
locales
:
[{
text
:
"
norsk (bokmål)
"
,
value
:
"
nob
"
},
{
text
:
"
norsk (nynorsk)
"
,
value
:
"
nno
"
},
{
text
:
"
english
"
,
value
:
"
eng
"
}],
localesMap
:
{
"
nob
"
:
"
norsk (bokmål)
"
,
"
nno
"
:
"
norsk (nynorsk)
"
,
"
eng
"
:
"
english
"
},
}
},
computed
:
{
updateLocale
:
{
get
()
{
return
{
text
:
this
.
localesMap
[
this
.
$store
.
state
.
currentLocale
],
value
:
this
.
$store
.
state
.
currentLocale
}},
set
(
value
)
{
this
.
$store
.
commit
(
"
setLocale
"
,
{
value
:
value
,
i18n
:
this
.
_i18n
})
}
}
},
components
:
{
components
:
{
Settings
Settings
,
LocaleMenu
}
}
}
}
</
script
>
</
script
>
This diff is collapsed.
Click to expand it.
src/components/TopBar.vue
+
20
−
7
View file @
59911dc4
...
@@ -4,14 +4,23 @@
...
@@ -4,14 +4,23 @@
<v-spacer/>
<v-spacer/>
<v-toolbar-items
class=
"hidden-sm-and-down"
>
<v-toolbar-items
class=
"hidden-sm-and-down"
>
<v-divider
vertical
/>
<v-divider
vertical
/>
<v-btn
text
width=
"210"
:class=
"$vuetify.breakpoint.name"
><v-icon
left
>
language
</v-icon>
Norsk (Bokmål)
<v-icon
right
>
expand_more
</v-icon></v-btn>
<v-btn
text
width=
"210"
v-if=
"false"
:class=
"$vuetify.breakpoint.name"
><v-icon
left
>
language
</v-icon>
Norsk (Bokmål)
<v-icon
right
>
expand_more
</v-icon></v-btn>
<v-divider
vertical
/>
<v-divider
vertical
/>
<v-btn
text
width=
"210"
><v-icon
left
>
settings
</v-icon>
Instillinger
<v-icon
right
>
expand_more
</v-icon></v-btn>
<v-menu
:close-on-content-click=
"false"
>
<template
v-slot:activator=
"
{ on, attrs }">
<v-btn
v-bind=
"attrs"
v-on=
"on"
text
width=
"210"
><v-icon
left
>
settings
</v-icon>
Instillinger
<v-icon
right
>
expand_more
</v-icon></v-btn>
</
template
>
<v-card>
<LocaleMenu/>
<Settings/>
</v-card>
</v-menu>
<v-divider
vertical
/>
<v-divider
vertical
/>
<v-btn
text
width=
"210"
@
click=
"toggleAbout"
><v-icon
left
>
{{$route.name=='about'? "chevron_left":"info"}}
</v-icon>
{{$route.name=='about'? "Tilbake":"Om ordbøkene"}}
</v-btn>
<v-btn
text
width=
"210"
@
click=
"toggleAbout"
><v-icon
left
>
{{$route.name=='about'? "chevron_left":"info"}}
</v-icon>
{{$route.name=='about'? "Tilbake":"Om ordbøkene"}}
</v-btn>
<v-divider
vertical
/>
<v-divider
vertical
/>
</v-toolbar-items>
</v-toolbar-items>
<v-toolbar-items>
<v-toolbar-items
v-if=
"$vuetify.breakpoint.mobile"
>
<v-divider
vertical
/>
<v-divider
vertical
/>
<v-dialog
max-width=
"1200"
width=
"1200"
v-model=
"menuDialog"
hide-overlay
:fullscreen=
"$vuetify.breakpoint.mobile"
<v-dialog
max-width=
"1200"
width=
"1200"
v-model=
"menuDialog"
hide-overlay
:fullscreen=
"$vuetify.breakpoint.mobile"
:close-on-content-click=
"false"
transition=
"dialog-top-transition"
>
:close-on-content-click=
"false"
transition=
"dialog-top-transition"
>
...
@@ -29,6 +38,8 @@
...
@@ -29,6 +38,8 @@
<
script
>
<
script
>
import
Menu
from
'
./Menu.vue
'
import
Menu
from
'
./Menu.vue
'
import
Settings
from
'
./Settings.vue
'
import
LocaleMenu
from
'
./LocaleMenu.vue
'
export
default
{
export
default
{
name
:
"
TopBar
"
,
name
:
"
TopBar
"
,
...
@@ -36,7 +47,7 @@ export default {
...
@@ -36,7 +47,7 @@ export default {
return
{
return
{
version_label
:
process
.
env
.
VUE_APP_VERSION_LABEL
,
version_label
:
process
.
env
.
VUE_APP_VERSION_LABEL
,
release
:
process
.
env
.
VUE_APP_RELEASE
,
release
:
process
.
env
.
VUE_APP_RELEASE
,
menuDialog
:
false
menuDialog
:
false
,
}
}
},
},
methods
:
{
methods
:
{
...
@@ -45,7 +56,9 @@ export default {
...
@@ -45,7 +56,9 @@ export default {
}
}
},
},
components
:
{
components
:
{
Menu
Menu
,
}
Settings
,
LocaleMenu
},
}
}
</
script
>
</
script
>
\ No newline at end of file
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