Problem

When choosing Arabic in the installer, the profile selector should already display in RTL, but that is not the case.

Proposal

Installer should show in RTL from the profile step. We should use our pre-stored information to display the installer in the proper orientation (from the standard language list).

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Issue tags: +medium

Likely not a very hard issue to solve, assuming the installer has RTL styling in the theme already. Marking as medium.

Gábor Hojtsy’s picture

Issue tags: +frontend
FileSize
44.34 KB

Looks like the lang="en" and dir="ltr" on the page even if you pick Arabic. We should fix that first and foremost. If that is fixed (I just hand-edited locally), the page would look like this:

Screenshot_4_25_13_10_12_AM.png

While that does not fix it completely (the indicators are on the wrong side of the step list), this page is being redesigned at #1337554: Develop and use separate branding for the installer.

Gábor Hojtsy’s picture

Status: Active » Needs review
FileSize
1.04 KB
88.26 KB

All right, the problem is until the database is set up, we don't have a persistent storage to set language_default and we just don't temporarily set it to inform the theme system to act accordingly. If we do this right after configuration is inited, we get the behaviour as screenshot in #2. There is still a CSS assignment issue since later the Druplicon and the steps move to the left side proper:

Screenshot_4_25_13_10_33_AM.png

So this does not yet happen as early as the profile selection step but it should. CSS at the configure page includ:

    <style media="all">
@import url("http://d8mi.localhost:8082/core/misc/normalize/normalize.css?mlsyd5");
</style>
<style media="all">
@import url("http://d8mi.localhost:8082/core/modules/user/user.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/user/user-rtl.css?mlsyd5");
</style>
<style media="all">
@import url("http://d8mi.localhost:8082/core/modules/system/system.base.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.admin.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.theme.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.maintenance.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.base-rtl.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.admin-rtl.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/modules/system/system.theme-rtl.css?mlsyd5");
</style>
<style media="screen">
@import url("http://d8mi.localhost:8082/core/themes/seven/style.css?mlsyd5");
@import url("http://d8mi.localhost:8082/core/themes/seven/style-rtl.css?mlsyd5");
</style>

The swapped installer sidebar layout comes via seven's style-rtl.css. Still needs to be figured out why RTL CSS is not added to the page even though the installer now recognizes it is Arabic and RTL.

Gábor Hojtsy’s picture

Found the CSS problem too. The maintenance theme assembles CSS but the RTL CSS addition is in a hook with language module. So obviously before you pick the first profile, there are no modules enabled whatsoever. However, we should still add corresponding RTL CSS when available, so we should do a little manual intervention there and call out to the appropriate code in language.module. Thankfully drupal_get_css() already supports injecting a modified list of CSS from the outside (otherwise falling back on drupal_add_css()) so we can easily do that. Also, language module's alter is multi-run-safe, so if the module is indeed enabled, it will not re-add the CSS multiple times (if maintenance page is run on an installed site that is).

So this looks to me the complete solution. Reviews now welcome :)

Screenshot_4_25_13_10_50_AM.png

Note every placement looks correct, arrow point from/to the right direction, etc :)

Gábor Hojtsy’s picture

Title: When choosing Arabic in the installer, the installer is not RTL » When choosing an RTL language in the installer, the installer is not RTL
Issue tags: +Needs manual testing
Gábor Hojtsy’s picture

Issue tags: +sprint
Gábor Hojtsy’s picture

Gábor Hojtsy’s picture

Title: When choosing an RTL language in the installer, the installer is not RTL » When installing in an RTL language, it should be RTL from profile selection onwards

Better title since the installer does become RTL at some point, but pretty late.

ricardoamaro’s picture

having a look at the simpletest of this patch

ricardoamaro’s picture

FileSize
91.41 KB

The installer is failing for me now and the druplicon is still align to the right:
test

Gábor Hojtsy’s picture

Thanks for testing!

I think the Druplicon aligning to the right is fine for now, I don't want to mix in CSS fixes here especially that #1337554: Develop and use separate branding for the installer proposes redoing the CSS altogether (and has its own RTL testing there :).

As for the simplytest.me error, I've found that at #1974912: Problems installing Drupal 8, and it does work for me with reloading this page and going forward, so I'm just doing it for now in my testing. Looks like it might be fixed in core soon given there is a working patch :)

Apart from that any other issues?

ricardoamaro’s picture

Tested 2 times and against the normal installation.
I see no other issues
Works to me!

ricardoamaro’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/includes/theme.incundefined
@@ -3100,9 +3100,16 @@ function template_preprocess_maintenance_page(&$variables) {
+  // While this code is used in the installer, the language module may not be
+  // enabled yet (even maybe no database set up yet), but an RTL language
+  // selected should result in RTL stylesheets loaded properly already.
+  $variables['css'] = $css = drupal_add_css();
+  include_once DRUPAL_ROOT . '/core/modules/language/language.module';
+  language_css_alter($css);
+  $variables['styles'] = drupal_get_css($css);

Lets try and use Drupal::moduleHandler() here instead of include_once... this might not be possible but I think it is...

alexpott’s picture

Status: Needs work » Reviewed & tested by the community

Ignore me... language is not enabled at this point... so the following will apply...

 * @todo The module_handler service has a loadInclude() method which performs
 *   this same task but only for enabled modules. Figure out a way to move this
 *   functionality entirely into the module_handler while keeping the ability to
 *   load the files of disabled modules.
webchick’s picture

Assigned: Unassigned » alexpott

Not sure what that meant. :) Assigning to alexpott since it looks like he had his fingers in here.

My only comment would be whether or not it's kosher to be introducing more $GLOBALS['something']['something'] rather than just pulling that from the Request object.

Gábor Hojtsy’s picture

language_default is not anywhere close to being anywhere on the Request object, its a site-global setting, which you cannot really have without even selecting a profile/set up DB obviously.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed ba6d6e9 and pushed to 8.x. Thanks!

Gábor Hojtsy’s picture

Issue tags: -sprint

Superb, thanks! I have not checked if this applies to Drupal 7. It might or might not. The span/effect of it on Drupal 7 would be much less, since you pick language after you picked a profile and then the screens showing before Drupal is properly installed are DB setup and the module batch screen. Those may show in LTR. In Drupal 8, we moved language ahead, and strive for a fully flawless multilingual experience from the first step. If someone finds this not working in Drupal 7, please reopen for backport.

YesCT’s picture

Issue tags: -Needs manual testing

does not need manual testing now that it is in. :)

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

Anonymous’s picture

Issue summary: View changes

Update with proposal section

Gábor Hojtsy’s picture