Files
owl/tests/compiler/__snapshots__/translation.test.ts.snap
T
2022-07-06 12:07:20 +02:00

96 lines
2.3 KiB
Plaintext

// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`translation support can set and remove translatable attributes 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<div tomato=\\"word\\" potato=\\"mot\\" title=\\"mot\\" label=\\"word\\">text</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = block3();
const b4 = text(\`
\`);
return multi([b2, b3, b4]);
}
}"
`;
exports[`translation support can translate node content 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div>mot</div>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`translation support does not translate node content if disabled 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<div>
<span>mot</span>
<span>word</span>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = block3();
const b4 = text(\`
\`);
return multi([b2, b3, b4]);
}
}"
`;
exports[`translation support some attributes are translated 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<div>
<p label=\\"mot\\">mot</p>
<p title=\\"mot\\">mot</p>
<p placeholder=\\"mot\\">mot</p>
<p alt=\\"mot\\">mot</p>
<p something=\\"word\\">mot</p>
</div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = block3();
const b4 = text(\`
\`);
return multi([b2, b3, b4]);
}
}"
`;
exports[`translation support translation is done on the trimmed text, with extra spaces readded after 1`] = `
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block3 = createBlock(\`<div> mot </div>\`);
return function template(ctx, node, key = \\"\\") {
const b2 = text(\`
\`);
const b3 = block3();
const b4 = text(\`
\`);
return multi([b2, b3, b4]);
}
}"
`;