0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Refactored i18n plaintext email translations to split on newline

refs https://github.com/TryGhost/Ghost/issues/15502

- this makes the translations files a lot nicer because they only
  contain one line per key
This commit is contained in:
Daniel Lockyer 2023-03-16 16:55:22 +01:00 committed by Daniel Lockyer
parent ef538428c9
commit dc0f021b99
3 changed files with 71 additions and 57 deletions

View file

@ -75,89 +75,89 @@ function createApiInstance(config) {
const siteTitle = settingsCache.get('title');
switch (type) {
case 'subscribe':
return t(`
Hey there,
return `
${t(`Hey there,`)}
You're one tap away from subscribing to {{siteTitle}} please confirm your email address with this link:
${t('You\'re one tap away from subscribing to {{siteTitle}} — please confirm your email address with this link:', {siteTitle})}
{{- url}}
${url}
For your security, the link will expire in 24 hours time.
${t('For your security, the link will expire in 24 hours time.')}
All the best!
${t('All the best!')}
---
Sent to {{email}}
If you did not make this request, you can simply delete this message. You will not be subscribed.
`, {url, email, siteTitle});
${t('Sent to {{email}}', {email})}
${t('If you did not make this request, you can simply delete this message.')} ${t('You will not be subscribed.')}
`;
case 'signup':
return t(`
Hey there!
return `
${t(`Hey there,`)}
Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:
${t('Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:', {siteTitle})}
{{- url}}
${url}
For your security, the link will expire in 24 hours time.
${t('For your security, the link will expire in 24 hours time.')}
See you soon!
${t('See you soon!')}
---
Sent to {{email}}
If you did not make this request, you can simply delete this message. You will not be signed up, and no account will be created for you.
`, {url, email, siteTitle});
${t('Sent to {{email}}', {email})}
${t('If you did not make this request, you can simply delete this message.')} ${t('You will not be signed up, and no account will be created for you.')}
`;
case 'signup-paid':
return t(`
Hey there!
return `
${t(`Hey there,`)}
Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:
${t('Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:', {siteTitle})}
{{- url}}
${url}
For your security, the link will expire in 24 hours time.
${t('For your security, the link will expire in 24 hours time.')}
See you soon!
${t('See you soon!')}
---
Sent to {{email}}
Thank you for subscribing to {{siteTitle}}!
`, {url, email, siteTitle});
${t('Sent to {{email}}', {email})}
${t('Thank you for subscribing to {{siteTitle}}!', {siteTitle})}
`;
case 'updateEmail':
return t(`
Hey there,
return `
${t(`Hey there,`)}
Please confirm your email address with this link:
${t('Please confirm your email address with this link:')}
{{- url}}
${url}
For your security, the link will expire in 24 hours time.
${t('For your security, the link will expire in 24 hours time.')}
---
---
Sent to {{email}}
If you did not make this request, you can simply delete this message. This email address will not be used.
`, {url, email});
${t('Sent to {{email}}', {email})}
${t('If you did not make this request, you can simply delete this message.')} ${t('This email address will not be used.')}
`;
case 'signin':
default:
return t(`
Hey there,
return `
${t(`Hey there,`)}
Welcome back! Use this link to securely sign in to your {{siteTitle}} account:
${t('Welcome back! Use this link to securely sign in to your {{siteTitle}} account:', {siteTitle})}
{{- url}}
${url}
For your security, the link will expire in 24 hours time.
${t('For your security, the link will expire in 24 hours time.')}
See you soon!
${t('See you soon!')}
---
Sent to {{email}}
If you did not make this request, you can safely ignore this email.
`, {url, email, siteTitle});
${t('Sent to {{email}}', {email})}
${t('If you did not make this request, you can safely ignore this email.')}
`;
}
},
getHTML(url, type, email) {

View file

@ -1,19 +1,26 @@
{
"\n Hey there,\n\n Please confirm your email address with this link:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. This email address will not be used.\n ": "",
"\n Hey there,\n\n Welcome back! Use this link to securely sign in to your {{siteTitle}} account:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can safely ignore this email.\n ": "",
"\n Hey there,\n\n You're one tap away from subscribing to {{siteTitle}} — please confirm your email address with this link:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n All the best!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. You will not be subscribed.\n ": "",
"\n Hey there!\n\n Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. You will not be signed up, and no account will be created for you.\n ": "",
"\n Hey there!\n\n Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n Thank you for subscribing to {{siteTitle}}!\n ": "",
"📫 Confirm your email update for {{siteTitle}}!": "",
"📫 Confirm your subscription to {{siteTitle}}": "",
"🔑 Secure sign in link for {{siteTitle}}": "",
"🙌 Complete your sign up to {{siteTitle}}!": "",
"🙌 Thank you for signing up to {{siteTitle}}!": "",
"All the best!": "",
"For your security, the link will expire in 24 hours time.": "",
"Hey there,": "",
"If you did not make this request, you can safely ignore this email.": "",
"If you did not make this request, you can simply delete this message.": "",
"Please confirm your email address with this link:": "",
"See you soon!": "",
"Sent to {{email}}": "",
"Sign in to {{siteTitle}}": "",
"Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:": "",
"Thank you for subscribing to {{siteTitle}}!": "",
"Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:": "",
"This email address will not be used.": "",
"Welcome back to {{siteTitle}}!": "",
"Welcome back! Use this link to securely sign in to your {{siteTitle}} account:": "",
"You can also copy & paste this URL into your browser:": ""
"You can also copy & paste this URL into your browser:": "",
"You will not be signed up, and no account will be created for you.": "",
"You will not be subscribed.": "",
"You're one tap away from subscribing to {{siteTitle}} — please confirm your email address with this link:": ""
}

View file

@ -1,19 +1,26 @@
{
"\n Hey there,\n\n Please confirm your email address with this link:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. This email address will not be used.\n ": "",
"\n Hey there,\n\n Welcome back! Use this link to securely sign in to your {{siteTitle}} account:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can safely ignore this email.\n ": "",
"\n Hey there,\n\n You're one tap away from subscribing to {{siteTitle}} — please confirm your email address with this link:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n All the best!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. You will not be subscribed.\n ": "",
"\n Hey there!\n\n Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n If you did not make this request, you can simply delete this message. You will not be signed up, and no account will be created for you.\n ": "",
"\n Hey there!\n\n Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:\n\n {{url}}\n\n For your security, the link will expire in 24 hours time.\n\n See you soon!\n\n ---\n\n Sent to {{email}}\n Thank you for subscribing to {{siteTitle}}!\n ": "",
"📫 Confirm your email update for {{siteTitle}}!": "",
"📫 Confirm your subscription to {{siteTitle}}": "",
"🔑 Secure sign in link for {{siteTitle}}": "",
"🙌 Complete your sign up to {{siteTitle}}!": "",
"🙌 Thank you for signing up to {{siteTitle}}!": "",
"All the best!": "",
"For your security, the link will expire in 24 hours time.": "",
"Hey there,": "",
"If you did not make this request, you can safely ignore this email.": "",
"If you did not make this request, you can simply delete this message.": "",
"Please confirm your email address with this link:": "",
"See you soon!": "",
"Sent to {{email}}": "",
"Sign in to {{siteTitle}}": "",
"Tap the link below to complete the signup process for {{siteTitle}}, and be automatically signed in:": "",
"Thank you for subscribing to {{siteTitle}}!": "",
"Thank you for subscribing to {{siteTitle}}. Tap the link below to be automatically signed in:": "",
"This email address will not be used.": "",
"Welcome back to {{siteTitle}}!": "",
"Welcome back! Use this link to securely sign in to your {{siteTitle}} account:": "",
"You can also copy & paste this URL into your browser:": ""
"You can also copy & paste this URL into your browser:": "",
"You will not be signed up, and no account will be created for you.": "",
"You will not be subscribed.": "",
"You're one tap away from subscribing to {{siteTitle}} — please confirm your email address with this link:": ""
}