diff --git a/locales/en-US/index.json b/locales/en-US/index.json index 8c50df5f5..006961326 100644 --- a/locales/en-US/index.json +++ b/locales/en-US/index.json @@ -1,4 +1,34 @@ { + "auth.sign-in.2fa.description": { + "message": "Please enter a two-factor code to proceed." + }, + "auth.sign-in.2fa.label": { + "message": "Enter two-factor code" + }, + "auth.sign-in.2fa.placeholder": { + "message": "Enter code..." + }, + "auth.sign-in.action.sign-in": { + "message": "Sign in" + }, + "auth.sign-in.additional-options": { + "message": "Forgot password?Create an account" + }, + "auth.sign-in.email-username.label": { + "message": "Email or username" + }, + "auth.sign-in.password.label": { + "message": "Password" + }, + "auth.sign-in.sign-in-with": { + "message": "Sign in with" + }, + "auth.sign-in.title": { + "message": "Sign In" + }, + "auth.sign-in.use-password": { + "message": "Or use a password" + }, "auth.sign-up.action.create-account": { "message": "Create account" }, diff --git a/pages/auth/sign-in.vue b/pages/auth/sign-in.vue index 9c79bfb5e..e39a8bc6c 100644 --- a/pages/auth/sign-in.vue +++ b/pages/auth/sign-in.vue @@ -2,26 +2,28 @@
@@ -106,8 +117,56 @@ import KeyIcon from 'assets/icons/auth/key.svg' import MailIcon from 'assets/icons/auth/mail.svg' import GitLabIcon from 'assets/icons/auth/sso-gitlab.svg' +const { formatMessage } = useVIntl() + +const messages = defineMessages({ + additionalOptionsLabel: { + id: 'auth.sign-in.additional-options', + defaultMessage: + 'Forgot password?Create an account', + }, + emailUsernameLabel: { + id: 'auth.sign-in.email-username.label', + defaultMessage: 'Email or username', + }, + passwordLabel: { + id: 'auth.sign-in.password.label', + defaultMessage: 'Password', + }, + signInButton: { + id: 'auth.sign-in.action.sign-in', + defaultMessage: 'Sign in', + }, + signInWithLabel: { + id: 'auth.sign-in.sign-in-with', + defaultMessage: 'Sign in with', + }, + signInTitle: { + id: 'auth.sign-in.title', + defaultMessage: 'Sign In', + }, + twoFactorCodeInputPlaceholder: { + id: 'auth.sign-in.2fa.placeholder', + defaultMessage: 'Enter code...', + }, + twoFactorCodeLabel: { + id: 'auth.sign-in.2fa.label', + defaultMessage: 'Enter two-factor code', + }, + twoFactorCodeLabelDescription: { + id: 'auth.sign-in.2fa.description', + defaultMessage: 'Please enter a two-factor code to proceed.', + }, + usePasswordLabel: { + id: 'auth.sign-in.use-password', + defaultMessage: 'Or use a password', + }, +}) + useHead({ - title: 'Sign In - Modrinth', + title() { + return `${formatMessage(messages.signInTitle)} - Modrinth` + }, }) const auth = await useAuth() @@ -161,7 +220,7 @@ async function beginPasswordSignIn() { } catch (err) { addNotification({ group: 'main', - title: 'An error occurred', + title: formatMessage(commonMessages.errorNotificationTitle), text: err.data ? err.data.description : err, type: 'error', }) @@ -186,7 +245,7 @@ async function begin2FASignIn() { } catch (err) { addNotification({ group: 'main', - title: 'An error occurred', + title: formatMessage(commonMessages.errorNotificationTitle), text: err.data ? err.data.description : err, type: 'error', })