Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

Support (RTL) Multi Language Theme Development. #577

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ Snowdog_Components/public/images/icons-sprite.svg

# Libs
Snowdog_Components/vendor
/node_modules/.yarn-integrity
/yarn.lock
2 changes: 1 addition & 1 deletion Amasty_GiftCard/styles/modules/_amgift-card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ $amgift-card__content-button-border--hover : 2px solid $color-primary !default;
$amgift-card__image-padding : 0 $spacer--medium 0 0 !default;
$amgift-card__image-border : 2px $border-style-base $white !default;
$amgift-card__image-border-color--active : $color-primary !default;
$amgift-card__container-margin : 0 0 $spacer--medium 0 !default;
$amgift-card__container-margin : margin(0, 0, $spacer--medium, 0) !default;

.amgift-card {
&__content-button {
Expand Down
12 changes: 6 additions & 6 deletions Magento_Catalog/styles/modules/_fotorama.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ $_block-content-loading-margin-bottom: 30px !default;
}

@include mq($screen-l) {
margin-left: $spacer--medium;
margin-#{$start-direction}: $spacer--medium;
margin-bottom: 0;
}

@include mq($screen-xl) {
margin-left: $spacer--extra-large;
margin-#{$start-direction}: $spacer--extra-large;
}
}

Expand Down Expand Up @@ -151,9 +151,9 @@ $_block-content-loading-margin-bottom: 30px !default;
content: '';
position: absolute;
top: 12px;
right: 0;
#{$end-direction}: 0;
bottom: 0;
left: 0;
#{$start-direction}: 0;
width: 100px;
height: 100px;
margin: auto;
Expand Down Expand Up @@ -219,15 +219,15 @@ $_block-content-loading-margin-bottom: 30px !default;
}

@include mq($screen-l) {
margin-left: 66px;
margin-#{$start-direction}: 66px;

& > *:not(.loader) {
opacity: 0;
}
}

@include mq($screen-xl) {
margin-left: 98px;
margin-#{$start-direction}: 98px;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Magento_Customer/templates/account/dashboard/info.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<?php if ($block->getIsSubscribed()): ?>
<?= $block->escapeHtml(__('You subscribe to "General Subscription".')) ?>
<?php else: ?>
<?= $block->escapeHtml(__('You don\'t subscribe to our newsletter.')) ?>
<?= $block->escapeHtml(__('You didn\'t subscribe to our newsletter.')) ?>
<?php endif; ?>

<?php /* Extensions placeholder */ ?>
Expand Down
2 changes: 1 addition & 1 deletion Magento_PageBuilder/styles/modules/_module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ $icon-pagebuilder-caret-prev__content: '\f103';
}

.pagebuilder-full-width {
float: left;
float: $start-direction;
width: 100%;
}

Expand Down
8 changes: 4 additions & 4 deletions Magento_PageBuilder/styles/modules/content-type/_banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
[data-appearance='collage-centered'] {
.pagebuilder-banner-wrapper {
.pagebuilder-overlay {
margin-left: auto;
margin-right: auto;
margin-#{$start-direction}: auto;
margin-#{$end-direction}: auto;
}
}
}
Expand All @@ -18,7 +18,7 @@
[data-appearance='collage-left'] {
.pagebuilder-banner-wrapper {
.pagebuilder-overlay {
margin-right: auto;
margin-#{$end-direction}: auto;
}
}
}
Expand All @@ -30,7 +30,7 @@
[data-appearance='collage-right'] {
.pagebuilder-banner-wrapper {
.pagebuilder-overlay {
margin-left: auto;
margin-#{$start-direction}: auto;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Magento_PageBuilder/styles/modules/content-type/_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

[data-content-type='row'][data-appearance='full-width'] {
> .row-full-width-inner {
margin-left: auto;
margin-right: auto;
margin-#{$start-direction}: auto;
margin-#{$end-direction}: auto;
max-width: $max-content-width;
width: 100%;
}
Expand Down
8 changes: 4 additions & 4 deletions Magento_PageBuilder/styles/modules/content-type/_slide.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
[data-appearance="collage-right"] {
.pagebuilder-slide-wrapper {
.pagebuilder-overlay {
margin-left: auto;
margin-#{$start-direction}: auto;
}
}
}
Expand All @@ -96,7 +96,7 @@
[data-appearance="collage-left"] {
.pagebuilder-slide-wrapper {
.pagebuilder-overlay {
margin-right: auto;
margin-#{$end-direction}: auto;
}
}
}
Expand All @@ -108,8 +108,8 @@
[data-appearance="collage-centered"] {
.pagebuilder-slide-wrapper {
.pagebuilder-overlay {
margin-left: auto;
margin-right: auto;
margin-#{$start-direction}: auto;
margin-#{$end-direction}: auto;
}
}
}
16 changes: 8 additions & 8 deletions Magento_PageBuilder/styles/modules/content-type/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ div[data-content-type='tabs'] {
padding: 0;

li:first-child {
margin-left: 0 !important; // sass-lint:disable-line no-important
margin-#{$start-direction}: 0 !important; // sass-lint:disable-line no-important
}

li.tab-header {
background: $gray-lightest;
border: 1px solid $gray-lighter;
border-bottom: 0;
border-bottom-left-radius: 0 !important; // sass-lint:disable-line no-important
border-bottom-right-radius: 0 !important; // sass-lint:disable-line no-important
border-bottom-#{$start-direction}-radius: 0 !important; // sass-lint:disable-line no-important
border-bottom-#{$end-direction}-radius: 0 !important; // sass-lint:disable-line no-important
display: inline-block;
margin: 0;
max-width: 100%;
Expand All @@ -29,11 +29,11 @@ div[data-content-type='tabs'] {
z-index: 1;

&:not(:first-child) {
margin-left: -1px;
margin-#{$start-direction}: -1px;
}

a.tab-title {
border-right: 0;
border-#{$end-direction}: 0;
color: $black;
cursor: pointer !important; // sass-lint:disable-line no-important
display: block;
Expand All @@ -55,7 +55,7 @@ div[data-content-type='tabs'] {
}

&:last-child {
border-right: 1px solid $gray-lighter;
border-#{$end-direction}: 1px solid $gray-lighter;
}

&.ui-state-active {
Expand Down Expand Up @@ -87,12 +87,12 @@ div[data-content-type='tabs'] {

&.tab-align-left {
.tabs-content {
border-top-left-radius: 0 !important; // sass-lint:disable-line no-important
border-top-#{$start-direction}-radius: 0 !important; // sass-lint:disable-line no-important
}
}
&.tab-align-right {
.tabs-content {
border-top-right-radius: 0 !important; // sass-lint:disable-line no-important
border-top-#{$end-direction}-radius: 0 !important; // sass-lint:disable-line no-important
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ div[data-content-type='video'] {
iframe {
position: absolute;
top: 0;
left: 0;
#{$start-direction}: 0;
height: 100%;
width: 100%;
}
Expand Down
8 changes: 4 additions & 4 deletions Magento_PageBuilder/styles/modules/slick/_slick.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
}

.slick-prev {
left: 2rem;
#{$start-direction}: 2rem;

&:before {
content: '\f103';
padding-right: 5px;
padding-#{$end-direction}: 5px;
}
}

.slick-next {
right: 2rem;
#{$end-direction}: 2rem;

&:before {
content: '\f102';
padding-left: 5px;
padding-#{$start-direction}: 5px;
}
}

Expand Down
4 changes: 2 additions & 2 deletions Magento_QuickOrder/styles/modules/_quickorder.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ $quickorder__input-qty-flex : 1 0 calc(100% - 64px) !default;
$quickorder__input-qty-flex\@small : 1 0 100px !default;
$quickorder__input-qty-max-width : calc(100% - 64px) !default;
$quickorder__input-qty-max-width\@small : 100px !default;
$quickorder__input-qty-margin\@small : 0 0 0 $spacer--medium !default;
$quickorder__input-qty-margin\@small : margin(0, 0, 0, $spacer--medium) !default;

$quickorder__button-remove-margin : 25px 0 0 $spacer--medium !default;
$quickorder__button-remove-margin : margin(25px, 0, 0, $spacer--medium) !default;

$quickorder__autocomplete-border : 1px solid $gray-dark !default;
$quickorder__autocomplete-bg : $white !default;
Expand Down
2 changes: 1 addition & 1 deletion Magento_Review/templates/review.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
?>
<section class="product-review">
<h2 class="product-review__title">
<?= $block->escapeHtml(__('Customers reviews')); ?>
<?= $block->escapeHtml(__('Customers reviews')) ?>
</h2>
<div
id="product-review-container"
Expand Down
2 changes: 1 addition & 1 deletion Magento_Swatches/templates/product/layered/renderer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $attributeDescriptions = $helper->getAttributesDescriptions([$swatchCode]);
aria-expanded="true"
>
<h3 class="filter__heading">
<?= $block->escapeHtml($swatchLabel) ?>
<?= $block->escapeHtml(__($swatchLabel)) ?>
</h3>
<svg
class="
Expand Down
14 changes: 7 additions & 7 deletions Magento_Theme/templates/html/slider.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ $sliderTitleClass = $block->getTitleClass();
$sliderContentBefore = $block->getContentBefore();
$sliderContentAfter = $block->getContentAfter();
?>
<?php if ($sliderHtml == 'before-slides'): ?>
<?php if ($wrapperClass): ?>
<div class="<?= $block->escapeHtmlAttr($wrapperClass) ?>">
<?php if ($sliderHtml === 'before-slides'): ?>
<?php if ($wrapperClass): ?>
<div class="<?= $block->escapeHtmlAttr($wrapperClass) ?>">
<?php endif; ?>

<div
Expand Down Expand Up @@ -160,8 +160,8 @@ $sliderContentAfter = $block->getContentAfter();
<div class="slider__container">
<div class="slider__slides">

<?php endif; //before-slides end ?>
<?php if ($sliderHtml == 'after-slides'): ?>
<?php endif; //before-slides end ?>
<?php if ($sliderHtml === 'after-slides'): ?>

</div>
</div>
Expand All @@ -175,6 +175,6 @@ $sliderContentAfter = $block->getContentAfter();
</div>

<?php if ($wrapperClass): ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endif; //after-slides end ?>
5 changes: 4 additions & 1 deletion Magento_Theme/web/js/select.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ define([

return function (config, select) {
const isSearchable = $(select).hasClass('select--search');
let direction;
(document.dir !== undefined) ? direction = document.dir : direction = document.getElementsByTagName('html')[0].getAttribute('dir');

function matchCustom(params, data) {
if ($(data.element).data('option') === 'fallback') {
Expand All @@ -33,7 +35,8 @@ define([
minimumResultsForSearch: Infinity,
width: null,
position: 'bottom',
debug: true
debug: true,
dir: direction,
}

if (config.type === 'number') {
Expand Down
6 changes: 5 additions & 1 deletion Magento_Theme/web/js/slider.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ define([
const slider = $(this.slider)
const prevArrow = slider.find(this.dataValues.elementNavPrev)
const nextArrow = slider.find(this.dataValues.elementNavNext)
let direction;
(document.dir !== undefined) ? direction = document.dir : direction = document.getElementsByTagName('html')[0].getAttribute('dir');
let rtl = direction === 'rtl';

this.sliderSlick.not('.slick-initialized').slick(
{
Expand All @@ -42,7 +45,8 @@ define([
slidesToScroll: parseInt(this.dataValues.slidesToScroll),
swipeToSlide: JSON.parse(this.dataValues.swipeToSlide),
responsive: JSON.parse(this.dataValues.responsiveConfig),
accessibility: false
accessibility: false,
rtl: rtl,
}
)
}
Expand Down
Loading