joinpeertube/src/components/I18n.vue

76 lines
1.6 KiB
Vue
Raw Normal View History

2019-09-06 13:42:29 +00:00
<template>
2019-10-24 10:53:33 +00:00
<div id="i18n">
2019-09-06 13:42:29 +00:00
<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-10-24 11:24:32 +00:00
<b-dropdown-item v-for="(lang, locale) in $language.available" :key="locale" :href="buildLocaleLink(locale)">
2019-09-11 13:17:18 +00:00
{{ 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" target="_blank" rel="noopener noreferrer" href="https://weblate.framasoft.org/projects/joinpeertube/main/">
2019-09-11 13:17:18 +00:00
<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">
2019-10-24 10:53:33 +00:00
#i18n {
.text {
font-size: 11px;
2019-09-06 13:42:29 +00:00
}
2019-10-24 10:53:33 +00:00
.dropdown {
button {
height: 60px;
color: #000;
background-color: #fff;
border: none;
}
2019-09-11 13:17:18 +00:00
2019-10-24 10:53:33 +00:00
.dropdown-toggle::after {
display: none;
}
2019-09-06 13:42:29 +00:00
2019-10-24 10:53:33 +00:00
.translate svg {
width: 20px;
margin-right: 5px;
vertical-align: top;
}
}
2019-09-06 13:42:29 +00:00
}
</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>