Add translation keys for welcome page (#1499)

* Begin Work

* WIP

* Add long title key

* Finish work (for now)

* Fix lint error

* Add continue button key

* Make continue button key generic
This commit is contained in:
Mysterious_Dev
2024-01-18 18:05:54 +01:00
committed by GitHub
parent f26f283c1f
commit 75f0b2b82c
3 changed files with 67 additions and 10 deletions

View File

@@ -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": { "button.cancel": {
"message": "Cancel" "message": "Cancel"
}, },
"button.continue": {
"message": "Continue"
},
"button.edit": { "button.edit": {
"message": "Edit" "message": "Edit"
}, },

View File

@@ -1,28 +1,36 @@
<template> <template>
<div> <div>
<h1>Welcome to Modrinth!</h1> <h1>{{ formatMessage(messages.welcomeLongTitle) }}</h1>
<section class="auth-form"> <section class="auth-form">
<p> <p>
Thank you for creating an account. You can now follow and create projects, receive updates {{ formatMessage(messages.welcomeDescription) }}
about your favorite projects, and more!
</p> </p>
<Checkbox <Checkbox
v-model="subscribe" v-model="subscribe"
class="subscribe-btn" class="subscribe-btn"
label="Subscribe to updates about Modrinth" :label="formatMessage(messages.subscribeCheckbox)"
description="Subscribe to updates about Modrinth" :description="formatMessage(messages.subscribeCheckbox)"
/> />
<button class="btn btn-primary continue-btn centered-btn" @click="continueSignUp"> <button class="btn btn-primary continue-btn centered-btn" @click="continueSignUp">
Continue <RightArrowIcon /> {{ formatMessage(commonMessages.continueButton) }} <RightArrowIcon />
</button> </button>
<p> <p>
By creating an account, you have agreed to Modrinth's <IntlFormatted :message-id="messages.tosLabel">
<NuxtLink to="/legal/terms" class="text-link">Terms</NuxtLink> and <template #terms-link="{ children }">
<NuxtLink to="/legal/privacy" class="text-link">Privacy Policy</NuxtLink>. <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> </p>
</section> </section>
</div> </div>
@@ -30,8 +38,35 @@
<script setup> <script setup>
import { Checkbox, RightArrowIcon } from 'omorphia' 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({ useHead({
title: 'Welcome - Modrinth', title: () => `${formatMessage(messages.welcomeTitle)} - Modrinth`,
}) })
const subscribe = ref(true) const subscribe = ref(true)

View File

@@ -7,6 +7,10 @@ export const commonMessages = defineMessages({
id: 'button.cancel', id: 'button.cancel',
defaultMessage: 'Cancel', defaultMessage: 'Cancel',
}, },
continueButton: {
id: 'button.continue',
defaultMessage: 'Continue',
},
dateAtTimeTooltip: { dateAtTimeTooltip: {
id: 'tooltip.date-at-time', id: 'tooltip.date-at-time',
defaultMessage: '{date, date, long} at {time, time, short}', defaultMessage: '{date, date, long} at {time, time, short}',