Closed kalinkrustev closed 1 year ago
Definitely interested in RTL support
Relates to #2263
Relates to #3096
OK, good to know that. Let me know if I can help with something, but at least for PrimeFlex, I think somebody with more experience can take good decision about how to address it, maybe based on the example I shared above.
@kalinkrustev 2 things.
Can you open a ticket on PrimeFlex Github issues with the changes you think you need: https://github.com/primefaces/primeflex And you can link back to this ticket.
If you are interested in Arabic translation can you donate one here to PrimeLocale: https://github.com/primefaces/primelocale Someone dontated an "fa" Farsi one but its not complete if you look at the "en_US" translation that has the complete list of values.
OK, will do. Point 2 is complete https://github.com/primefaces/primelocale/pull/43 Do you think the RTL support deserves a separate documentation page, where the components, that make sense are showcased? This is where the translations can be activated for demonstration.
Thanks merged your translation!
As for RTL examples here is what we do in PrimeFaces JSF. We have an RTL example on the page like this one: https://www.primefaces.org/showcase/ui/input/oneMenu.xhtml
But in PrimeFaces JSF we actually have an rtl="true"
property on each component as well as a global override if you want RTL enabled for the whole application.
I think the PrimeReact documentation pages can use the same way of choosing the language with a dropdown, so RTL can be observed in each page, though it is best observed when the texts are also written in the respective language.
The approach I proposed probably will not introduce a new component property, as it is based on the standard CSS attribute direction: rtl, which will also work on any level in the rendered markup. PrimeFlex can introduce two new classes: direction-rtl and direction-ltr for easier usage.
Yep I think the only issue we will run into is sometimes for RTL support in PRimeFaces JSF we had to manipulate the DOM or JS code as there were some things that just couldn't be done with CSS. But I like your idea though!
@kalinkrustev I added all your info to this ticket: https://github.com/primefaces/primereact/issues/3096 so you might want to subscribe to that ticket. I will close this one for now as a duplicate.
Describe the feature you would like to see added
Improve CSS, so that components are rendered automatically and appropriately for right to left languages. This will require changes in:
Is your feature request related to a problem?
No response
Describe the solution you'd like
I think the best way is to use [dir='rtl'] in the CSS selectors and address the specific cases where left/right attributes are affected.
Describe alternatives you have considered
What I tried (and it worked well, but not perfect) is to include some additional CSS rules, as per the below example. You can observe the results in this Storybook https://master--626d34151d5489004a1c5228.chromatic.com/?path=/story/form--table-ar
Additional context
While my solution worked, it does not feel right. Let me know if you are interested in including RTL support in the libraries. I can help with ideas and also with providing proper Arabic translations to test with.