Skip to content

Commit

Permalink
working on translation + small fixes (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucanis authored Aug 21, 2024
1 parent dbf19e3 commit b41461f
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 62 deletions.
7 changes: 3 additions & 4 deletions base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>

{% block meta %}{% endblock %}
<title>
{% block title %}Welcome!
{% endblock %}
{% block title %}Welcome!{% endblock %}
</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
{% block stylesheets %}
Expand All @@ -16,7 +15,7 @@
{{ encore_entry_script_tags('app') }}
{% endblock %}
</head>
<body>
<body class="no-js">
{% block header %}
{% include '@components/Layout/Header/Header.twig' %}
{% endblock %}
Expand Down
1 change: 1 addition & 0 deletions components/Layout/CrossSelling/CrossSelling.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {

const standardProduct = {
productTitle: 'Nom du produit',
productLink: '#',
secondaryTitle: 'Titre secondaire',
price: '1000,00€',
promoPrice: '900,00€',
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/Header/Header.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{% endif %}

<div class='flex items-center self-center h-full'>
<div class='Header-logo'>{{ svg('thelia') }}</div>
<a href="/" class='Header-logo'>{{ svg('thelia') }}</a>
</div>
</div>

Expand Down
6 changes: 4 additions & 2 deletions components/Organisms/ProductCard/ProductCard.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{% set classes = classes|default('') %}
{% set productTitle = productTitle|default('') %}
{% set productLink = productLink|default('#') %}
{% set orderSecondaryTitle = orderSecondaryTitle|default('') %}
{% set price = price|default('') %}
{% set promoPrice = promoPrice|default('') %}
Expand Down Expand Up @@ -27,6 +28,7 @@
{% set img = img|default({url: '@assets/images/placeholder2.webp', alt:''}) %}
{% set quantityChoice = quantityChoice|default(1) %}


<div class="ProductCard {{ classes }}">
{% if isAddToCartConfirmation or isRemoveProduct %}
<span class='ProductCard-iconClose'>{{ svg("close") }}</span>
Expand Down Expand Up @@ -58,14 +60,14 @@
</p>
{% endif %}
<div class="ProductCard-mainContent">
<a class="ProductCard-imgLink" href="#">
<a class="ProductCard-imgLink" href="{{productLink}}">
<figure class="ProductCard-img">
<img src="{{ img.url }}" alt="{{ img.alt }}" title="{{ img.alt }}" loading="lazy">
</figure>
</a>
<div class="ProductCard-desc">
{% if not isRemoveProduct %}
<a href="#" class="ProductCard-title">{{ productTitle }}</a>
<a href="{{productLink}}" class="ProductCard-title">{{ productTitle }}</a>
{% endif %}
{% if secondaryTitle %}
<div class="ProductCard-subTitle paragraph-3">{{ secondaryTitle }}</div>
Expand Down
73 changes: 39 additions & 34 deletions index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{% set productFiltered = products|map((p) => ({
displayWishButton: true,
productTitle: p.i18ns.title,
productLink: p.publicUrl,
secondaryTitle: p.i18ns.chapo ?? null,
price: p.productSaleElements|filter(pse => pse.isDefault)|first.productPrices|first.price ~ '',
promoPrice: p.productSaleElements|filter(pse => pse.isDefault)|first.productPrices|first.promoPrice ~ '',
Expand All @@ -22,50 +23,54 @@
img: {url: '/legacy-image-library/product_image_'~p.id~'/full/%5E*!386,280/0/default.webp', alt: p.i18ns.title}
})) %}

{% set blocks = [
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
},
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
},
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
}
] %}
{%
set blocks = [
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
},
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
},
{
"image": asset("dist/images/placeholder.webp"),
alt: "Image desc",
"title": "Ici une phrase d’accroche pour accompagner le visuel",
"href": "#",
"linkLabel": "Je découvre"
}
]
%}

{% include '@components/Layout/Hero/Hero.twig' with { blocks: blocks } %}
{% include '@components/Layout/Hero/Hero.twig' with { blocks: blocks } %}

{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Derniers produits consultés', products:productFiltered} %}
{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Last seen products'|trans , products:productFiltered} %}


<div class="bg-theme-lighter">
{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Produits populaires', products:productFiltered} %}
{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Popular products'|trans, products:productFiltered} %}
</div>
<div class="bg-theme-lightest">
{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Promotions', products:productFiltered} %}
{% include '@components/Layout/CrossSelling/CrossSelling.twig' with {title: 'Promotions'|trans, products:productFiltered} %}
</div>

{% include '@components/Layout/ProductCategory/ProductCategory.twig' with {title: 'Nos catégories de produits', categories:categoriesFiltered} %}
{% include '@components/Layout/ProductCategory/ProductCategory.twig' with {title: t('Nos catégories de produits'), categories:categoriesFiltered} %}

{% set reviews = [4,2,3]|map((note) => ({
author: 'Prénom N.',
review:"“Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.”",
note:note,
date: 'JJ/MM/AAAA'
})) %}
{%
set reviews = [4,2,3]|map((note) => ({
author: 'Prénom N.',
review:"“Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.”",
note:note,
date: 'JJ/MM/AAAA'
}))
%}

<div class="bg-theme-lightest">
{% include '@components/Layout/Review/Review.twig' with {title: 'Nos clients parlent de nous', reviews:reviews, button:{label:"Voir tous les avis", href:"#"}} %}
Expand Down
9 changes: 5 additions & 4 deletions product.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
{% block body %}
<div class="px-6 lg:px-[120px] py-6">
<div class="lg:justify-between lg:items-center mb-[29px] lg:flex">
<a href="#" class="typo-button-medium flex gap-3"><span class="h-5 w-5">{{ svg('chevron-left')}}</span> {{ productCategory.i18ns.title }}</a>
<a href="#" class="flex gap-3 typo-button-medium"><span class="w-5 h-5">{{ svg('chevron-left')}}</span> {{ productCategory.i18ns.title }}</a>

</div>

<div class="lg:container lg:w-full md:w-[540px] w-full mx-auto">
<section class="lg:flex lg:justify-between gap-[46px]">
<div class="flex relative">
<div class="-translate-x-full absolute top-0 left-0 lg:translate-x-0 lg:static md:block hidden">
<div class="relative flex">
<div class="absolute top-0 left-0 hidden -translate-x-full lg:translate-x-0 lg:static md:block">
<img src="/legacy-image-library/product_image_{{ productId }}/full/%5E*!92,92/0/default.webp" />
</div>
<div>
Expand Down Expand Up @@ -48,7 +48,7 @@
</div>
</div>
<div class="lg:w-[400px] lg:mx-0 md:w-[540px] mx-auto">
<h1 class="h3 mb-3">{{ attr('product', 'title') }}</h1>
<h1 class="mb-3 h3">{{ attr('product', 'title') }}</h1>
{% set chapo = attr('product', 'chapo') %}
{% if chapo %}
<div class="paragraph-3">{{ chapo }}</div>
Expand Down Expand Up @@ -114,6 +114,7 @@
{% set productFiltered = products|map((p) => ({
displayWishButton: true,
productTitle: p.i18ns.title,
productLink: p.publicUrl,
secondaryTitle: p.i18ns.chapo ?? null,
price: p.productSaleElements|filter(pse => pse.isDefault)|first.productPrices|first.price ~ '',
promoPrice: p.productSaleElements|filter(pse => pse.isDefault)|first.productPrices|first.promoPrice ~ '',
Expand Down
17 changes: 0 additions & 17 deletions template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,8 @@
<title>Flexy front office template</title>
</descriptive>
<languages>
<language>ar_SA</language>
<language>cs_CZ</language>
<language>de_DE</language>
<language>el_GR</language>
<language>en_US</language>
<language>es_ES</language>
<language>fa_IR</language>
<language>fr_FR</language>
<language>hu_HU</language>
<language>id_ID</language>
<language>it_IT</language>
<language>nl_NL</language>
<language>pl_PL</language>
<language>pt_BR</language>
<language>pt_PT</language>
<language>ru_RU</language>
<language>sk_SK</language>
<language>tr_TR</language>
<language>uk_UA</language>
</languages>
<version>1.0.0</version>
<authors>
Expand Down
2 changes: 2 additions & 0 deletions translations/messages.en.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Last seen products: Last seen products
Popular products: Popular products
3 changes: 3 additions & 0 deletions translations/messages.fr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Last seen products: Derniers produits consultés
Popular products: Produits populaires

0 comments on commit b41461f

Please sign in to comment.