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

Add dir attribute to the html tag, ltr/rtl. #3728

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Conversation

frjo
Copy link
Member

@frjo frjo commented Jan 17, 2024

Fixes #3726

@frjo frjo requested a review from theskumar January 17, 2024 08:26
@frjo
Copy link
Member Author

frjo commented Jan 17, 2024

@frankduncan This add basic rtl support to Hypha. Django can autodetect the direction so no settings needed, if you e.g. set the language to "ar" the direction will be "rtl" as it should be.

@frjo frjo added Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter labels Jan 17, 2024
@frjo
Copy link
Member Author

frjo commented Jan 17, 2024

Hypha has a sass function "opposite-direction" to handle ltr/rtl but that is an old way of doing it. You must also explicitly make use of it everywhere and that is not so now.

Much better is to replace all use of things like "margin-right" with "margin-inline-end", "padding-top" with "padding-block-start" etc. With these you get rtl support without doing anything, the browser just does the right thing.

Copy link
Member

@theskumar theskumar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💯

@frjo frjo added the Status: Needs testing Tickets that need testing/qa label Jan 17, 2024
@frankduncan
Copy link
Contributor

Ah! This will be great when hypha as a whole is set to an RTL language (and the localization file is created with all the translations). We'll still need a solution when it has to do both simultaneously. Something like #3293 would help with that.

@frjo frjo merged commit 8da7778 into main Jan 18, 2024
theskumar added a commit that referenced this pull request Jan 29, 2024
* main:
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…' into maintainance/remove-partners-app

* origin/maintainance/remove-partners-app:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…emove-people-app

* maintainance/remove-partners-app:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…emove-projects-app

* maintainance/3-remove-people-app:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…-remove-public-forms-app

* maintainance/4-remove-projects-app:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…ce/6-remove-public-lab-round-page

* maintainance/5-remove-public-forms-app:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…ainance/7-remove-standard-pages

* maintainance/6-remove-public-lab-round-page:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…/8-cookie-settings

* maintainance/7-remove-standard-pages:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…pdates

* maintainance/8-cookie-settings:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)
theskumar added a commit that referenced this pull request Jan 29, 2024
…-html

* maintainance/svg-updates:
  Remove public "partners" app
  Remove public primary nav (db) and "news" app (#3715)
  Fix errors for compare revisions page(JSONDecodeError and Invalid literal int error) (#3727)
  Add dir attribute to the html tag, ltr/rtl. (#3728)
  docs: remove duplicate info at references > workflows (#3730)
  Updated PR template to reflect testing practices (#3729)

# Conflicts:
#	hypha/templates/base-apply.html
#	hypha/templates/base.html
@frjo frjo deleted the enhancement/add-dir-attribute branch February 12, 2024 11:46
wes-otf pushed a commit that referenced this pull request May 7, 2024
wes-otf pushed a commit that referenced this pull request May 8, 2024
@frjo frjo removed the Status: Needs testing Tickets that need testing/qa label Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature This is something new (not an enhancement of an existing thing). Type: Patch Mini change, used in release drafter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve RTL support
3 participants