2019-09-06 13:42:29 +00:00
|
|
|
<template>
|
|
|
|
<div class="i18n">
|
|
|
|
<b-dropdown>
|
|
|
|
<template slot="button-content">
|
2019-09-11 13:17:18 +00:00
|
|
|
<img :src="buildImgUrl('language.png')" alt="Change languages logo" />
|
2019-09-06 13:42:29 +00:00
|
|
|
|
|
|
|
<div class="text">
|
2019-09-11 13:17:18 +00:00
|
|
|
<translate>Languages</translate>
|
2019-09-06 13:42:29 +00:00
|
|
|
<span class="caret"></span>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2019-09-11 13:17:18 +00:00
|
|
|
<b-dropdown-item v-for="(lang, locale) in $language.available" :href="buildLocaleLink(locale)">
|
|
|
|
{{ lang }}
|
|
|
|
</b-dropdown-item>
|
2019-09-06 13:42:29 +00:00
|
|
|
|
2019-09-11 13:17:18 +00:00
|
|
|
<b-dropdown-divider></b-dropdown-divider>
|
2019-09-06 13:42:29 +00:00
|
|
|
|
2019-09-11 13:17:18 +00:00
|
|
|
<b-dropdown-item>
|
|
|
|
<a class="translate">
|
|
|
|
<icon-add></icon-add>
|
|
|
|
<span v-translate>Translate</span>
|
|
|
|
</a>
|
|
|
|
</b-dropdown-item>
|
2019-09-06 13:42:29 +00:00
|
|
|
</b-dropdown>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
.i18n .dropdown {
|
|
|
|
button {
|
|
|
|
height: 60px;
|
|
|
|
color: #000;
|
|
|
|
background-color: #fff;
|
|
|
|
border: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.dropdown-toggle::after {
|
|
|
|
display: none;
|
|
|
|
}
|
2019-09-11 13:17:18 +00:00
|
|
|
|
|
|
|
.translate svg {
|
|
|
|
width: 20px;
|
|
|
|
margin-right: 5px;
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2019-09-06 13:42:29 +00:00
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.text {
|
|
|
|
font-size: 11px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>
|
2019-09-11 11:52:20 +00:00
|
|
|
import { BDropdown, BDropdownDivider, BDropdownItem } from 'bootstrap-vue'
|
2019-09-11 13:17:18 +00:00
|
|
|
import IconAdd from './icons/IconAdd'
|
2019-09-06 13:42:29 +00:00
|
|
|
|
2019-09-11 11:52:20 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
2019-09-11 13:17:18 +00:00
|
|
|
BDropdown,
|
|
|
|
BDropdownDivider,
|
|
|
|
BDropdownItem,
|
|
|
|
|
|
|
|
IconAdd
|
2019-09-11 11:52:20 +00:00
|
|
|
},
|
2019-09-11 13:17:18 +00:00
|
|
|
|
2019-09-11 11:52:20 +00:00
|
|
|
methods: {
|
2019-09-11 13:17:18 +00:00
|
|
|
buildLocaleLink (locale) {
|
|
|
|
return window.location.origin + `/${locale}/`
|
2019-09-11 11:52:20 +00:00
|
|
|
}
|
2019-09-06 13:42:29 +00:00
|
|
|
}
|
2019-09-11 11:52:20 +00:00
|
|
|
}
|
2019-09-06 13:42:29 +00:00
|
|
|
</script>
|