2021-05-13 03:09:08 -07:00
|
|
|
<template>
|
|
|
|
<div class="pt-1">
|
|
|
|
<div v-if="config.locale === 'zh'" class="btn-group m-2">
|
|
|
|
<button v-for="(display, code) in {traditional: '繁體', simplified: '简体'}"
|
|
|
|
:class="'btn btn-sm ' + (spelling === code ? 'btn-secondary disabled' : 'btn-outline-secondary')"
|
|
|
|
:disabled="spelling === code"
|
|
|
|
@click="setSpelling(code)"
|
|
|
|
>
|
|
|
|
{{display}}
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<Dropdown v-if="Object.keys(locales).length > 1" btnClass="btn-outline-secondary btn-sm" class="d-inline-block" :end="end">
|
|
|
|
<template v-slot:toggle>
|
|
|
|
<Icon v="language"/>
|
|
|
|
{{locales[config.locale].name}}
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:menu>
|
|
|
|
<li v-for="(options, locale) in locales" :key="locale" v-if="locale !== config.locale">
|
|
|
|
<a :href="options.url" class="dropdown-item">
|
|
|
|
{{options.name}}
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="dropdown-divider"></li>
|
2022-02-07 12:22:20 -08:00
|
|
|
<li>
|
|
|
|
<a href="https://pronouns.page" class="dropdown-item small">
|
|
|
|
<Logo class="mb-1"/>
|
|
|
|
pronouns.page
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
<li class="dropdown-divider"></li>
|
2021-05-13 03:09:08 -07:00
|
|
|
<li>
|
2022-01-26 07:28:08 -08:00
|
|
|
<LocaleLink locale="en" link="/new-version" class="dropdown-item small">
|
2021-05-13 03:09:08 -07:00
|
|
|
<Icon v="plus"/>
|
|
|
|
<T>localise.shorter</T>
|
|
|
|
</LocaleLink>
|
|
|
|
</li>
|
|
|
|
</template>
|
|
|
|
</Dropdown>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-05-13 08:44:32 -07:00
|
|
|
import { mapState } from 'vuex'
|
|
|
|
|
2021-05-13 03:09:08 -07:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
end: {type: Boolean},
|
|
|
|
},
|
2021-05-13 08:44:32 -07:00
|
|
|
methods: {
|
|
|
|
setSpelling(spelling) {
|
|
|
|
this.$store.commit('setSpelling', spelling);
|
|
|
|
this.$cookies.set('spelling', this.$store.state.spelling);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
...mapState([
|
|
|
|
'spelling',
|
|
|
|
]),
|
|
|
|
},
|
2021-05-13 03:09:08 -07:00
|
|
|
}
|
|
|
|
</script>
|