|
16 | 16 | <ButtonStyled> |
17 | 17 | <button @click="cancelRoleEdit"> |
18 | 18 | <XIcon /> |
19 | | - Cancel |
| 19 | + {{ formatMessage(commonMessages.cancelButton) }} |
20 | 20 | </button> |
21 | 21 | </ButtonStyled> |
22 | 22 | <ButtonStyled color="brand"> |
|
25 | 25 | @click="saveRoleEdit" |
26 | 26 | > |
27 | 27 | <template v-if="isSavingRole"> |
28 | | - <SpinnerIcon class="animate-spin" /> Saving... |
| 28 | + <SpinnerIcon class="animate-spin" /> {{ formatMessage(messages.savingLabel) }} |
| 29 | + </template> |
| 30 | + <template v-else> |
| 31 | + <SaveIcon /> {{ formatMessage(commonMessages.saveChangesButton) }} |
29 | 32 | </template> |
30 | | - <template v-else> <SaveIcon /> Save changes </template> |
31 | 33 | </button> |
32 | 34 | </ButtonStyled> |
33 | 35 | </div> |
|
36 | 38 | <NewModal v-if="auth.user && isStaff(auth.user)" ref="userDetailsModal" header="User details"> |
37 | 39 | <div class="flex flex-col gap-3"> |
38 | 40 | <div class="flex flex-col gap-1"> |
39 | | - <span class="text-lg font-bold text-primary">Email</span> |
| 41 | + <span class="text-lg font-bold text-primary">{{ |
| 42 | + formatMessage(messages.emailLabel) |
| 43 | + }}</span> |
40 | 44 | <div> |
41 | 45 | <span |
42 | | - v-tooltip="user.email_verified ? 'Email verified' : 'Email not verified'" |
| 46 | + v-tooltip=" |
| 47 | + user.email_verified |
| 48 | + ? formatMessage(messages.emailVerifiedTooltip) |
| 49 | + : formatMessage(messages.emailNotVerifiedTooltip) |
| 50 | + " |
43 | 51 | class="flex w-fit items-center gap-1" |
44 | 52 | > |
45 | 53 | <span>{{ user.email }}</span> |
|
50 | 58 | </div> |
51 | 59 |
|
52 | 60 | <div class="flex flex-col gap-1"> |
53 | | - <span class="text-lg font-bold text-primary"> Auth providers </span> |
| 61 | + <span class="text-lg font-bold text-primary">{{ |
| 62 | + formatMessage(messages.authProvidersLabel) |
| 63 | + }}</span> |
54 | 64 | <span>{{ user.auth_providers.join(', ') }}</span> |
55 | 65 | </div> |
56 | 66 |
|
57 | 67 | <div class="flex flex-col gap-1"> |
58 | | - <span class="text-lg font-bold text-primary"> Payment methods</span> |
| 68 | + <span class="text-lg font-bold text-primary">{{ |
| 69 | + formatMessage(messages.paymentMethodsLabel) |
| 70 | + }}</span> |
59 | 71 | <span> |
60 | 72 | <template v-if="user.payout_data?.paypal_address"> |
61 | 73 | Paypal ({{ user.payout_data.paypal_address }} - {{ user.payout_data.paypal_country }}) |
|
70 | 82 | </div> |
71 | 83 |
|
72 | 84 | <div class="flex flex-col gap-1"> |
73 | | - <span class="text-lg font-bold text-primary"> Has password </span> |
| 85 | + <span class="text-lg font-bold text-primary">{{ |
| 86 | + formatMessage(messages.hasPasswordLabel) |
| 87 | + }}</span> |
74 | 88 | <span> |
75 | | - {{ user.has_password ? 'Yes' : 'No' }} |
| 89 | + {{ |
| 90 | + user.has_password ? formatMessage(messages.yesLabel) : formatMessage(messages.noLabel) |
| 91 | + }} |
76 | 92 | </span> |
77 | 93 | </div> |
78 | 94 |
|
79 | 95 | <div class="flex flex-col gap-1"> |
80 | | - <span class="text-lg font-bold text-primary"> Has TOTP </span> |
| 96 | + <span class="text-lg font-bold text-primary">{{ |
| 97 | + formatMessage(messages.hasTotpLabel) |
| 98 | + }}</span> |
81 | 99 | <span> |
82 | | - {{ user.has_totp ? 'Yes' : 'No' }} |
| 100 | + {{ user.has_totp ? formatMessage(messages.yesLabel) : formatMessage(messages.noLabel) }} |
83 | 101 | </span> |
84 | 102 | </div> |
85 | 103 | </div> |
|
98 | 116 | user.bio |
99 | 117 | ? user.bio |
100 | 118 | : projects.length === 0 |
101 | | - ? 'A Modrinth user.' |
102 | | - : 'A Modrinth creator.' |
| 119 | + ? formatMessage(messages.bioFallbackUser) |
| 120 | + : formatMessage(messages.bioFallbackCreator) |
103 | 121 | }} |
104 | 122 | </template> |
105 | 123 | <template #stats> |
106 | 124 | <div |
107 | 125 | class="flex items-center gap-2 border-0 border-r border-solid border-divider pr-4 font-semibold" |
108 | 126 | > |
109 | 127 | <BoxIcon class="h-6 w-6 text-secondary" /> |
110 | | - {{ formatCompactNumber(projects?.length || 0) }} |
111 | | - projects |
| 128 | + {{ |
| 129 | + formatMessage(messages.profileProjectsLabel, { |
| 130 | + count: formatCompactNumber(projects?.length || 0), |
| 131 | + }) |
| 132 | + }} |
112 | 133 | </div> |
113 | 134 | <div |
114 | 135 | v-tooltip="sumDownloads.toLocaleString()" |
115 | 136 | class="flex items-center gap-2 border-0 border-r border-solid border-divider pr-4 font-semibold" |
116 | 137 | > |
117 | 138 | <DownloadIcon class="h-6 w-6 text-secondary" /> |
118 | | - {{ formatCompactNumber(sumDownloads) }} |
119 | | - downloads |
| 139 | + {{ |
| 140 | + formatMessage(messages.profileDownloadsLabel, { |
| 141 | + count: formatCompactNumber(sumDownloads), |
| 142 | + }) |
| 143 | + }} |
120 | 144 | </div> |
121 | 145 | <div |
122 | 146 | v-tooltip=" |
|
128 | 152 | class="flex items-center gap-2 font-semibold" |
129 | 153 | > |
130 | 154 | <CalendarIcon class="h-6 w-6 text-secondary" /> |
131 | | - Joined |
| 155 | + {{ formatMessage(messages.profileJoinedLabel) }} |
132 | 156 | {{ formatRelativeTime(user.created) }} |
133 | 157 | </div> |
134 | 158 | </template> |
|
287 | 311 | <h2 class="title">{{ collection.name }}</h2> |
288 | 312 | <div class="stats"> |
289 | 313 | <LibraryIcon aria-hidden="true" /> |
290 | | - Collection |
| 314 | + {{ formatMessage(messages.collectionLabel) }} |
291 | 315 | </div> |
292 | 316 | </div> |
293 | 317 | </div> |
|
298 | 322 | <div class="stats"> |
299 | 323 | <BoxIcon /> |
300 | 324 | {{ |
301 | | - `${$formatNumber(collection.projects?.length || 0, false)} project${(collection.projects?.length || 0) !== 1 ? 's' : ''}` |
| 325 | + `${$formatNumber(collection.projects?.length || 0, false)} project${ |
| 326 | + (collection.projects?.length || 0) !== 1 ? 's' : '' |
| 327 | + }` |
302 | 328 | }} |
303 | 329 | </div> |
304 | 330 | <div class="stats"> |
305 | 331 | <template v-if="collection.status === 'listed'"> |
306 | 332 | <GlobeIcon /> |
307 | | - <span> Public </span> |
| 333 | + <span> {{ formatMessage(commonMessages.publicLabel) }} </span> |
308 | 334 | </template> |
309 | 335 | <template v-else-if="collection.status === 'unlisted'"> |
310 | 336 | <LinkIcon /> |
311 | | - <span> Unlisted </span> |
| 337 | + <span> {{ formatMessage(commonMessages.unlistedLabel) }} </span> |
312 | 338 | </template> |
313 | 339 | <template v-else-if="collection.status === 'private'"> |
314 | 340 | <LockIcon /> |
315 | | - <span> Private </span> |
| 341 | + <span> {{ formatMessage(commonMessages.privateLabel) }} </span> |
316 | 342 | </template> |
317 | 343 | <template v-else-if="collection.status === 'rejected'"> |
318 | 344 | <XIcon /> |
319 | | - <span> Rejected </span> |
| 345 | + <span> {{ formatMessage(commonMessages.rejectedLabel) }} </span> |
320 | 346 | </template> |
321 | 347 | </div> |
322 | 348 | </div> |
@@ -450,25 +476,75 @@ const formatRelativeTime = useRelativeTime() |
450 | 476 | const { addNotification } = injectNotificationManager() |
451 | 477 |
|
452 | 478 | const messages = defineMessages({ |
453 | | - profileProjectsStats: { |
454 | | - id: 'profile.stats.projects', |
455 | | - defaultMessage: |
456 | | - '{count, plural, one {<stat>{count}</stat> project} other {<stat>{count}</stat> projects}}', |
| 479 | + profileProjectsLabel: { |
| 480 | + id: 'profile.label.projects', |
| 481 | + defaultMessage: '{count} {count, plural, one {project} other {projects}}', |
457 | 482 | }, |
458 | | - profileDownloadsStats: { |
459 | | - id: 'profile.stats.downloads', |
460 | | - defaultMessage: |
461 | | - '{count, plural, one {<stat>{count}</stat> project download} other {<stat>{count}</stat> project downloads}}', |
| 483 | + profileDownloadsLabel: { |
| 484 | + id: 'profile.label.downloads', |
| 485 | + defaultMessage: '{count} {count, plural, one {download} other {downloads}}', |
| 486 | + }, |
| 487 | + profileJoinedLabel: { |
| 488 | + id: 'profile.label.joined', |
| 489 | + defaultMessage: 'Joined', |
| 490 | + }, |
| 491 | + savingLabel: { |
| 492 | + id: 'profile.label.saving', |
| 493 | + defaultMessage: 'Saving...', |
| 494 | + }, |
| 495 | + emailLabel: { |
| 496 | + id: 'profile.details.label.email', |
| 497 | + defaultMessage: 'Email', |
| 498 | + }, |
| 499 | + emailVerifiedTooltip: { |
| 500 | + id: 'profile.details.tooltip.email-verified', |
| 501 | + defaultMessage: 'Email verified', |
| 502 | + }, |
| 503 | + emailNotVerifiedTooltip: { |
| 504 | + id: 'profile.details.tooltip.email-not-verified', |
| 505 | + defaultMessage: 'Email not verified', |
| 506 | + }, |
| 507 | + authProvidersLabel: { |
| 508 | + id: 'profile.details.label.auth-providers', |
| 509 | + defaultMessage: 'Auth providers', |
| 510 | + }, |
| 511 | + paymentMethodsLabel: { |
| 512 | + id: 'profile.details.label.payment-methods', |
| 513 | + defaultMessage: 'Payment methods', |
| 514 | + }, |
| 515 | + hasPasswordLabel: { |
| 516 | + id: 'profile.details.label.has-password', |
| 517 | + defaultMessage: 'Has password', |
| 518 | + }, |
| 519 | + hasTotpLabel: { |
| 520 | + id: 'profile.details.label.has-totp', |
| 521 | + defaultMessage: 'Has TOTP', |
| 522 | + }, |
| 523 | + yesLabel: { |
| 524 | + id: 'profile.label.yes', |
| 525 | + defaultMessage: 'Yes', |
| 526 | + }, |
| 527 | + noLabel: { |
| 528 | + id: 'profile.label.no', |
| 529 | + defaultMessage: 'No', |
| 530 | + }, |
| 531 | + bioFallbackUser: { |
| 532 | + id: 'profile.bio.fallback.user', |
| 533 | + defaultMessage: 'A Modrinth user.', |
| 534 | + }, |
| 535 | + bioFallbackCreator: { |
| 536 | + id: 'profile.bio.fallback.creator', |
| 537 | + defaultMessage: 'A Modrinth creator.', |
| 538 | + }, |
| 539 | + collectionLabel: { |
| 540 | + id: 'profile.label.collection', |
| 541 | + defaultMessage: 'Collection', |
462 | 542 | }, |
463 | 543 | profileProjectsFollowersStats: { |
464 | 544 | id: 'profile.stats.projects-followers', |
465 | 545 | defaultMessage: |
466 | 546 | '{count, plural, one {<stat>{count}</stat> project follower} other {<stat>{count}</stat> project followers}}', |
467 | 547 | }, |
468 | | - profileJoinedAt: { |
469 | | - id: 'profile.joined-at', |
470 | | - defaultMessage: 'Joined <date>{ago}</date>', |
471 | | - }, |
472 | 548 | profileUserId: { |
473 | 549 | id: 'profile.user-id', |
474 | 550 | defaultMessage: 'User ID: {id}', |
|
0 commit comments