Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Add translation keys for welcome page (#1499)
Browse files Browse the repository at this point in the history
* Begin Work

* WIP

* Add long title key

* Finish work (for now)

* Fix lint error

* Add continue button key

* Make continue button key generic
  • Loading branch information
Mysterious-Dev authored Jan 18, 2024
1 parent f26f283 commit 75f0b2b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 10 deletions.
18 changes: 18 additions & 0 deletions locales/en-US/index.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
{
"auth.welcome.checkbox.subscribe": {
"message": "Subscribe to updates about Modrinth"
},
"auth.welcome.description": {
"message": "Thank you for creating an account. You can now follow and create projects, receive updates about your favorite projects, and more!"
},
"auth.welcome.label.tos": {
"message": "By creating an account, you have agreed to Modrinth's <terms-link>Terms</terms-link> and <privacy-policy-link>Privacy Policy</privacy-policy-link>."
},
"auth.welcome.long-title": {
"message": "Welcome to Modrinth!"
},
"auth.welcome.title": {
"message": "Welcome"
},
"button.cancel": {
"message": "Cancel"
},
"button.continue": {
"message": "Continue"
},
"button.edit": {
"message": "Edit"
},
Expand Down
55 changes: 45 additions & 10 deletions pages/auth/welcome.vue
Original file line number Diff line number Diff line change
@@ -1,37 +1,72 @@
<template>
<div>
<h1>Welcome to Modrinth!</h1>
<h1>{{ formatMessage(messages.welcomeLongTitle) }}</h1>

<section class="auth-form">
<p>
Thank you for creating an account. You can now follow and create projects, receive updates
about your favorite projects, and more!
{{ formatMessage(messages.welcomeDescription) }}
</p>

<Checkbox
v-model="subscribe"
class="subscribe-btn"
label="Subscribe to updates about Modrinth"
description="Subscribe to updates about Modrinth"
:label="formatMessage(messages.subscribeCheckbox)"
:description="formatMessage(messages.subscribeCheckbox)"
/>

<button class="btn btn-primary continue-btn centered-btn" @click="continueSignUp">
Continue <RightArrowIcon />
{{ formatMessage(commonMessages.continueButton) }} <RightArrowIcon />
</button>

<p>
By creating an account, you have agreed to Modrinth's
<NuxtLink to="/legal/terms" class="text-link">Terms</NuxtLink> and
<NuxtLink to="/legal/privacy" class="text-link">Privacy Policy</NuxtLink>.
<IntlFormatted :message-id="messages.tosLabel">
<template #terms-link="{ children }">
<NuxtLink to="/legal/terms" class="text-link">
<component :is="() => children" />
</NuxtLink>
</template>
<template #privacy-policy-link="{ children }">
<NuxtLink to="/legal/privacy" class="text-link">
<component :is="() => children" />
</NuxtLink>
</template>
</IntlFormatted>
</p>
</section>
</div>
</template>
<script setup>
import { Checkbox, RightArrowIcon } from 'omorphia'
const { formatMessage } = useVIntl()
const messages = defineMessages({
subscribeCheckbox: {
id: 'auth.welcome.checkbox.subscribe',
defaultMessage: 'Subscribe to updates about Modrinth',
},
tosLabel: {
id: 'auth.welcome.label.tos',
defaultMessage:
"By creating an account, you have agreed to Modrinth's <terms-link>Terms</terms-link> and <privacy-policy-link>Privacy Policy</privacy-policy-link>.",
},
welcomeDescription: {
id: 'auth.welcome.description',
defaultMessage:
'Thank you for creating an account. You can now follow and create projects, receive updates about your favorite projects, and more!',
},
welcomeLongTitle: {
id: 'auth.welcome.long-title',
defaultMessage: 'Welcome to Modrinth!',
},
welcomeTitle: {
id: 'auth.welcome.title',
defaultMessage: 'Welcome',
},
})
useHead({
title: 'Welcome - Modrinth',
title: () => `${formatMessage(messages.welcomeTitle)} - Modrinth`,
})
const subscribe = ref(true)
Expand Down
4 changes: 4 additions & 0 deletions utils/common-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export const commonMessages = defineMessages({
id: 'button.cancel',
defaultMessage: 'Cancel',
},
continueButton: {
id: 'button.continue',
defaultMessage: 'Continue',
},
dateAtTimeTooltip: {
id: 'tooltip.date-at-time',
defaultMessage: '{date, date, long} at {time, time, short}',
Expand Down

0 comments on commit 75f0b2b

Please sign in to comment.