Skip to content

Add RTL support #51376

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

Merged
merged 4 commits into from
Jun 9, 2025
Merged

Add RTL support #51376

merged 4 commits into from
Jun 9, 2025

Conversation

guan404ming
Copy link
Contributor

@guan404ming guan404ming commented Jun 3, 2025

Related Issue

#51187
cc @bbovenzi @jscheffl @eladkal

Why

  • to support rtl lang we need to add "dir" attribute in <html>

How

  • add it dynamically using i18n-next api hook
  • determine the dir using i18n.dir()
  • add LocaleProvider align to official tutorial for chakra-ui
Screen.Recording.2025-06-04.at.1.07.49.AM.mov

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Jun 3, 2025
@guan404ming guan404ming changed the title Add rtl support Add RTL support Jun 3, 2025
Copy link
Contributor

@jscheffl jscheffl left a comment

Choose a reason for hiding this comment

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

Cool! That looks simple. I thought it is a bit more code needed.

Still I am a bit puzzled that the navbar does not go on the right side, would expect this for consistency. But would leave the vote to some native reader to feedback

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

Nice.

I also think the navbar should swap right, a simple flex box reverse should do the trick in the base layout.

Also some input have minor issues:
Screenshot 2025-06-04 at 18 36 28

@bbovenzi
Copy link
Contributor

bbovenzi commented Jun 4, 2025

I would like to defer to users like @Dev-iL if the would prefer the nav bar to be moved to the right side too.

@eladkal
Copy link
Contributor

eladkal commented Jun 4, 2025

Thanks for raising this!
I will test this change combined with the Hebrew translation tommorow

@guan404ming
Copy link
Contributor Author

Personally, I hate it when GUIs are mirrored and I stay away from HE software for that reason alone.

I've noticed the issue of the nav bar and I also saw some comments above. Thus, I think we should listen to native speakers' opinions to decide whether we should also mirror it.

@guan404ming
Copy link
Contributor Author

Also some input have minor issues:

@pierrejeambrun I couldn't find or reproduce this issue on my local machine. Could you tell me more about the detail for this issue? I could diagnose and fix it. Thanks!

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

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

In my picture above, some inputs do not have the arrow down icon that is mirrored properly.

Some of them do, but some don't and therefore the text is overlapping with the carret down.

Let me know if you also experience this.

@guan404ming
Copy link
Contributor Author

guan404ming commented Jun 5, 2025

In my picture above, some inputs do not have the arrow down icon that is mirrored properly.

Some of them do, but some don't and therefore the text is overlapping with the carret down.

Let me know if you also experience this.

I got it but it seems really strange. It would not overlap when I opened it with Chrome but it would be broken when I using Arc Browser to open it. The arrow down icon is not mirrored properly for both them. Diagnosing it currently.

Chrome

image image

Arc

image image

@Dev-iL
Copy link
Contributor

Dev-iL commented Jun 5, 2025

Chrome
image

Did you notice how "MetaDatabase" has the checkmark on the opposite side of the other tags?

Also, in the 2nd chrome screenshot each deopdown seems to be mirrored differently.

@eladkal
Copy link
Contributor

eladkal commented Jun 6, 2025

I reviewed several pages and it looks good.

Screenshot 2025-06-06 at 18 53 12

Most of the things that don't work properly are due to translations issues so I will address them
There is one thing with strings that start with numbers they are not aligned properly. The number should be first.
Screenshot 2025-06-06 at 18 58 34

@eladkal eladkal added the type:new-feature Changelog: New Features label Jun 7, 2025
@jscheffl
Copy link
Contributor

jscheffl commented Jun 9, 2025

I reviewed several pages and it looks good.

Hi @eladkal Thanks for the review. I was missing a (more) clear statement if switching to RTL means that navbar also need to switch or if it is rather "better"/okay to keep it left. For me it is a bit tstrange to switch all to RTL but keeping the navbar left. But I am not an expert in this topic.

...or @shahar1 do you have an opinion?

@guan404ming
Copy link
Contributor Author

guan404ming commented Jun 9, 2025

Hi @eladkal @Dev-iL, after my investigation, the select issue is fixed by manual add style for RTL on IndicatorGroup which seems like the chakra-ui issue and I could help open a fix pr to chakra-ui.

I also upgrade our chakra-ui package from 3.17.0 to 3.20.0 version since it has some rtl fixes which would reduce the manual fix above.

Please take another look and let me know if there is anything need modifications, thanks!

Current ui looks like

Screen.Recording.2025-06-09.at.4.39.53.PM.mov

@shahar1
Copy link
Contributor

shahar1 commented Jun 9, 2025

I reviewed several pages and it looks good.

Hi @eladkal Thanks for the review. I was missing a (more) clear statement if switching to RTL means that navbar also need to switch or if it is rather "better"/okay to keep it left. For me it is a bit tstrange to switch all to RTL but keeping the navbar left. But I am not an expert in this topic.

...or @shahar1 do you have an opinion?

In general, I think that the menu should be on the right - that's how it works in Wikipedia, for example.
Is it complicated to implement?

@eladkal
Copy link
Contributor

eladkal commented Jun 9, 2025

In general, I think that the menu should be on the right - that's how it works in Wikipedia, for example. Is it complicated to implement?

I agree

@guan404ming
Copy link
Contributor Author

In general, I think that the menu should be on the right - that's how it works in Wikipedia, for example.
Is it complicated to implement?

Sure, that makes sense. it's not complex to implement. It would look like

image

@Dev-iL
Copy link
Contributor

Dev-iL commented Jun 9, 2025

In general, I think that the menu should be on the right - that's how it works in Wikipedia, for example. Is it complicated to implement?

No objections here, it is the known convention after all.

@Dev-iL
Copy link
Contributor

Dev-iL commented Jun 9, 2025

Sure, that makes sense. it's not complex to implement. It would look like
image

You know, I actually prefer this for the English version. Any chance we can make the navbar side user-configurable and not language-specific?

@guan404ming
Copy link
Contributor Author

You know, I actually prefer this for the English version. Any chance we can make the navbar side user-configurable and not language-specific?

Maybe we could open another issue for it to make sure if there are many people love this feature as well. I think it is not complex to implement but this change needs community's support~

Copy link
Contributor

@eladkal eladkal left a comment

Choose a reason for hiding this comment

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

LGTM

There are more stuff we need to fix but this is a good start. Lets handle them with improvment PRs.

@eladkal eladkal merged commit d52ce42 into apache:main Jun 9, 2025
43 checks passed
@eladkal eladkal mentioned this pull request Jun 9, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers. type:new-feature Changelog: New Features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants