Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNIP 76 - Add RTL Support #6156

Closed
1 of 5 tasks
t-book opened this issue Jun 5, 2020 · 5 comments
Closed
1 of 5 tasks

GNIP 76 - Add RTL Support #6156

t-book opened this issue Jun 5, 2020 · 5 comments
Assignees
Labels
gnip A GeoNodeImprovementProcess Issue
Milestone

Comments

@t-book
Copy link
Contributor

t-book commented Jun 5, 2020

GNIP 76 - Add RTL Support

Overview

GeoNode currently supports 31 languages. (Hebrew might soon follow as no. 32)
From these languages, the following are written from right to left:

('ar', 'Arabic')
('he','Hebrew')
('fa', 'Persian')

https://meta.wikimedia.org/wiki/Template:List_of_language_names_ordered_by_code
This GNIP suggest enabling right-to-left support for named languages

Bildschirmfoto 2020-06-05 um 12 56 17

Bildschirmfoto 2020-06-05 um 12 57 54

Bildschirmfoto 2020-06-05 um 12 59 33

Proposed By

[email protected]

Assigned to Release

This proposal is for GeoNode 3.1.

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

The benefits should be clear, a correct reading direction for rtl languages.

Proposal

Technically this is quite simple.

base.html

{% get_current_language_bidi as LANGUAGE_BIDI %}
{% if LANGUAGE_BIDI %}
<link rel="stylesheet" href="//cdn.rawgit.com/morteza/bootstrap-rtl/v3.3.4/dist/css/bootstrap-rtl.min.css">
<link rel="stylesheet" type="text/css" href="{% static "lib/css/rtl_overwrite.min.css" %}">
{% endif %}

The if statement uses get_current_language_bidi (https://docs.djangoproject.com/en/3.0/topics/i18n/translation/#get-current-language-bidi)
in case the language is RTL two more stylesheets are loaded.

The first loads the general rtl-overwrite for bootstrap from a public cdn.
The second line will load custom styles that will handle margins for example geonode specific items like icons. Further the later will make sure the viewer section will stay LTR.

Backwards Compatibility

Will be fully compatible until templates inherit from base.html. Further this will fail gracefully as all what will happen is that an RTL language is rendered LTR

Future evolution

The use of RTL Templates could be set by a new settings variable USE_RTL=False|True

Feedback

Update this section with relevant feedbacks, if any.

Voting

Project Steering Committee:

  • Alessio Fabiani: ✓
  • Francesco Bartoli: ✓
  • Giovanni Allegri:
  • Simone Dalmasso: ✓ by mail
  • Toni Schoenbuchner: ✓
  • Florian Hoedt: ✓
@t-book t-book added the feature A new feature to be added to the codebase label Jun 5, 2020
@t-book t-book self-assigned this Jun 5, 2020
@t-book t-book added this to the 3.1 milestone Jun 5, 2020
@t-book t-book changed the title Add RTL Support GNIP 76 - Add RTL Support Jun 9, 2020
@t-book t-book added gnip A GeoNodeImprovementProcess Issue and removed feature A new feature to be added to the codebase labels Jun 9, 2020
@giohappy
Copy link
Contributor

giohappy commented Jun 9, 2020

@t-book is the UI horizontal flip intentional or a side effect of the RTL support?

@t-book
Copy link
Contributor Author

t-book commented Jun 9, 2020

@giohappy I see this with respect to the reading direction or what get's into focus first.
For Example at a layer detail page:

LTR: Map -> Tools (Right hand side)
RTL: Map -> Tools (Left hand side)

I do not speak arabic but our arabic userbase agrees with it. From what I further see this flip happens on other RTL pages as well: F.e.: https://arabic-media.com/arabicnews.htm look at the home button at the menu bar. However, I would be happy to hear opinions from native speakers as well.

@giohappy
Copy link
Contributor

giohappy commented Jun 9, 2020

thanks @t-book I never noticed that RTL languages used flipped GUIs....

@francbartoli
Copy link
Member

+1 thanks @t-book

@afabiani
Copy link
Member

afabiani commented Jun 9, 2020

very cool +1

@t-book t-book closed this as completed Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gnip A GeoNodeImprovementProcess Issue
Projects
None yet
Development

No branches or pull requests

4 participants