Skip to content

Commit 7121f60

Browse files
committed
chore: add twig demo
1 parent a495c1e commit 7121f60

File tree

6 files changed

+174
-0
lines changed

6 files changed

+174
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{% set user = app.user %}
2+
<!DOCTYPE html>
3+
<html>
4+
<head>
5+
<meta name="description" content="Welcome to our application">
6+
<title>Welcome</title>
7+
</head>
8+
<body>
9+
<header>
10+
<nav>
11+
<a href="/" title="Go to homepage">Home</a>
12+
<a href="/about" title="Learn more about us">About</a>
13+
<a href="/contact" title="Get in touch">Contact</a>
14+
</nav>
15+
</header>
16+
17+
<main>
18+
<section class="hero">
19+
<h1>Welcome to Our Platform</h1>
20+
<p>Hello <strong>{{ user.name }}</strong>, we're glad to have you here!</p>
21+
<p>Start exploring our features and discover what makes us <em>unique</em>.</p>
22+
</section>
23+
24+
{% if user.isPremium %}
25+
<section class="premium-benefits">
26+
<h2>Premium Benefits</h2>
27+
<ul>
28+
<li>Unlimited access to all features</li>
29+
<li>Priority customer support</li>
30+
<li>Advanced analytics and reporting</li>
31+
</ul>
32+
</section>
33+
{% endif %}
34+
35+
<section class="getting-started">
36+
<h2>Getting Started</h2>
37+
<p>Follow these simple steps to begin your journey:</p>
38+
<ol>
39+
<li>Complete your profile</li>
40+
<li>Explore the dashboard</li>
41+
<li>Invite your team members</li>
42+
</ol>
43+
44+
<form action="/profile/update" method="post">
45+
<label for="bio">Tell us about yourself:</label>
46+
<textarea id="bio" name="bio" placeholder="Enter your bio here" aria-label="User biography"></textarea>
47+
48+
<label for="email">Email address:</label>
49+
<input type="email" id="email" name="email" placeholder="your@email.com" aria-label="Email address">
50+
51+
<button type="submit" title="Save your profile changes">Save Profile</button>
52+
</form>
53+
</section>
54+
55+
{# This section is for internal notes and won't be displayed #}
56+
{% if app.debug %}
57+
<section class="debug-info">
58+
<h3>Debug Information</h3>
59+
<p>User ID: {{ user.id }}</p>
60+
<p>Last login: {{ user.lastLogin|date('Y-m-d H:i:s') }}</p>
61+
</section>
62+
{% endif %}
63+
</main>
64+
65+
<footer>
66+
<p>Need help? <a href="/support" title="Visit our support center">Contact Support</a></p>
67+
<p>&copy; {{ "now"|date('Y') }} Our Company. All rights reserved.</p>
68+
</footer>
69+
</body>
70+
</html>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{% set user = app.user %}
2+
<!DOCTYPE html>
3+
<html lang="es">
4+
<head>
5+
<meta name="description" content="Bienvenido a nuestra aplicación">
6+
<title>Bienvenido</title>
7+
</head>
8+
<body>
9+
<header>
10+
<nav><a href="/" title="Ir a la página de inicio">Inicio</a>
11+
<a href="/about" title="Conoce más sobre nosotros">Acerca de</a>
12+
<a href="/contact" title="Ponte en contacto">Contacto</a></nav>
13+
</header>
14+
15+
<main>
16+
<section class="hero">
17+
<h1>Bienvenido a nuestra plataforma</h1>
18+
<p>Hola <strong>{{ user.name }}</strong>, nos alegra tenerte aquí!</p>
19+
<p>Comienza a explorar nuestras funciones y descubre lo que nos hace <em>únicos</em>.</p>
20+
</section>
21+
22+
{% if user.isPremium %}
23+
<section class="premium-benefits">
24+
<h2>Beneficios premium</h2>
25+
<ul>
26+
<li>Acceso ilimitado a todas las funciones</li>
27+
<li>Soporte prioritario al cliente</li>
28+
<li>Análisis y reportes avanzados</li>
29+
</ul>
30+
</section>
31+
{% endif %}
32+
33+
<section class="getting-started">
34+
<h2>Primeros pasos</h2>
35+
<p>Sigue estos sencillos pasos para comenzar tu experiencia:</p>
36+
<ol>
37+
<li>Completa tu perfil</li>
38+
<li>Explora el panel de control</li>
39+
<li>Invita a los miembros de tu equipo</li>
40+
</ol>
41+
42+
<form action="/profile/update" method="post"><label for="bio">Cuéntanos sobre ti:</label>
43+
<textarea id="bio" name="bio" placeholder="Ingresa tu biografía aquí" aria-label="Biografía del usuario"></textarea>
44+
45+
<label for="email">Dirección de correo electrónico:</label>
46+
<input type="email" id="email" name="email" placeholder="tu@email.com" aria-label="Dirección de correo electrónico">
47+
48+
<button type="submit" title="Guardar los cambios de tu perfil">Guardar perfil</button></form>
49+
</section>
50+
51+
{# This section is for internal notes and won't be displayed #}
52+
{% if app.debug %}
53+
<section class="debug-info">
54+
<h3>Información de depuración</h3>
55+
<p>ID de usuario: {{ user.id }}</p>
56+
<p>Último inicio de sesión: {{ user.lastLogin|date('Y-m-d H:i:s') }}</p>
57+
</section>
58+
{% endif %}
59+
</main>
60+
61+
<footer>
62+
<p>¿Necesitas ayuda? <a href="/support" title="Visita nuestro centro de soporte">Contacta con soporte</a></p>
63+
<p>© {{ "now"|date('Y') }} Nuestra empresa. Todos los derechos reservados.</p>
64+
</footer>
65+
</body>
66+
</html>

packages/cli/demo/twig/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", "ru"]
6+
},
7+
"buckets": {
8+
"twig": {
9+
"include": ["./[locale]/*.twig"]
10+
}
11+
},
12+
"$schema": "https://lingo.dev/schema/i18n.json"
13+
}

packages/cli/demo/twig/i18n.lock

Whitespace-only changes.

packages/cli/i18n.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@
7171
"lockedKeys": ["forms/locked_key_1"],
7272
"ignoredKeys": ["forms/ignored_key_1"]
7373
},
74+
"twig": {
75+
"include": ["demo/twig/[locale]/*.twig"]
76+
},
7477
"vtt": {
7578
"include": ["demo/vtt/[locale]/*.vtt"]
7679
},

packages/cli/i18n.lock

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,3 +666,25 @@ checksums:
666666
button/cancel: 2e2a849c2223911717de8caa2c71bade
667667
messages/0: 97a8db12c3955a85c4f50e3951c91a40
668668
messages/1: 986a434e3895c8ee0b267df95cc40051
669+
21f72852c50ba239e04a475d93f91691:
670+
head/0#content: 1308168cca4fa5d8d7a0cf24e55e93fc
671+
head/1: 3180ad6b8de344b781637750259e0f53
672+
body/0/0: 9de5fe40cbf5f851a6d2270f01fe0739
673+
body/1/0/0: c59070fe496d5e4bd0066295b63a9056
674+
body/1/0/1: 12d74865332bf1988d51e84ba67aae09
675+
body/1/0/2: 58f0e438e665c77eedc440c5a8529b1a
676+
body/1/1/0: 119e3aa396d12a5a1aa7058e0983f9b9
677+
body/1/1/1/0: 60f9a22f4200bb4620a6ff7a1797ec30
678+
body/1/1/1/1: 03846a81f16f5e4a11acfd9445ad497d
679+
body/1/1/1/2: 15aae9d70ff1fb682f7d86baca81dcc0
680+
body/1/2/0: fbd403146395526d68ac68d142a50e21
681+
body/1/2/1: da8dc7fe06175d8b805f7f565bfe2788
682+
body/1/2/2/0: 061e1acc1b9ebad9de09fd5626e813c7
683+
body/1/2/2/1: 67f022a3f9e278d065a063b5e29dd932
684+
body/1/2/2/2: 7e23f048179f6661050edaa796528fe0
685+
body/1/2/3: 635f7e9a4afc00de34f975914afbb8b8
686+
body/1/3/0: 7a7892379e31868abba9865d20be2b72
687+
body/1/3/1: 8740df822561d74d51bb30e4b39d6193
688+
body/1/3/2: 0429f12258fabbde3abaca3dd9986178
689+
body/2/0: d32e57e4a5a65f3bee8b63dcb2bfa8e7
690+
body/2/1: 7e10a8ab9cc4e6d603b3cdc48849688f

0 commit comments

Comments
 (0)