add language picker.

This commit is contained in:
Miroslav Šedivý 2021-04-02 15:29:27 +00:00
parent fd4b4bbfa2
commit b264e397d8
2 changed files with 35 additions and 0 deletions

View File

@ -37,6 +37,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms.
- Added `m1k1o/neko:vlc` tag, use VLC to watch local files together (by @mbattista). - Added `m1k1o/neko:vlc` tag, use VLC to watch local files together (by @mbattista).
- Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista). - Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista).
- Added ARM-based images, for Raspberry Pi support (by @mbattista). - Added ARM-based images, for Raspberry Pi support (by @mbattista).
- Added simple language picker.
### Bugs ### Bugs
- Fixed minor gst pipeline bug. - Fixed minor gst pipeline bug.

View File

@ -13,6 +13,13 @@
v-if="admin" v-if="admin"
/> />
</li> </li>
<li>
<select v-model="$i18n.locale">
<option v-for="(lang, i) in langs" :key="`Lang${i}`" :value="lang">
{{ lang }}
</option>
</select>
</li>
</ul> </ul>
</template> </template>
@ -28,10 +35,33 @@
} }
} }
} }
select {
appearance: none;
background-color: $background-tertiary;
border: 1px solid $background-primary;
color: white;
cursor: pointer;
border-radius: 5px;
height: 24px;
vertical-align: text-bottom;
display: inline-block;
option {
font-weight: normal;
color: $text-normal;
background-color: $background-tertiary;
}
&:hover {
border: 1px solid $background-primary;
}
}
</style> </style>
<script lang="ts"> <script lang="ts">
import { Component, Ref, Watch, Vue } from 'vue-property-decorator' import { Component, Ref, Watch, Vue } from 'vue-property-decorator'
import { messages } from '~/locale'
@Component({ name: 'neko-menu' }) @Component({ name: 'neko-menu' })
export default class extends Vue { export default class extends Vue {
@ -39,6 +69,10 @@
return this.$accessor.user.admin return this.$accessor.user.admin
} }
get langs() {
return Object.keys(messages)
}
about() { about() {
this.$accessor.client.toggleAbout() this.$accessor.client.toggleAbout()
} }