mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-12 14:45:38 -06:00
feat: RTL support #871
Closed
opened 2025-11-11 14:32:45 -06:00 by GiteaMirror
·
7 comments
No Branch/Tag Specified
main
dev
v0.13.3
v0.13.2
v0.13.1
v0.13.0
v0.12.5
v0.12.4
v0.12.3
v0.12.2
v0.12.1
v0.12.0
v0.11.4
v0.11.3
v0.11.2
v0.11.1
v0.11.0
v0.10.2
v0.10.1
v0.10.0
v0.9.6
v0.9.5
v0.9.4
v0.9.3
v0.9.2
v0.9.1
v0.9.0
v0.8.12
v0.8.11
v0.8.10
v0.8.9
v0.8.8
v0.8.7
v0.8.6
v0.8.5
v0.8.4
v0.8.3
v0.8.2
v0.8.1
v0.8.0
v0.7.2
v0.7.1
v0.7.0
v0.6.43
v0.6.42
v0.6.41
v0.6.40
v0.6.39
v0.6.38
v0.6.37
v0.6.36
v0.6.35
v0.6.34
v0.6.33
v0.6.32
v0.6.31
v0.6.30
v0.6.29
v0.6.28
v0.6.27
v0.6.26
v0.6.25
v0.6.24
v0.6.23
v0.6.22
v0.6.21
v0.6.20
v0.6.19
v0.6.18
v0.6.17
v0.6.16
v0.6.15
v0.6.14
v0.6.13
v0.6.12
v0.6.11
v0.6.10
v0.6.9
v0.6.8
v0.6.7
v0.6.6
v0.6.5
v0.6.4
v0.6.3
v0.6.2
v0.6.1
v0.6.0
v0.5.20
v0.5.19
v0.5.18
v0.5.17
v0.5.16
v0.5.15
v0.5.14
v0.5.13
v0.5.12
v0.5.11
v0.5.10
v0.5.9
v0.5.8
v0.5.7
v0.5.6
v0.5.5
v0.5.4
v0.5.3
v0.5.2
v0.5.1
v0.5.0
v0.4.8
v0.4.7
v0.4.6
v0.4.5
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.35
v0.3.34
v0.3.33
v0.3.32
v0.3.31
v0.3.30
v0.3.29
v0.3.28
v0.3.27
v0.3.26
v0.3.25
v0.3.24
v0.3.23
v0.3.22
v0.3.21
v0.3.20
v0.3.19
v0.3.18
v0.3.17
v0.3.16
v0.3.15
v0.3.14
v0.3.13
v0.3.12
v0.3.11
v0.3.10
v0.3.9
v0.3.8
v0.3.7
v0.3.6
v0.3.5
v0.3.4
v0.3.3
v0.3.2
v0.3.1
v0.3.0
v0.2.5
v0.2.4
v0.2.3
v0.2.2
v0.2.1
v0.2.0
v0.1.125
v0.1.124
v0.1.123
v0.1.122
v0.1.121
v0.1.120
v0.1.119
v0.1.118
v0.1.117
v0.1.116
v0.1.115
v0.1.114
v0.1.113
v0.1.112
v0.1.111
v0.1.110
v0.1.109
v0.1.108
v0.1.107
v0.1.106
v0.1.105
v0.1.104
v0.1.103
v0.1.102
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/open-webui#871
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @liorkesos on GitHub (May 9, 2024).
Is your feature request related to a problem? Please describe.
To enable multi-lingual support for Arabic , hebrew , Farsi etc most apps have RTL capabilities.
This is needed for optimal experience for these languages
Describe the solution you'd like
The CSS implementation needs to know that certain languages should have a RTL layout
@justinh-rahb commented on GitHub (May 9, 2024):
Great idea, a PR would be welcomed!
@liorkesos commented on GitHub (May 12, 2024):
I'll issue a PR for the hebrew translation and see how I can bring them both to a stage where they give a good hebrew user experience.
@liorkesos commented on GitHub (May 13, 2024):
Basic RTL can be easily added if we map certain languages to RTL and than push dir="RTL" to the HTML tag.
That does a decent job (I checked it in my browser)
tailwind implicit RTL support lets us yuse the rtl and ltr modifiers.
The only thing I don't know is how to inject the class or attribute based on a certain trigger (choice of lang)
If anybody can give me the basic direction I can attempt to implement.
@LebToki commented on GitHub (May 14, 2024):
Here's a possible solution:
First, you need to detect the chosen language and store it in a variable.
You can use the navigator.language property or a library like i18n-js to detect the language.
Once you have the chosen language, you can use JavaScript to add the dir attribute to the HTML tag.
You can use the setAttribute method to add the attribute.
To use the Tailwind classes, you need to add the rtl or ltr class to the HTML tag based on the chosen language. You can use the classList.add method to add the class.
Here's some code to get you started:
// Detect the chosen language
const language = navigator.language || navigator.userLanguage;
// Add the dir attribute to the HTML tag
document.documentElement.setAttribute('dir', language === 'ar' || language === 'he' ? 'rtl' : 'ltr');
// Add the Tailwind classes
document.documentElement.classList.add(language === 'ar' || language === 'he' ? 'rtl' : 'ltr');
This is also try that then we can pass font-family and css property to get things shape up
@idomamia commented on GitHub (May 15, 2024):
Hey, I've recently started developing something similar.
In the settings, under the "Interface" section, I implemented a toggle button that allows users to switch between LTR and RTL layouts.
Additionally, I thought it would be useful to restrict the RTL layout to only apply to the Chat section (Code blocks will always remain LTR). What are your thoughts on this?
Here's a gif of my implementation:

@endlessblink commented on GitHub (Dec 8, 2024):
Is this something that has been implemented yet?
@merrime-n commented on GitHub (May 1, 2025):
I found the toggle button in user settings and it works. Is there an environment variable so that we can have a default chat direction for the whole Open WebUI instance?