feat(SW-706): add Lokalise tooling and codemod
This commit is contained in:
27
apps/scandic-web/codemods/lokalise/output.tsx
Normal file
27
apps/scandic-web/codemods/lokalise/output.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
/* eslint-disable formatjs/enforce-description */
|
||||
/* eslint-disable formatjs/enforce-default-message */
|
||||
/* eslint-disable formatjs/no-id */
|
||||
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
export default async function ServerComponentWithIntl() {
|
||||
const intl = await getIntl()
|
||||
const variable = "some value"
|
||||
|
||||
return (
|
||||
<h1>
|
||||
{true
|
||||
? intl.formatMessage({
|
||||
defaultMessage: "Some string",
|
||||
description: {},
|
||||
})
|
||||
: intl.formatMessage(
|
||||
{
|
||||
defaultMessage: `Other string {variable}`,
|
||||
description: {},
|
||||
},
|
||||
{ variable: variable }
|
||||
)}
|
||||
</h1>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user