I tried switching an Umami site to a right-to-left language (Hebrew) and it didn't look good.

Some issues visible in the screenshots below include:
1. The theming of the menu links near the top of the page is messed up.
2. The front page recipe content is missing (and the "No front page content has been created yet" message is displayed instead).

The first problem above seems to happen no matter what. The second only happened for me if I switched languages after installing in English (i.e., by manually enabling the core Language module and then going to admin/config/regional/language to add a new language and switch to it); if I installed from scratch in Hebrew, the front page content was shown correctly.

So this needs some investigation to figure out which parts of this are problems caused by Umami and which aren't.

Here is what the site looked like in a right-to-left language:

And here is what it looked like in English/left-to-right:

CommentFileSizeAuthor
#41 interdiff_36-40.txt1.23 KBtsega
#41 umami-rtl-language-fix-2942011-40.patch11.91 KBtsega
#36 interdiff_30-36.txt1.05 KBtsega
#36 umami-rtl-language-fix-2942011-36.patch11.75 KBtsega
#30 interdif_27-30.txt465 bytestsega
#30 umami-rtl-language-fix-2942011-30.patch11.75 KBtsega
#27 interdiff_21-27.txt1.18 KBtsega
#27 umami-rtl-language-fix-2942011-27.patch11.76 KBtsega
#27 search-results-header-ltr-1-rem-left-margin.png50.99 KBtsega
#25 ltr_search-button-hover.png95.06 KBtsega
#25 search-results-right-margin.png27.33 KBtsega
#25 breadcrumbs-swapping.png60.9 KBtsega
#21 interdiff-21-13.txt8.26 KBimalabya
#21 2942011-21.patch11.77 KBimalabya
#16 recipe-list-icons.png80.61 KBtsega
#16 search-result-form-and-results.png122.53 KBtsega
#16 remove-tab-gaps.png26.16 KBtsega
#16 promoted-content-consistent-gap.png687.46 KBtsega
#16 numbering-moved-to-the-right.png169.29 KBtsega
#16 header-fix.png52.42 KBtsega
#16 footer-more-link-arrow-pointing-left.png148.4 KBtsega
#16 breadcrumb-arrows-pointing-to-the-left.png43.1 KBtsega
#16 alert-icon-aligned-left.png27.65 KBtsega
#16 contact-form-button-spacing.png18.22 KBtsega
#13 rtl-lang-fix-2942011-13.patch9.82 KBtsega
#12 07-login-action-links-english.png40.32 KBrobindh
#12 07-login-action-links-hebrew.png5.24 KBrobindh
#12 08-recipe-breadcrumb-arrows-english.png53.07 KBrobindh
#12 08-recipe-breadcrumb-arrows-hebrew.png7.91 KBrobindh
#12 09-recipe-info-icons-english.png144.48 KBrobindh
#12 09-recipe-info-icons-hebrew.png50.9 KBrobindh
#12 10-recipe-instruction-steps-english.png223.12 KBrobindh
#12 10-recipe-instruction-steps-hebrew.png65.06 KBrobindh
#12 11-search-result-search-input-field-english.png91.6 KBrobindh
#12 11-search-result-search-input-hebrew.png22.78 KBrobindh
#12 12-search-result-search-title-english.png170.9 KBrobindh
#12 12-search-result-search-title-hebrew.png26.95 KBrobindh
#11 06-home-header-loggedin-hebrew.png8.17 KBrobindh
#11 06-home-header-logged-in-english.png37.83 KBrobindh
#11 05-home-header-hebrew.png105.91 KBrobindh
#11 05-home-header-english.png635.96 KBrobindh
#11 04-home-footer-arrow-hebrew.png110.04 KBrobindh
#11 04-home-footer-arrow-english.png452.04 KBrobindh
#11 03-home-content-hebrew.png552.6 KBrobindh
#11 03-home-content-english.png2.19 MBrobindh
#11 02-contact-submit-buttons-hebrew.png3.66 KBrobindh
#11 02-contact-submit-buttons-english.png41.17 KBrobindh
#11 01-alert-message-hebrew.png104.29 KBrobindh
#11 01-alert-message-english.png84.78 KBrobindh
#6 Choose_language___Drupal.png305.72 KBEli-T
front-page-ltr.png6.41 MBDavid_Rothstein
front-page-rtl.png4.06 MBDavid_Rothstein
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

David_Rothstein created an issue. See original summary.

cchoudhary’s picture

Regarding point 2

The front page recipe content is missing (and the "No front page content has been created yet" message is displayed instead).

This main block displaying above message is actually a view http://192.168.33.10/d86/en/admin/structure/views/view/frontpage which has got a 'Translation language' filter. So when we switch to another language (irrespective of left to right or right to left language), there is no content already created for that language, which can appear in this view, we need to create new content for new language to make them appear in view.

The second only happened for me if I switched languages after installing in English (i.e., by manually enabling the core Language module and then going to admin/config/regional/language to add a new language and switch to it); if I installed from scratch in Hebrew, the front page content was shown correctly.

Yes, this is true, because when the site is installed from scratch in one language and language module is not enabled , this 'Translation language' filter in view doesn't come into thepicture.

In short this problem is not related to umami profile.

ckrina’s picture

ckrina’s picture

Issue tags: +Nashville2018

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Eli-T’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)
Issue tags: +DrupalEurope
FileSize
305.72 KB

I agree with @cchoudhary in #2 that we shouldn't worry about the situation where Umami is installed in US English, then Language module enabled and the language switch until we support multi site.

However, we should not look obviously broken when installing after selecting a right to left language such as Hebrew on the first page of the installer.

I've just tested briefly with the latest version of Umami from Drupal 8.6.1 and this issue is not nearly as bad as it was when @David_Rothstein took the screenshots above. Therefore suggest next steps for this are to install in Hebrew and take screenshots of the different pages side by side with the default US English version, and highlighting where we need fixes. This would be a great novice task for Drupal Europe.

Note to install in Hebrew, select the following option on the first screen of the Drupal installation wizard (towards the bottom of the list):

The Drupal Select Language installation step with Hebrew selected

Eli-T’s picture

Status: Closed (won't fix) » Active
aburrows’s picture

This is being worked on by Gvert at DrupalEurope who I am mentoring.

Gvert’s picture

Robindh and I will be working on this at Drupal Europe.

Gvert’s picture

  1. The links styling on the login page isn't correct in the right-to-left version, there is some spacing visible between the links

    English (ltr):
    Login links (ltr)

    Hebrew (rtl):
    Login links hebrew (rtl)
  2. On a recipe page, the arrows between the breadcrumbs aren't correclty in the right-to-left version, they point into different directions

    English (ltr):
    Breadcrumb arrows (ltr)

    Hebrew (rtl):
    Breadcrumb arrows (rtl)
  3. On the recipe page, the icons next to the additional information aren't aligned correctly in the right-to-left version.

    English (ltr):
    Recipe icons (ltr)

    Hebrew (rtl):
    Recipe icons (rtl)
  4. On the recipe page, the numbering next to the instruction steps isn't correctly aligned in the right-to-left version.

    English (ltr):
    Instructions numbering (ltr)

    Hebrew (rtl):
    Instructions numbering (rtl)
  5. On the search result page, the styling of the input field for a new search is broken in the right-to-left version.

    English (ltr):
    Search input (ltr)

    Hebrew (rtl):
    Search input (rtl)
  6. On the search result page, the title "Search results" isn't correctly aligned in the right-to-left version.

    English (ltr):
    Search title (ltr)

    Hebrew (rtl):
    Search title (rtl)
robindh’s picture

1. The alert message icon is floated to the left of the page, it should be aligned to the right with the text.

English (ltr):
English alert

Hebrew (rtl):
Hebrew alert

2. On the contact page, at the bottom of the form: submit buttons do not have the correct padding / margins.

English (ltr):
English submit buttons

Hebrew (rtl):
Hebrew submit buttons

3. Margins on containers should be inverted:

  • .view-content should have "margin-left: 14px" instead of "margin-right: 14px"
  • .attachment-after should have "margin-right: 14px" instead of "margin-left: 14px"

English (ltr):
English home content

Hebrew (rtl):
Hebrew home content

4. Should the "find out more" arrow in the footer point the other way?

English (ltr):
English footer arrow

Hebrew (rtl):
Hebrew footer arrow

5. The search box styling in the header should be adapted for right to left and the "home" link should be correctly aligned with the other menu items. The "login" link in the header should be aligned left.

English (ltr):
English header

Hebrew (rtl):
Hebrew header

6. The "logout" and "user" links in the header should be aligned left

English (ltr):
English logged in header

Hebrew (rtl):
Hebrew logged in header

tsega’s picture

Nice work by @Gvert and @robindh on the screenshots! Happy to say I have a fix for all of the issues but with some minor things not addressed (requiring some work)

  • The search form in the header has a 1 or 2 pixel misalignment at the bottom; seems like the cause is the difference in fonts
  • The search result page form is not responsive and the alignment breaks on smaller screens because of a mix of fixed width and flex box properties.
tsega’s picture

Status: Active » Needs review
markconroy’s picture

Status: Needs review » Needs work
Issue tags: -dclondon, -#dclondon, -Nashville2018

Would it be possible to get screenshots of these fixes attached to this issue? I think we are going to need them to keep track of what is fixed by the issue.

Setting back to 'Needs work' so someone can gather the screenshots.

I haven't installed the site with this patch yet, but reading through it, it looks very promising, so thanks for all the work on it so far.

tsega’s picture

Here are the screenshots

Header

  • Search block - Alignment and border issues
  • Account menu - Links alignment
  • Main menu - Spacing issue

Header fix

Login Page

  • Login page tab link spacing
    Remove tab gaps

Recipe Page

  • Breadcrumb arrow directions
    Breadcrumb
  • Recipe page - List Icons
    Recipe list icons
  • Recipe page - List numbering
    Recipe list icons

Search Results Page

  • Exposed Filter
  • Heading and listing alignment

Search results

Home Page

  • Promoted Content Spacing

Promoted content spacing

Contact Page

  • form buttons

Contact form buttons

Misc

  • Alert message icon alignment
    Contact form buttons
  • Footer - "Find out more" arrow
    Contact form buttons
markconroy’s picture

Status: Needs work » Reviewed & tested by the community

This is a huge improvement over what we currently have - even though we are not officially supporting RTL. It's great that even though we don't officially support RTL, things now don't look broken in RTL.

Let's mark this as RTBC, and if we find any other small RTL bugs later, we can squash them easily.

Thanks a lot for the work on this, especially @Gvert and @tsega and @robindh. Please continue to help us make the Out of the Box experience even better!

aburrows’s picture

Well done @Gvert and @Robindh for working on this looking great!

tsega’s picture

@markconray, I'm glad to be of help! You can count me in on contributing to Umami or any other Drupal project for that matter. Participating in the mentored contributions was an eye-opener for me, thanks @ELI-T and @cferthorney for your kindness and patience in explaining the whole process.

On to the next then.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We have some coding standards for comments in .css files for stuff that needs RTL specific styling. I think we should apply them here. See https://www.drupal.org/docs/develop/standards/css/css-formatting-guideli...

+++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css
@@ -6,6 +6,9 @@
 .search-form + h2 {
   margin: 0 14px 1rem;
 }
+[dir=rtl] .search-form + h2 {
+  margin: 0 1rem 1rem;
+}

So for example we need to add /* LTR */ to the LTR version here. This is so that if future us makes a change to the LTR version we know there is an RTL version to update.

imalabya’s picture

Status: Needs work » Needs review
FileSize
11.77 KB
8.26 KB

Added a patch to add the /* LTR */ comments for the CSS codes which have a RTL version.

Gábor Hojtsy’s picture

Status: Needs review » Needs work

Yay, thanks for working on this!

+++ b/core/profiles/demo_umami/themes/umami/css/components/navigation/tabs/tabs.css
@@ -13,9 +13,12 @@
 .tabs .tab {
-  margin: 0;
+  margin: 0; /* LTR */
   background-color: #e6eee0;
 }
+[dir=rtl] .tabs .tab{
+  margin: 0;
+}

An all around 0 margin is not surprisingly not different in RTL either and therefore should not be marked as LTR and not have an RTL counterpart with the same style :)

(Also this fixes a missing space in the sheet :)

Gábor Hojtsy’s picture

Went ahead and reviewed the rest, sorry for not posting altogether.

  1. +++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css
    @@ -4,7 +4,10 @@
    -  margin: 0 14px 1rem;
    +  margin: 0 14px 1rem; /* LTR */
    +}
    +[dir=rtl] .search-form + h2 {
    +  margin: 0 1rem 1rem;
    

    How did 14px became 1rem in the RTL version?

  2. +++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css
    @@ -110,6 +131,13 @@
    -  border-top-left-radius: 4px;
    -  border-bottom-left-radius: 4px;
    +  border-top-left-radius: 4px; /* LTR */
    +  border-bottom-left-radius: 4px; /* LTR */
    +}
    +[dir=rtl] .search-block-form .form-submit:focus,
    +[dir=rtl] .search-block-form .form-submit:hover,
    +[dir=rtl] .search-form .form-submit:focus,
    +[dir=rtl] .search-form .form-submit:hover {
    +  margin: 0;
    +  border-radius: 4px;
     }
    

    Why is RTL getting a full border radius while LTR only has selective?

  3. +++ b/core/profiles/demo_umami/themes/umami/css/components/messages/messages.css
    @@ -17,7 +17,10 @@
     .messages__content {
    -  background: no-repeat 0 center;
    +  background: no-repeat 0 center; /* LTR */
    +}
    +[dir=rtl] .messages__content {
    +  background-position: right;
     }
    

    Hm, if this was normally in the center, why does it go to the right then?

  4. +++ b/core/profiles/demo_umami/themes/umami/css/components/navigation/breadcrumbs/breadcrumbs.css
    @@ -11,4 +11,7 @@
    +  [dir=rtl] .breadcrumb li {
    +    display: inline-block;
    +  }
    

    Why was this not applied to LTR? Does it harm something there? What's the benefit in RTL?

volkswagenchick’s picture

Issue tags: +badcamp 2018

tagging for badcamp 2018

tsega’s picture

Thanks for the review guys! @imalabya nice work on the improvements!

@gábor:

1. An all around 0 margin is not surprisingly not different in RTL either and therefore should not be marked as LTR and not have an RTL counterpart with the same style :)

The addition of the margin: 0; in RTL was because the base theme (Classy) was adding margins to tabs specifically for RTL and hence the need override that in Umami.

core/themes/classy/css/components/tabs.css:18

[dir="rtl"] .tabs > li {
  margin-left: 0.3em;
  margin-right: 0;
}
2. How did 14px became 1rem in the RTL version?

That was changed to keep the Search Result title and result item boxes aligned on the right. See below:

Search Result right align

3. Why is RTL getting a full border radius while LTR only has selective?

As you can see form the LTR hover/focus state of the search button, all corners have a radius. I believe that is inherited from core/profiles/demo_umami/themes/umami/css/base.css:65. The reason that I'm applying the radius again is because for RTL we also have to switch the corners that are square and rounder; meaning a more specific styling that overrides the default one in base.css. Then on hover, the RTL specific one needs to be overridden to apply border radius for all corners. :D

Search Result right align

Hm, if this was normally in the center, why does it go to the right then?

The RTL rule is actually overriding the 0 part (equivalent to left background-position: left;) in the LTR. The center is for the vertical position which is shared by both.

Why was this not applied to LTR? Does it harm something there? What's the benefit in RTL?

For the most part I worked on the RTL version of things, totally ignoring LTR. In this case, in display: inline-block; is needed to fix the "swapping" issue on pages that have a third-level breadcrumb. See below:

breadcrumbs swapping in RTL

Gábor Hojtsy’s picture

It would be nice to add non-directional changes to the LTR sheet (the inline-block thing), so that the RTL is limited to directional changes rather than layout changes.

For the margin question, if the LTR one was margin: 0 14px 1rem; then both left and right are 14px, no? Why does that need to change for both left and right to 1rem in RTL? Sounds like 1rem would have been better originally, is that not aligned with other things in LTR? Then there is a sizing inconsistency between the two things placed?

tsega’s picture

@Gábor, I have looked into the breadcrumb issue and applying the display: inline-block; style to both LTR and RTL produces the expected result and is consistent with the design.

Similarly, I have checked the 14px -> 1remand it seems applying the 1rem value to the original style does not affect the design significantly (noticeably even); it only add 2 pixels more to the search results Header in LTR which is not aligned to anything else.

Search Result left margin

tsega’s picture

Status: Needs work » Needs review
Gábor Hojtsy’s picture

Status: Needs review » Needs work

Yay thanks, looks good other than this small thing:

+++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css
@@ -4,10 +4,7 @@
+  margin: 0 1rem 1rem; /* LTR */

hm if its the same value left/right, we don't usually add LTR since it would not need an RTL counterpart

tsega’s picture

Thanks for looking into this Gábor and nice catch!

I've made the changes.

tsega’s picture

Status: Needs work » Needs review
penyaskito’s picture

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Great work everyone, thanks for all the help here. This is a great improvement.

Gábor Hojtsy’s picture

Assigning credits.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Needs work

While trying to commit these two style issues were identified by stylelint:

core/profiles/demo_umami/themes/umami/css/components/forms/contact.css
 46:57  ✖  Expected single space before "{"   block-opening-brace-space-before

core/profiles/demo_umami/themes/umami/css/components/navigation/tabs/tabs.css
 19:20  ✖  Expected single space before "{"   block-opening-brace-space-before
tsega’s picture

@Gábor, here are the fix for the above.

tsega’s picture

Status: Needs work » Needs review
markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Back to RTBC

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search-results.css
@@ -96,7 +98,10 @@
+  margin: 0 0 1rem 0; /* LTR */
...
+  margin: 0 1rem 1rem 0;

+++ b/core/profiles/demo_umami/themes/umami/css/components/blocks/search/search.css
@@ -110,6 +128,13 @@
   margin: 0;
-  border-top-left-radius: 4px;
-  border-bottom-left-radius: 4px;
+  border-top-left-radius: 4px; /* LTR */
+  border-bottom-left-radius: 4px; /* LTR */
...
+  margin: 0;
+  border-radius: 4px;

I think for these non-obvious not opposite LTR to RTL changes we should have a comment. So people don't file issues in the future saying this is wrong because the RTL version is not the opposite of the LTR version.

tsega’s picture

tsega’s picture

@alexpott I have added comments to the changes you've highlighted. Hope they are helpful enough to avoid future issues.

tsega’s picture

Status: Needs work » Needs review
tsega’s picture

tsega’s picture

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

Third time lucky - back to RTBC

  • Gábor Hojtsy committed 749f569 on 8.7.x
    Issue #2942011 by tsega, imalabya, robindh, David_Rothstein, Eli-T,...

  • Gábor Hojtsy committed 50c8796 on 8.6.x
    Issue #2942011 by tsega, imalabya, robindh, David_Rothstein, Eli-T,...
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Yay, thanks, committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.