sul-dlss / dlme

Digital Library of the Middle East web application, based on Spotlight
https://dlmenetwork.org/
Other
20 stars 2 forks source link

When Arabic is selected the page should layout right-to-left #1712

Closed jcoyne closed 1 year ago

jcoyne commented 1 year ago

This is accomplished by adding a dir property to the html tag:

<html dir="rtl">

Consider initial page loads as well as navigation via turbo. This change may need to be made in https://github.com/projectblacklight/blacklight-locale_picker/

hudajkhan commented 1 year ago

Looking at this and #1713

hudajkhan commented 1 year ago

The code governing the HTML attributes exists within DLME here and overrides the Blacklight helper method: https://github.com/sul-dlss/dlme/blob/main/app/helpers/blacklight_helper.rb#L10. This is called here: https://github.com/sul-dlss/dlme/blob/main/app/views/layouts/spotlight/base.html.erb#L2 .

When we first change locale, it seems like this code has not been put into effect. When we reload the page, the direction and language attributes are both present in the html tag. Perhaps some caching is in effect preventing the change on the HTML tag from displaying when the page is first loaded after locale change?

hudajkhan commented 1 year ago

In speaking with @corylown , we think we have pinned down the issue. The link for the locale (in the locale dropdown) should have a "data-turbo='false'" attribute.

hudajkhan commented 1 year ago

The actual file is in Spotlight: https://github.com/projectblacklight/spotlight/blob/main/app/views/spotlight/shared/_locale_picker.html.erb

hudajkhan commented 1 year ago

I tested this by linking to Spotlight's main branch after the file above had been updated to include the "data-turbo='false'" flag and it worked. Once the next Spotlight beta version is out, we can use that in DLME and then test and close this issue and #1713 if it works correctly.