joinpeertube/src/components/I18n.vue

76 lines
1.4 KiB
Vue
Raw Normal View History

2019-09-06 13:42:29 +00:00
<template>
<div class="i18n">
<b-dropdown>
<template slot="button-content">
2019-09-11 13:48:27 +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 13:48:27 +00:00
import { BDropdown, BDropdownDivider, BDropdownItem } from 'bootstrap-vue'
import IconAdd from './icons/IconAdd'
2019-09-06 13:42:29 +00:00
2019-09-11 13:48:27 +00:00
export default {
components: {
BDropdown,
BDropdownDivider,
BDropdownItem,
2019-09-11 13:17:18 +00:00
2019-09-11 13:48:27 +00:00
IconAdd
},
2019-09-11 13:17:18 +00:00
2019-09-11 13:48:27 +00:00
methods: {
buildLocaleLink (locale) {
2019-09-12 07:20:18 +00:00
return process.env.BASE_URL + `${locale}/`
2019-09-11 13:48:27 +00:00
}
2019-09-11 11:52:20 +00:00
}
2019-09-06 13:42:29 +00:00
}
</script>