Commit f3117536 authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Minor localization fixes. Use JavaScript locale formatting

parent fe3ea9da
......@@ -71,11 +71,6 @@
slug: 'settings',
title: this.$t('navigation.settings'),
},
{
slug: 'help',
title: this.$t('navigation.help'),
}
]
}
// Regular user
......@@ -94,10 +89,6 @@
],
footer: [
{
slug: 'help',
title: this.$t('navigation.help'),
}
]
}
}
......
......@@ -55,10 +55,10 @@
<em>{{ user.name }}</em>
</template>
<b-dropdown-item to="settings">
{{ $t('settings') }}
{{ $t('navigation.settings') }}
</b-dropdown-item>
<b-dropdown-item href="#">
{{ $t('profile') }}
{{ $t('navigation.profile') }}
</b-dropdown-item>
<b-dropdown-item @click="$parent.signOut">
{{ $t('auth.signOut') }}
......
......@@ -8,7 +8,7 @@ export default {
// Layout
'loading': 'Lädt..',
'profile': 'Profil',
'auth': {
'signOut': 'Abmelden',
'signIn': 'Anmelden',
......@@ -21,6 +21,7 @@ export default {
'filesPlaylists': 'Dateien & Playlists',
'calendar': 'Kalender',
'settings': 'Einstellungen',
'profile': 'Profil',
'help': 'Hilfe'
},
......@@ -49,21 +50,6 @@ export default {
'saturday': 'Samstag',
},
'month': {
'january': 'Januar',
'february': 'Februar',
'march': 'März',
'april': 'April',
'may': 'Mai',
'june': 'Juni',
'july': 'Juli',
'august': 'August',
'september': 'September',
'october': 'Oktober',
'november': 'November',
'december': 'Dezember',
},
'rule': {
'1': 'einmalig',
'2': 'täglich',
......
......@@ -22,6 +22,7 @@ export default {
'filesPlaylists': 'Files & Playlists',
'calendar': 'Calendar',
'settings': 'Settings',
'profile': 'Profile',
'help': 'Help'
},
......@@ -50,21 +51,6 @@ export default {
'saturday': 'Saturday',
},
'month': {
'january': 'January',
'february': 'February',
'march': 'March',
'april': 'April',
'may': 'May',
'june': 'June',
'july': 'July',
'august': 'August',
'september': 'September',
'october': 'October',
'november': 'November',
'december': 'December',
},
'rule': {
'1': 'once',
'2': 'daily',
......
......@@ -8,21 +8,6 @@ var day = [
'rrule.day.saturday'
]
var month = [
'rrule.month.january',
'rrule.month.february',
'rrule.month.march',
'rrule.month.april',
'rrule.month.may',
'rrule.month.june',
'rrule.month.july',
'rrule.month.august',
'rrule.month.september',
'rrule.month.october',
'rrule.month.november',
'rrule.month.december'
]
export default {
methods: {
leadingZero (num) {
......@@ -43,27 +28,32 @@ export default {
},
prettyDate: function (date) {
var d = new Date(date)
var dstring = ''
dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. '
dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear()
return dstring
return d.toLocaleString(
this.$activeLocale(),
{
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric',
}
)
},
prettyDateTime: function (date) {
var d = new Date(date)
/*
// This is a simple numbered representation - have to decide which one to use in final design
// note: Date.getMonth() returns the month as an index from 0 to 11
return this.leadingZero(d.getDate()) + '.' + this.leadingZero(d.getMonth() + 1) + '.' + d.getFullYear() + ' ' + this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes())
*/
var dstring = ''
dstring += this.$t(day[d.getDay()]) + ', '
dstring += this.leadingZero(d.getDate()) + '. '
dstring += this.$t(month[d.getMonth()]) + ' '
dstring += d.getFullYear() + ', '
dstring += this.leadingZero(d.getHours()) + ':' + this.leadingZero(d.getMinutes()) + ':' + this.leadingZero(d.getSeconds())
return dstring
return d.toLocaleString(
this.$activeLocale(),
{
weekday: 'long',
day: 'numeric',
month: 'long',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
}
)
},
prettyHours(hours) {
return hours.replace(/:00$/, '');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment