chatwoot
chatwoot copied to clipboard
feat: Add RTL Support for widget and portal.
Pull Request Template
Description
This pull request introduces RTL (Right-To-Left) support to widgets and portals, ensuring compatibility with languages that utilize RTL layouts. It features the introduction of a new rtlMixin
specifically designed for widgets, alongside updates to the existing rtlMixin
for the dashboard. This update leverages Tailwind CSS's utility classes for dynamic layout direction based on the dir
attribute.
e.g.:
<div class="flex rtl:flex-row-reverse">
.example {
text-align: left;
[dir='rtl'] & {
text-align: right;
}
}
A new Ruby initializer (~/config/initializers/i18n_extensions.rb
) has been added to automatically set the document language and direction.
Supported languages include:
-
ar
(Arabic) -
arc
(Aramaic) -
dv
(Divehi) -
fa
(Persian) -
ha
(Hausa) -
he
(Hebrew) -
khw
(Khowar) -
ks
(Kashmiri) -
ku
(Kurdish) -
ps
(Pashto) -
ur
(Urdu) -
yi
(Yiddish)
Fixes #7407 #7141
Examples:
RTL | LTR |
---|---|
Type of change
- [x] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
This feature was tested in a local development environment using unit tests to verify that changes correctly apply RTL styles based on the dir
attribute. Manual testing was also performed to ensure that widgets and portals render appropriately in supported RTL languages.
Checklist:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream modules
@nawafinity is this ready for test? I could help.
@scmmishra it would've been great to have text direction settings in widget and kb portal. This way I can keep my chatwoot UI in English and have the chat widget correctly set to RTL.
i like this feature to be merged its so useful !
Hey @scmmishra,
I will make these changes this week and finalize this PR.
@hadifarnoud, itβs almost ready. Iβm currently running some tests and preparing to update the branch.
This PR will be finalized as soon as possible.
Thank you, Nawaf
π’ Turtley slow progress alert! This pull request has been idle for over 30 days. Can we please speed things up and either merge it or release it back into the wild?
Wonderful, any updates?
any news about this issue?
any news about this issue?