Closed jcoyne closed 1 year ago
Looking at this and #1713
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?
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.
The actual file is in Spotlight: https://github.com/projectblacklight/spotlight/blob/main/app/views/spotlight/shared/_locale_picker.html.erb
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.
This is accomplished by adding a
dir
property to the html tag: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/