mirror of
https://github.com/HangarMC/Hangar.git
synced 2025-03-13 15:39:18 +08:00
pluralization localization
This commit is contained in:
parent
1b2b27ee05
commit
1fbfd4cbed
@ -164,9 +164,14 @@ const msgs: LocaleMessageObject = {
|
||||
},
|
||||
},
|
||||
sendForApproval: 'Send for approval',
|
||||
info: 'Information',
|
||||
publishDate: 'Published on {0}',
|
||||
views: '{0} views',
|
||||
info: {
|
||||
title: 'Information',
|
||||
publishDate: 'Published on {0}',
|
||||
views: '0 views | {0} view | {0} views',
|
||||
totalDownloads: '0 total downloads | {0} total download | {0} total downloads',
|
||||
stars: '0 stars | {0} star | {0} stars',
|
||||
watchers: '0 watchers | {0} watcher | {0} watchers',
|
||||
},
|
||||
promotedVersions: 'Promoted Versions',
|
||||
license: {
|
||||
link: 'Licensed under ',
|
||||
@ -390,11 +395,19 @@ const msgs: LocaleMessageObject = {
|
||||
orgs: 'Organizations',
|
||||
viewOnForums: 'View on forums ',
|
||||
memberSince: 'A member since {0}',
|
||||
numProjects: '{0} project(s)',
|
||||
numProjects: 'No projects | {0} project | {0} projects',
|
||||
addTagline: 'Add a tagline',
|
||||
noOrgs: '{0} is not part of any organizations. 😢',
|
||||
noWatching: '{0} has not starred any projects. 😢',
|
||||
noStarred: '{0} is not watching any projects. 😢',
|
||||
tooltips: {
|
||||
settings: 'User Settings',
|
||||
lock: 'Lock Account',
|
||||
unlock: 'Unlock Account',
|
||||
apiKeys: 'API Keys',
|
||||
activity: 'User Activity',
|
||||
admin: 'User Admin',
|
||||
},
|
||||
},
|
||||
linkout: {
|
||||
title: 'External Link Warning',
|
||||
|
@ -18,7 +18,7 @@
|
||||
<v-row>
|
||||
<v-col cols="12">
|
||||
<v-card>
|
||||
<v-card-title v-text="$t('project.info')"></v-card-title>
|
||||
<v-card-title v-text="$t('project.info.title')"></v-card-title>
|
||||
<v-card-text>
|
||||
<!-- todo where do we get this from? -->
|
||||
<v-btn-toggle v-if="project.recommendedVersionId">
|
||||
@ -51,20 +51,21 @@
|
||||
|
||||
<div class="project-info">
|
||||
<p>{{ $t('project.category.info', [$store.state.projectCategories.get(project.category).title]) }}</p>
|
||||
<p>{{ $t('project.publishDate', [$util.prettyDate(project.createdAt)]) }}</p>
|
||||
<p>{{ $t('project.info.publishDate', [$util.prettyDate(project.createdAt)]) }}</p>
|
||||
<p v-if="project">
|
||||
<span id="view-count">{{ $t('project.views', [project.stats.views]) }}</span>
|
||||
<span id="view-count">{{ $tc('project.info.views', project.stats.views, [project.stats.views]) }}</span>
|
||||
,
|
||||
<span id="download-count">{{ project.stats.downloads }} total download{{ project.stats.downloads !== 1 ? 's' : '' }}</span>
|
||||
<span id="download-count"
|
||||
>{{ $tc('project.info.totalDownloads', project.stats.downloads, [project.stats.downloads]) }}
|
||||
</span>
|
||||
</p>
|
||||
<p v-if="project">
|
||||
<span id="star-count">{{ project.stats.stars }}</span>
|
||||
<NuxtLink :to="project.namespace.slug + '/stars'"> {{ project.stats.views !== 1 ? ' stars' : ' star' }}</NuxtLink>
|
||||
,
|
||||
<span id="watcher-count">{{ project.stats.watchers }}</span>
|
||||
<NuxtLink :to="project.namespace.slug + '/watchers'">
|
||||
{{ project.stats.views !== 1 ? ' watchers' : ' watcher' }}
|
||||
</NuxtLink>
|
||||
<v-btn to="stars" nuxt small>
|
||||
{{ $tc('project.info.stars', project.stats.stars, [project.stats.stars]) }}
|
||||
</v-btn>
|
||||
<v-btn to="watchers" nuxt small>
|
||||
{{ $tc('project.info.watchers', project.stats.watchers, [project.stats.watchers]) }}
|
||||
</v-btn>
|
||||
</p>
|
||||
<p v-if="project && project.settings.license && project.settings.license.name">
|
||||
{{ $t('project.license.link') }}
|
||||
|
@ -9,9 +9,20 @@
|
||||
<v-list dense flat class="d-inline-flex">
|
||||
<v-list-item v-for="btn in buttons" :key="btn.name">
|
||||
<v-list-item-content>
|
||||
<v-btn icon :to="btn.url">
|
||||
<v-icon>{{ btn.icon }}</v-icon>
|
||||
</v-btn>
|
||||
<v-tooltip bottom>
|
||||
<template #activator="{ on }">
|
||||
<v-btn
|
||||
icon
|
||||
:href="btn.external ? btn.url : undefined"
|
||||
:to="btn.external ? undefined : btn.url"
|
||||
:nuxt="!btn.external"
|
||||
v-on="on"
|
||||
>
|
||||
<v-icon>{{ btn.icon }}</v-icon>
|
||||
</v-btn>
|
||||
</template>
|
||||
<span>{{ $t(`author.tooltips.${btn.name}`) }}</span>
|
||||
</v-tooltip>
|
||||
</v-list-item-content>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
@ -28,7 +39,7 @@
|
||||
</v-col>
|
||||
<v-spacer />
|
||||
<v-col cols="2">
|
||||
<v-subheader>{{ $t('author.numProjects', [user.projectCount]) }}</v-subheader>
|
||||
<v-subheader>{{ $tc('author.numProjects', user.projectCount, [user.projectCount]) }}</v-subheader>
|
||||
<v-subheader>{{ $t('author.memberSince', [$util.prettyDate(user.joinDate)]) }}</v-subheader>
|
||||
<a :href="$util.forumUrl(user.name)">{{ $t('author.viewOnForums') }}<v-icon>mdi-open-in-new</v-icon></a>
|
||||
</v-col>
|
||||
@ -45,10 +56,11 @@ import { Context } from '@nuxt/types';
|
||||
import UserAvatar from '../components/UserAvatar.vue';
|
||||
|
||||
interface Button {
|
||||
icon: String;
|
||||
icon: string;
|
||||
action?: Function;
|
||||
url: String;
|
||||
name: String;
|
||||
external?: boolean;
|
||||
url: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@ -59,13 +71,12 @@ export default class UserParentPage extends Vue {
|
||||
|
||||
get buttons(): Button[] {
|
||||
const buttons = [] as Button[];
|
||||
// TODO user admin
|
||||
buttons.push({ icon: 'mdi-cog', url: '', name: 'Settings' });
|
||||
buttons.push({ icon: 'mdi-lock-open-outline', url: '', name: 'Lock Account' });
|
||||
buttons.push({ icon: 'mdi-lock-outline', url: '', name: 'Unlock Account' });
|
||||
buttons.push({ icon: 'mdi-key', url: '/' + this.user.name + '/settings/api-keys', name: 'API Keys' });
|
||||
buttons.push({ icon: 'mdi-calendar', url: '', name: 'Activity' });
|
||||
buttons.push({ icon: 'mdi-wrench', url: '', name: 'User Admin' });
|
||||
buttons.push({ icon: 'mdi-cog', url: `${process.env.authHost}/accounts/settings`, external: true, name: 'settings' });
|
||||
buttons.push({ icon: 'mdi-lock-open-outline', url: '', name: 'lock' });
|
||||
buttons.push({ icon: 'mdi-lock-outline', url: '', name: 'unlock' });
|
||||
buttons.push({ icon: 'mdi-key', url: '/' + this.user.name + '/settings/api-keys', name: 'apiKeys' });
|
||||
buttons.push({ icon: 'mdi-calendar', url: '', name: 'activity' });
|
||||
buttons.push({ icon: 'mdi-wrench', url: '', name: 'admin' });
|
||||
return buttons;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user