stoat-for-desktop/js-lingui-solid/packages/babel-plugin-lingui-macro/test/__snapshots__/jsx-plural.test.ts.snap

264 lines
4.8 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`#1 1`] = `
import { Plural } from "@lingui/react/macro";
<Plural
value={count}
offset="1"
_0="Zero items"
few={\`\${count} items\`}
other={<a href="/more">A lot of them</a>}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "tYX0sm",
message:
"{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them</0>}}",
values: {
count: count,
},
components: {
0: <a href="/more" />,
},
}
}
/>;
`;
exports[`#4 1`] = `
import { Trans, Plural } from "@lingui/react/macro";
<Plural
value={count}
one={
<Trans>
<strong>#</strong> slot added
</Trans>
}
other={
<Trans>
<strong>#</strong> slots added
</Trans>
}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "X8eyr1",
message:
"{count, plural, one {<0>#</0> slot added} other {<1>#</1> slots added}}",
values: {
count: count,
},
components: {
0: <strong />,
1: <strong />,
},
}
}
/>;
`;
exports[`#6 1`] = `
import { Plural } from "@lingui/react/macro";
<Plural
id="msg.plural"
render="strong"
value={count}
offset="1"
_0="Zero items"
few={\`\${count} items\`}
other={<a href="/more">A lot of them</a>}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
render="strong"
{
/*i18n*/
...{
id: "msg.plural",
message:
"{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them</0>}}",
values: {
count: count,
},
components: {
0: <a href="/more" />,
},
}
}
/>;
`;
exports[`#7 1`] = `
import { Trans, Plural } from "@lingui/react/macro";
<Trans id="inner-id-removed">
Looking for{" "}
<Plural
value={items.length}
offset={1}
_0="zero items"
few={\`\${items.length} items \${42}\`}
other={<a href="/more">a lot of them</a>}
/>
</Trans>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "inner-id-removed",
message:
"Looking for {0, plural, offset:1 =0 {zero items} few {{1} items {2}} other {<0>a lot of them</0>}}",
values: {
0: items.length,
1: items.length,
2: 42,
},
components: {
0: <a href="/more" />,
},
}
}
/>;
`;
exports[`#8 1`] = `
import { Plural } from "@lingui/react/macro";
<Plural
value={count}
_0="Zero items"
one={oneText}
other={<a href="/more">A lot of them</a>}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "EQvNfC",
message:
"{count, plural, =0 {Zero items} one {{oneText}} other {<0>A lot of them</0>}}",
values: {
count: count,
oneText: oneText,
},
components: {
0: <a href="/more" />,
},
}
}
/>;
`;
exports[`Plural macro could be renamed 1`] = `
import { Plural as Plural2 } from "@lingui/react/macro";
<Plural2 value={count} one={"..."} other={"..."} />;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "EMgKyP",
message: "{count, plural, one {...} other {...}}",
values: {
count: count,
},
}
}
/>;
`;
exports[`Should preserve reserved props: \`comment\`, \`context\`, \`render\`, \`id\` 1`] = `
import { Plural } from "@lingui/react/macro";
<Plural
comment="Comment for translator"
context="translation context"
id="custom.id"
render={() => {}}
value={count}
offset="1"
_0="Zero items"
few={\`\${count} items\`}
other={<a href="/more">A lot of them</a>}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
render={() => {}}
{
/*i18n*/
...{
id: "custom.id",
message:
"{count, plural, offset:1 =0 {Zero items} few {{count} items} other {<0>A lot of them</0>}}",
comment: "Comment for translator",
context: "translation context",
values: {
count: count,
},
components: {
0: <a href="/more" />,
},
}
}
/>;
`;
exports[`Should return cases without leading or trailing spaces for nested Trans inside Plural 1`] = `
import { Trans, Plural } from "@lingui/react/macro";
<Plural
one={<Trans>One hello</Trans>}
other={<Trans>Other hello</Trans>}
value={count}
/>;
↓ ↓ ↓ ↓ ↓ ↓
import { Trans as _Trans } from "@lingui/react";
<_Trans
{
/*i18n*/
...{
id: "oukcm6",
message: "{count, plural, one {One hello} other {Other hello}}",
values: {
count: count,
},
}
}
/>;
`;