Skip to content

Commit ad646a4

Browse files
authored
feat: add mjml bucket (#1628)
* feat: add mjml bucket * fix(mjml): content extraction to prevent duplication * chore: mjml examples * chore: add changeset * chore: add missing i18n.lock for mjml demo - Add i18n.lock file for mjml demo bucket to pass tests * chore: clean up i18n.json * chore: clean up code * chore: refactor code
1 parent c9ca78d commit ad646a4

File tree

11 files changed

+1696
-782
lines changed

11 files changed

+1696
-782
lines changed

.changeset/selfish-kings-think.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@lingo.dev/_spec": patch
3+
"lingo.dev": patch
4+
---
5+
6+
Add MJML bucket support
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mjml>
3+
<mj-head>
4+
<mj-title>Welcome to Our Service</mj-title>
5+
<mj-preview>Get started with your new account today</mj-preview>
6+
<mj-attributes>
7+
<mj-all font-family="Arial, sans-serif" />
8+
</mj-attributes>
9+
</mj-head>
10+
<mj-body>
11+
<mj-section background-color="#f0f0f0">
12+
<mj-column>
13+
<mj-image
14+
src="https://example.com/logo.png"
15+
alt="Company Logo"
16+
width="150px"
17+
/>
18+
</mj-column>
19+
</mj-section>
20+
21+
<mj-section background-color="#ffffff" padding="20px">
22+
<mj-column>
23+
<mj-text font-size="24px" color="#333333" font-weight="bold">
24+
Welcome to Our Platform!
25+
</mj-text>
26+
<mj-text font-size="16px" color="#555555" line-height="24px">
27+
Thank you for signing up. We're excited to have you on board.
28+
</mj-text>
29+
<mj-text font-size="16px" color="#555555" line-height="24px">
30+
To get started, please verify your email address by clicking the
31+
button below.
32+
</mj-text>
33+
</mj-column>
34+
</mj-section>
35+
36+
<mj-section background-color="#ffffff" padding="20px">
37+
<mj-column>
38+
<mj-button
39+
background-color="#007bff"
40+
color="#ffffff"
41+
href="https://example.com/verify"
42+
title="Verify your email address"
43+
aria-label="Verify email"
44+
>
45+
Verify Email Address!
46+
</mj-button>
47+
</mj-column>
48+
</mj-section>
49+
50+
<mj-section background-color="#ffffff" padding="20px">
51+
<mj-column>
52+
<mj-text font-size="14px" color="#666666">
53+
If you didn't create an account, you can safely ignore this email.
54+
</mj-text>
55+
<mj-text font-size="14px" color="#666666">
56+
Need help? Contact our support team.
57+
</mj-text>
58+
</mj-column>
59+
</mj-section>
60+
61+
<mj-section background-color="#f8f9fa" padding="20px">
62+
<mj-column>
63+
<mj-social mode="horizontal">
64+
<mj-social-element
65+
name="facebook"
66+
href="https://facebook.com/example"
67+
title="Follow us on Facebook"
68+
alt="Facebook"
69+
/>
70+
<mj-social-element
71+
name="twitter"
72+
href="https://twitter.com/example"
73+
title="Follow us on Twitter"
74+
alt="Twitter"
75+
/>
76+
<mj-social-element
77+
name="instagram"
78+
href="https://instagram.com/example"
79+
title="Follow us on Instagram"
80+
alt="Instagram"
81+
/>
82+
</mj-social>
83+
<mj-text font-size="12px" color="#999999" align="center">
84+
© 2024 Example Company. All rights reserved.
85+
</mj-text>
86+
</mj-column>
87+
</mj-section>
88+
</mj-body>
89+
</mjml>
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<mjml>
3+
<mj-head>
4+
<mj-title>Bienvenido a nuestro servicio</mj-title>
5+
<mj-preview>Comienza con tu nueva cuenta hoy</mj-preview>
6+
<mj-attributes>
7+
<mj-all font-family="Arial, sans-serif" />
8+
</mj-attributes>
9+
</mj-head>
10+
<mj-body>
11+
<mj-section background-color="#f0f0f0">
12+
<mj-column>
13+
<mj-image
14+
src="https://example.com/logo.png"
15+
alt="Logo de la empresa"
16+
width="150px"
17+
/>
18+
</mj-column>
19+
</mj-section>
20+
21+
<mj-section background-color="#ffffff" padding="20px">
22+
<mj-column>
23+
<mj-text font-size="24px" color="#333333" font-weight="bold">
24+
¡Bienvenido a nuestra plataforma!
25+
</mj-text>
26+
<mj-text font-size="16px" color="#555555" line-height="24px">
27+
Gracias por registrarte. Estamos encantados de tenerte con nosotros.
28+
</mj-text>
29+
<mj-text font-size="16px" color="#555555" line-height="24px">
30+
Para comenzar, por favor verifica tu dirección de correo electrónico
31+
haciendo clic en el botón de abajo.
32+
</mj-text>
33+
</mj-column>
34+
</mj-section>
35+
36+
<mj-section background-color="#ffffff" padding="20px">
37+
<mj-column>
38+
<mj-button
39+
background-color="#007bff"
40+
color="#ffffff"
41+
href="https://example.com/verify"
42+
title="Verifica tu dirección de correo electrónico"
43+
aria-label="Verificar correo"
44+
>
45+
¡Verificar dirección de correo!
46+
</mj-button>
47+
</mj-column>
48+
</mj-section>
49+
50+
<mj-section background-color="#ffffff" padding="20px">
51+
<mj-column>
52+
<mj-text font-size="14px" color="#666666">
53+
Si no creaste una cuenta, puedes ignorar este correo electrónico.
54+
</mj-text>
55+
<mj-text font-size="14px" color="#666666">
56+
¿Necesitas ayuda? Contacta a nuestro equipo de soporte.
57+
</mj-text>
58+
</mj-column>
59+
</mj-section>
60+
61+
<mj-section background-color="#f8f9fa" padding="20px">
62+
<mj-column>
63+
<mj-social mode="horizontal">
64+
<mj-social-element
65+
name="facebook"
66+
href="https://facebook.com/example"
67+
title="Síguenos en Facebook"
68+
alt="Facebook"
69+
/>
70+
<mj-social-element
71+
name="twitter"
72+
href="https://twitter.com/example"
73+
title="Síguenos en Twitter"
74+
alt="Twitter"
75+
/>
76+
<mj-social-element
77+
name="instagram"
78+
href="https://instagram.com/example"
79+
title="Síguenos en Instagram"
80+
alt="Instagram"
81+
/>
82+
</mj-social>
83+
<mj-text font-size="12px" color="#999999" align="center">
84+
© 2024 Example Company. Todos los derechos reservados.
85+
</mj-text>
86+
</mj-column>
87+
</mj-section>
88+
</mj-body>
89+
</mjml>

packages/cli/demo/mjml/i18n.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": "1.10",
3+
"locale": {
4+
"source": "en",
5+
"targets": ["es"]
6+
},
7+
"buckets": {
8+
"mjml": {
9+
"include": ["./[locale]/example.mjml"]
10+
}
11+
},
12+
"$schema": "https://lingo.dev/schema/i18n.json"
13+
}

packages/cli/demo/mjml/i18n.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
version: 1
2+
checksums:
3+
c1acde0589961652d4caf8a39d080857:
4+
mjml/mj-head/0/mj-title/0: c514a686b50f7158b2dd08ea65d3bc8a
5+
mjml/mj-head/0/mj-preview/0: 4ce14f6062c814cbdcdf8b0a3cb094d3
6+
mjml/mj-body/0/mj-section/0/mj-column/0/mj-image/0#alt: 82d5c0d5994508210ee02d684819f4b8
7+
mjml/mj-body/0/mj-section/1/mj-column/0/mj-text/0: b320b02942617a70dcbd1beac61da11a
8+
mjml/mj-body/0/mj-section/1/mj-column/0/mj-text/1: 028311348a5aeefea365fdf422a3fb21
9+
mjml/mj-body/0/mj-section/1/mj-column/0/mj-text/2: 0dfdc9b80ee70fcc2b28d0e81e03fabc
10+
mjml/mj-body/0/mj-section/2/mj-column/0/mj-button/0#title: 5c96f738bd6153ee07b72094cdfd2b98
11+
mjml/mj-body/0/mj-section/2/mj-column/0/mj-button/0#aria-label: 42dcab68d931f9145d9b6d76740a5c66
12+
mjml/mj-body/0/mj-section/2/mj-column/0/mj-button/0: dc8001d5c58294d22fe0b0e6118dbfb7
13+
mjml/mj-body/0/mj-section/3/mj-column/0/mj-text/0: a18f14ab69467cbdbe467df6255cfda7
14+
mjml/mj-body/0/mj-section/3/mj-column/0/mj-text/1: e83236e98aad1937bc99a47cff159caa
15+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/0#title: 180bd8aa700f6cedf65e0a2079503cea
16+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/0#alt: ac8afe226a7424849c247e6a9d566f64
17+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/1#title: ea4c2a7a9a60cbb0f8f9632222a46abe
18+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/1#alt: ba3d4aed69a50759b53a0b7c319a3ad9
19+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/2#title: 754efa5f98f51c510ff268e217877d8b
20+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-social/0/mj-social-element/2#alt: c9555810826c30d571ffae869a236494
21+
mjml/mj-body/0/mj-section/4/mj-column/0/mj-text/0: 9ac6c625c7af33d70634846c8c9d11b0

packages/cli/i18n.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
"lockedKeys": ["meta/locked_key_1"],
5252
"ignoredKeys": ["meta/ignored_key_1"]
5353
},
54+
"mjml": {
55+
"include": ["demo/mjml/[locale]/*.mjml"]
56+
},
5457
"po": {
5558
"include": ["demo/po/[locale]/*.po"]
5659
},

0 commit comments

Comments
 (0)