chore: Extract product name from translation strings (#4646)

This commit is contained in:
Tom Moor
2023-01-04 19:00:57 -08:00
committed by GitHub
parent f655288f67
commit 445d19f43e
32 changed files with 123 additions and 80 deletions

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
import CopyableCode from "./components/CopyableCode";
@@ -27,7 +28,7 @@ export default class ConfirmUserDeleteEmail extends BaseEmail<Props> {
protected renderAsText({ deleteConfirmationCode }: Props): string {
return `
You requested to permanantly delete your Outline account. Please enter the code below to confirm your account deletion.
You requested to permanantly delete your ${env.APP_NAME} account. Please enter the code below to confirm your account deletion.
Code: ${deleteConfirmationCode}
`;
@@ -41,8 +42,8 @@ Code: ${deleteConfirmationCode}
<Body>
<Heading>Your account deletion request</Heading>
<p>
You requested to permanantly delete your Outline account. Please
enter the code below to confirm your account deletion.
You requested to permanantly delete your {env.APP_NAME} account.
Please enter the code below to confirm your account deletion.
</p>
<EmptySpace height={5} />
<p>

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import { NotificationSetting } from "@server/models";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
@@ -39,7 +40,7 @@ export default class ExportSuccessEmail extends BaseEmail<Props> {
}
protected preview() {
return "Here's your request data export from Outline";
return `Here's your request data export from ${env.APP_NAME}`;
}
protected renderAsText() {

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import { NotificationSetting } from "@server/models";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
@@ -39,7 +40,7 @@ export default class InviteAcceptedEmail extends BaseEmail<Props> {
}
protected subject({ invitedName }: Props) {
return `${invitedName} has joined your Outline team`;
return `${invitedName} has joined your ${env.APP_NAME} team`;
}
protected preview({ invitedName }: Props) {
@@ -50,7 +51,7 @@ export default class InviteAcceptedEmail extends BaseEmail<Props> {
return `
Great news, ${invitedName} just accepted your invitation and has created an account. You can now start collaborating on documents.
Open Outline: ${teamUrl}
Open ${env.APP_NAME}: ${teamUrl}
`;
}
@@ -71,7 +72,7 @@ Open Outline: ${teamUrl}
</p>
<EmptySpace height={10} />
<p>
<Button href={teamUrl}>Open Outline</Button>
<Button href={teamUrl}>Open {env.APP_NAME}</Button>
</p>
</Body>

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
import Button from "./components/Button";
@@ -26,7 +27,7 @@ export default class InviteEmail extends BaseEmail<Props> {
}
protected preview() {
return "Outline is a place for your team to build and share knowledge.";
return `${env.APP_NAME} is a place for your team to build and share knowledge.`;
}
protected renderAsText({
@@ -36,9 +37,9 @@ export default class InviteEmail extends BaseEmail<Props> {
teamUrl,
}: Props): string {
return `
Join ${teamName} on Outline
Join ${teamName} on ${env.APP_NAME}
${actorName} (${actorEmail}) has invited you to join Outline, a place for your team to build and share knowledge.
${actorName} (${actorEmail}) has invited you to join ${env.APP_NAME}, a place for your team to build and share knowledge.
Join now: ${teamUrl}
`;
@@ -50,10 +51,12 @@ Join now: ${teamUrl}
<Header />
<Body>
<Heading>Join {teamName} on Outline</Heading>
<Heading>
Join {teamName} on {env.APP_NAME}
</Heading>
<p>
{actorName} ({actorEmail}) has invited you to join Outline, a place
for your team to build and share knowledge.
{actorName} ({actorEmail}) has invited you to join {env.APP_NAME}, a
place for your team to build and share knowledge.
</p>
<EmptySpace height={10} />
<p>

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
import Button from "./components/Button";
@@ -27,7 +28,7 @@ export default class InviteReminderEmail extends BaseEmail<Props> {
}
protected preview() {
return "Outline is a place for your team to build and share knowledge.";
return `${env.APP_NAME} is a place for your team to build and share knowledge.`;
}
protected renderAsText({
@@ -37,7 +38,7 @@ export default class InviteReminderEmail extends BaseEmail<Props> {
teamUrl,
}: Props): string {
return `
This is just a quick reminder that ${actorName} (${actorEmail}) invited you to join them in the ${teamName} team on Outline, a place for your team to build and share knowledge.
This is just a quick reminder that ${actorName} (${actorEmail}) invited you to join them in the ${teamName} team on ${env.APP_NAME}, a place for your team to build and share knowledge.
We only send a reminder once.
If you haven't signed up yet, you can do so here: ${teamUrl}
@@ -50,11 +51,13 @@ If you haven't signed up yet, you can do so here: ${teamUrl}
<Header />
<Body>
<Heading>Join {teamName} on Outline</Heading>
<Heading>
Join {teamName} on {env.APP_NAME}
</Heading>
<p>
This is just a quick reminder that {actorName} ({actorEmail})
invited you to join them in the {teamName} team on Outline, a place
for your team to build and share knowledge.
invited you to join them in the {teamName} team on {env.APP_NAME}, a
place for your team to build and share knowledge.
</p>
<p>If you haven't signed up yet, you can do so here:</p>
<EmptySpace height={10} />

View File

@@ -27,12 +27,12 @@ export default class SigninEmail extends BaseEmail<Props> {
}
protected preview(): string {
return "Heres your link to signin to Outline.";
return `Heres your link to signin to ${env.APP_NAME}.`;
}
protected renderAsText({ token, teamUrl, client }: Props): string {
return `
Use the link below to signin to Outline:
Use the link below to signin to ${env.APP_NAME}:
${this.signinLink(token, client)}
@@ -52,7 +52,7 @@ signin page at: ${teamUrl}
<Body>
<Heading>Magic Sign-in Link</Heading>
<p>Click the button below to sign in to Outline.</p>
<p>Click the button below to sign in to {env.APP_NAME}.</p>
<EmptySpace height={10} />
<p>
<Button href={this.signinLink(token, client)}>Sign In</Button>

View File

@@ -1,4 +1,5 @@
import * as React from "react";
import env from "@server/env";
import BaseEmail from "./BaseEmail";
import Body from "./components/Body";
import Button from "./components/Button";
@@ -19,18 +20,18 @@ type Props = {
*/
export default class WelcomeEmail extends BaseEmail<Props> {
protected subject() {
return "Welcome to Outline";
return `Welcome to ${env.APP_NAME}`;
}
protected preview() {
return "Outline is a place for your team to build and share knowledge.";
return `${env.APP_NAME} is a place for your team to build and share knowledge.`;
}
protected renderAsText({ teamUrl }: Props) {
return `
Welcome to Outline!
Welcome to ${env.APP_NAME}!
Outline is a place for your team to build and share knowledge.
${env.APP_NAME} is a place for your team to build and share knowledge.
To get started, head to the home screen and try creating a collection to help document your processes, create playbooks, or plan your teams work.
@@ -46,8 +47,11 @@ ${teamUrl}/home
<Header />
<Body>
<Heading>Welcome to Outline!</Heading>
<p>Outline is a place for your team to build and share knowledge.</p>
<Heading>Welcome to {env.APP_NAME}!</Heading>
<p>
{env.APP_NAME} is a place for your team to build and share
knowledge.
</p>
<p>
To get started, head to the home screen and try creating a
collection to help document your processes, create playbooks, or
@@ -60,7 +64,7 @@ ${teamUrl}/home
<EmptySpace height={10} />
<p>
<Button href={`${teamUrl}/home?ref=welcome-email`}>
Open Outline
Open {env.APP_NAME}
</Button>
</p>
</Body>

View File

@@ -37,7 +37,7 @@ export default ({ unsubscribeUrl }: Props) => {
<TR>
<TD style={footerStyle}>
<a href={env.URL} style={linkStyle}>
Outline
{env.APP_NAME}
</a>
<a href={twitterUrl()} style={externalLinkStyle}>
Twitter

View File

@@ -14,7 +14,7 @@ export default () => {
<TD>
<EmptySpace height={40} />
<img
alt="Outline"
alt={env.APP_NAME}
src={
isCloudHosted
? `${url}/email/header-logo.png`

View File

@@ -553,6 +553,11 @@ export class Environment {
@IsOptional()
public AWS_S3_ACL = process.env.AWS_S3_ACL ?? "private";
/**
* The product name
*/
public APP_NAME = "Outline";
private toOptionalString(value: string | undefined) {
return value ? value : undefined;
}

View File

@@ -211,8 +211,7 @@ class Team extends ParanoidModel {
const collection = await Collection.create(
{
name: "Welcome",
description:
"This collection is a quick guide to what Outline is all about. Feel free to delete this collection once your team is up to speed with the basics!",
description: `This collection is a quick guide to what ${env.APP_NAME} is all about. Feel free to delete this collection once your team is up to speed with the basics!`,
teamId: this.id,
createdById: userId,
sort: Collection.DEFAULT_SORT,

View File

@@ -30,6 +30,7 @@ export default function present(
GOOGLE_ANALYTICS_ID: env.GOOGLE_ANALYTICS_ID,
RELEASE:
process.env.SOURCE_COMMIT || process.env.SOURCE_VERSION || undefined,
APP_NAME: env.APP_NAME,
analytics: {
service: analytics?.service,
settings: analytics?.settings,

View File

@@ -62,7 +62,7 @@ export default class SlackProcessor extends BaseProcessor {
"Content-Type": "application/json",
},
body: JSON.stringify({
text: `👋 Hey there! When documents are published or updated in the *${collection.name}* collection on Outline they will be posted to this channel!`,
text: `👋 Hey there! When documents are published or updated in the *${collection.name}* collection on ${env.APP_NAME} they will be posted to this channel!`,
attachments: [
{
color: collection.color,

View File

@@ -230,8 +230,7 @@ router.post("hooks.slack", async (ctx: APIContext) => {
if (!team) {
ctx.body = {
response_type: "ephemeral",
text:
"Sorry, we couldnt find an integration for your team. Head to your Outline settings to set one up.",
text: `Sorry, we couldnt find an integration for your team. Head to your ${env.APP_NAME} settings to set one up.`,
};
return;
}
@@ -293,7 +292,7 @@ router.post("hooks.slack", async (ctx: APIContext) => {
query: text,
results: totalCount,
});
const haventSignedIn = `(It looks like you havent signed in to Outline yet, so results may be limited)`;
const haventSignedIn = `(It looks like you havent signed in to ${env.APP_NAME} yet, so results may be limited)`;
// Map search results to the format expected by the Slack API
if (results.length) {

View File

@@ -64,7 +64,7 @@ export const renderApp = async (
} = {}
) => {
const {
title = "Outline",
title = env.APP_NAME,
description = "A modern team knowledge base for your internal documentation, product specs, support answers, meeting notes, onboarding, &amp; more…",
canonical = "",
} = options;