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

RTL support #93

Closed
KirilNN opened this issue Nov 17, 2016 · 12 comments
Closed

RTL support #93

KirilNN opened this issue Nov 17, 2016 · 12 comments

Comments

@KirilNN
Copy link

KirilNN commented Nov 17, 2016

After the initial research it looks like there are two approaches which we can use to solve the RTL compatibility:

  1. Use an application wide token, similar to the localisation API, that will set the RTL state for the application, and then every single component can detect this state and act accordingly (mainly tweak the kb nav support). However I am not sure how we can act on 'per component' basis and set the dir attribute on an individual component, same as in this plain scenario.

  2. Use RTL directive that will set the orientation per component. A component that does not have the directive can use the DI to find a parent with such directive and act accordingly. With this approach we can fully emulate the scenario that I linked in the Dojo. The directive can be set on the first component of the hierarchy and act as an application wide token.

  3. A mix of both? Might lead to customer confusion and some side effects.

Any thoughts? Suggestions?

@tsvetomir
Copy link
Member

I'm not convinced for the case of per-component text direction. You can have text runs with individual direction, e.g. to display English text on a Hebrew site, but the site has only one text direction.

I vote for 1) as it will handle the most common case and is flexible enough to allow having "islands" of text with different direction.

@rusev
Copy link

rusev commented Nov 17, 2016

A token solution is very Angular-like. One can achieve direction switching by wrapping in higher order component and providing different value for the token.

That said I vote for the first option as well.

@rkonstantinov
Copy link

I do think that the Token approach is flexible enough for the most common scenarios.

@petyosi
Copy link
Contributor

petyosi commented Nov 17, 2016

Option 1 sounds like the common case to me.

@KirilNN
Copy link
Author

KirilNN commented Nov 18, 2016

@tsvetomir @rusev @rkonstantinov @petyosi thanks for the input, now there is one more question - how do we provide the token for the RTL. I think that there are 3 approaches here:

  1. Create kendo-angular-rtl package, that exports just a OpaqueToken and direction type (maybe overkill).
  2. Include the RTL token in the Intl pakcage - the problem here is that if you need just RTL you will also get the Intl which really is a big chunk!
  3. Ask customer to use a string provider in their module, something like:

providers: [{ provide: 'kendo-rtl', useValue: 'ltr' }]

Or is it now the time for the long awaited common package?

@rusev
Copy link

rusev commented Nov 18, 2016

Case 3 is easy one.

However if later we decide to use OpaqueToken it will be a breaking change.

@tsvetomir
Copy link
Member

Are we going to share any helpers, e.g. a directive that sets the necessary CSS classes? If so, a mini-package might be justified.

@KirilNN
Copy link
Author

KirilNN commented Nov 18, 2016

We are not going to have any CSS that is RTL related.

@tsvetomir
Copy link
Member

A string should be good for starters then. We can add a package later if there's actual need.

@KirilNN
Copy link
Author

KirilNN commented Nov 21, 2016

Alright. Thanks for all the input

@KirilNN KirilNN closed this as completed Nov 21, 2016
@yaronmil
Copy link

is it posibole at this time to generate rtl grid ?

@KirilNN
Copy link
Author

KirilNN commented Dec 15, 2016

There is no specific RTL implementation for the Grid atm.

@telerik telerik locked and limited conversation to collaborators Jan 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants