-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
We have a bunch of places in our codebase where we want to define a multi-line string that will be translated.
I want to do something like the following. Note that it's indented because it's part of a function.
// eslint-disable-next-line formatjs/enforce-id
md: t(
{
defaultMessage: dedent`
Here is a multiline email body.
Here is another line.
`,
id: "email.body",
}
),
I would like this to produce the string: Here is a multiline email body.\n\nHere is another line.
but the FormatJS CLI doesn't support parsing this template string because it's tagged with dedent
.
Are you open to having a native way of dedented strings in FormatJS?
Right now I think the alternatives are to:
- have weird spacing like below
- use a bunch of strings concated together which makes editing the strings pretty annoying
// eslint-disable-next-line formatjs/enforce-id
md: t(
{
defaultMessage: `Here is a multiline email body.
Here is another line.`,
id: "email.body",
}
),
Btw we love FormatJS, thank you! I wrote this blog post about how we use it.
Metadata
Metadata
Assignees
Labels
No labels