pulibrary / figgy

Valkyrie-based digital repository backend.
Other
36 stars 4 forks source link

Arabic section titles are not appearing as Right To Left in Universal Viewer #5391

Open sdellis opened 2 years ago

sdellis commented 2 years ago

Summary

Arabic section titles are not appearing as Right To Left in Universal Viewer. Adding brackets to wrapped text also creates problems because they do not start and end at the beginning of the text.

Impact

This affects end users as the text is not displayed properly, but does not typically prevent them from accomplishing their task.

Priority recommendation

Sudden Priority Justification

Required if "asap" or "within the next 3 weeks" is checked. Add "Sudden Priority" and "Maintenance/Research" labels

Expected behaviour

Section titles should be displayed Right To Left

Actual behaviour

Section titles are displayed Left To Right, which is incorrect

Steps to reproduce behaviour

See highlight reel. at 12:50.

ScreenshoTS

Screen Shot 2022-08-24 at 3 28 30 PM

See highlight reel. at 12:50.

Example

Example used in this screencast: https://catalog.princeton.edu/catalog/9963585953506421 https://figgy.princeton.edu/catalog/cfec680e-1169-475d-b0f3-90b5f64e8115

Context

This issue is the result of a UX research session. The bug was reported during a focus group / observation with Graduate Students working on an Islamic Manuscripts project, held on Aug 16th, 2022.

hackartisan commented 2 years ago

potentially relevant UV ticket https://github.com/UniversalViewer/universalviewer/issues/299

sdellis commented 2 years ago

Follow up with users about whether the title in UV is RTL, but should also be justified right. UV has no dir attribute on the element. Is there a way to tell the viewer that this is RTL. Setting dir='rtl' in the TOC seems to do the right thing. However, there's often mixed languages in the TOC, so we need to apply it directly to the section labels.

Things to explore, in order:

  1. Can IIIF support RTL in text labels? (look at spec, ask in slack)
  2. Can UV support RTL in section titles? The answer is yes, if we can assign a language to the label that's an RTL language. (we can test with a mock manifest)
  3. We need to be able to assign lang value in Structure Manager. We define the language in the metadata values, and you can see that it works in the metadata panel of the UV.

Note: Rails Gem currently auto-assumes RTL or LTR (not language) based on the unicode character range.

hackartisan commented 2 years ago

Other implementation possibilities:

hackartisan commented 2 years ago

mentioned by @eliotjordan https://github.com/jtoy/cld

kelea99 commented 2 years ago

PO Priority: This is one of two top figgy priorities for the Large 3 year project for Middle East Manuscripts. After discussion with project team, it would be great to see this through to completion by the end of the 3 year project (2024)

tpendragon commented 1 year ago

Implementation proposal:

In the Manifest Builder, check to see if a section label is RTL (#dir), if it is, then make it a RDF Literal with the language tag that's in the imported metadata's #language property.

hackartisan commented 1 year ago

https://github.com/pulibrary/figgy/pull/5750 updates manifests as per the implementation proposal in the previous comment. However, UV only implemented the rtl direction feature for the metadata info pane, not for the leftPanel "Contents" iiif-tree-component.

Code references:

Note that @tpendragon also tried just putting html as the manifest value, but that resulted in an error.

The proposed path forward is (not necessarily in this order):

However, this path forward is a bigger project than we had hoped and the work will need to undergo prioritization again.

hackartisan commented 1 year ago

I created https://github.com/UniversalViewer/universalviewer/issues/916