mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-02-17 15:01:42 +08:00
more i18n stuff
This commit is contained in:
parent
ce56f39a1f
commit
3857e85f82
@ -41,8 +41,8 @@
|
||||
</v-menu>
|
||||
</template>
|
||||
<template v-else>
|
||||
<v-btn href="/signup" class="mr-2" color="primary" v-text="$t('nav.signup')"></v-btn>
|
||||
<v-btn color="secondary" @click="$auth.login($route.fullPath)" v-text="$t('nav.login')"></v-btn>
|
||||
<v-btn href="/signup" class="mr-2" color="primary">{{ $t('nav.signup') }}</v-btn>
|
||||
<v-btn color="secondary" @click="$auth.login($route.fullPath)">{{ $t('nav.login') }}</v-btn>
|
||||
</template>
|
||||
</v-app-bar>
|
||||
</template>
|
||||
|
@ -38,6 +38,20 @@ const msgs: LocaleMessageObject = {
|
||||
community: 'Community',
|
||||
},
|
||||
},
|
||||
project: {
|
||||
category: {
|
||||
admin_tools: 'Admin Tools',
|
||||
chat: 'Chat',
|
||||
dev_tools: 'Developer Tools',
|
||||
economy: 'Economy',
|
||||
gameplay: 'Gameplay',
|
||||
games: 'Games',
|
||||
protection: 'Protection',
|
||||
role_playing: 'Role Playing',
|
||||
world_management: 'World Management',
|
||||
misc: 'Miscellaneous',
|
||||
},
|
||||
},
|
||||
message: 'Good morning!',
|
||||
};
|
||||
|
||||
|
@ -28,14 +28,15 @@
|
||||
<v-list dense>
|
||||
<v-subheader>Categories</v-subheader>
|
||||
<v-list-item-group>
|
||||
<v-list-item v-for="cat in $store.state.projectCategories.values()" :key="cat.apiName">
|
||||
<v-list-item v-for="cat in $store.getters.visibleCategories" :key="cat.apiName">
|
||||
<v-list-item-icon>
|
||||
<v-icon v-text="cat.icon" />
|
||||
</v-list-item-icon>
|
||||
<v-list-item-content>
|
||||
<v-list-item-title v-text="cat.title"></v-list-item-title>
|
||||
</v-list-item-content> </v-list-item
|
||||
></v-list-item-group>
|
||||
<v-list-item-title v-text="$t(`project.category.${cat.apiName}`)"></v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list-item-group>
|
||||
</v-list>
|
||||
|
||||
<v-list dense>
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { ActionTree, MutationTree } from 'vuex';
|
||||
import { ActionTree, MutationTree, GetterTree } from 'vuex';
|
||||
import { Context } from '@nuxt/types';
|
||||
import { IProjectCategory } from 'hangar-api';
|
||||
import { ProjectCategory } from '~/types/enums';
|
||||
@ -31,6 +31,10 @@ export const actions: ActionTree<RootState, RootState> = {
|
||||
},
|
||||
};
|
||||
|
||||
export const getters: GetterTree<RootState, RootState> = {
|
||||
visibleCategories: (state: RootState) => Array.from(state.projectCategories.values()).filter((value) => value.visible),
|
||||
};
|
||||
|
||||
function convertToMap<E, T>(values: T[], toStringFunc: (value: T) => string): Map<E, T> {
|
||||
const map = new Map<E, T>();
|
||||
for (const value of values) {
|
||||
|
@ -23,7 +23,7 @@ public enum Category {
|
||||
ROLE_PLAYING(7, "Role Playing", "mdi-auto-fix", "role_playing"),
|
||||
WORLD_MANAGEMENT(8, "World Management", "mdi-earth", "world_management"),
|
||||
MISC(9, "Miscellaneous", "mdi-asterisk", "misc"),
|
||||
UNDEFINED(10, "Undefined", "", "undefined");
|
||||
UNDEFINED(10, "Undefined", "", "undefined", false);
|
||||
|
||||
private final int value;
|
||||
private final String title;
|
||||
|
Loading…
Reference in New Issue
Block a user