diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 2459075245..ae22392523 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -263,6 +263,24 @@ "dashboard.collections.long-title": { "message": "Your collections" }, + "dashboard.organization.title": { + "message": "Organizations" + }, + "dashboard.organizations.action.create-organization": { + "message": "Create organization" + }, + "dashboard.organizations.error.fetch-organization": { + "message": "Failed to fetch organizations" + }, + "dashboard.organizations.make-organization": { + "message": "Make an organization!" + }, + "dashboard.organizations.members": { + "message": "{count, plural, one {{count} member} other {{count} members}}" + }, + "dashboard.organizations.title": { + "message": "Organizations" + }, "frog": { "message": "You've been frogged! 🐸" }, diff --git a/pages/dashboard.vue b/pages/dashboard.vue index 8732c6707f..a8f8f74e3a 100644 --- a/pages/dashboard.vue +++ b/pages/dashboard.vue @@ -21,7 +21,11 @@ - +
-

Organizations

+

{{ formatMessage(messages.title) }}

@@ -32,10 +32,11 @@
- {{ onlyAcceptedMembers(org.members).length }} member + {{ + formatMessage(messages.membersLabel, { + count: formatCompactNumber(onlyAcceptedMembers(org.members).length), + }) + }}
@@ -43,7 +44,9 @@ - +
@@ -54,6 +57,32 @@ import { PlusIcon, Avatar, UsersIcon } from 'omorphia' import { useAuth } from '~/composables/auth.js' import OrganizationCreateModal from '~/components/ui/OrganizationCreateModal.vue' +const { formatMessage } = useVIntl() +const formatCompactNumber = useCompactNumber() + +const messages = defineMessages({ + createOrganization: { + id: 'dashboard.organizations.action.create-organization', + defaultMessage: 'Create organization', + }, + fetchOranizationError: { + id: 'dashboard.organizations.error.fetch-organization', + defaultMessage: 'Failed to fetch organizations', + }, + makeOrganizationLabel: { + id: 'dashboard.organizations.make-organization', + defaultMessage: 'Make an organization!', + }, + membersLabel: { + id: 'dashboard.organizations.members', + defaultMessage: '{count, plural, one {{count} member} other {{count} members}}', + }, + title: { + id: 'dashboard.organizations.title', + defaultMessage: 'Organizations', + }, +}) + const createOrgModal = ref(null) const auth = await useAuth() @@ -72,7 +101,7 @@ const onlyAcceptedMembers = (members) => members.filter((member) => member?.acce if (error.value) { createError({ statusCode: 500, - message: 'Failed to fetch organizations', + message: formatMessage(message.fetchOranizationError), }) }