Skip to content

Add Right To Left Support #5035

Closed
Closed

Description

@mhartington

From @mashaly100200 on December 30, 2015 17:24

kindly add support rtl to animation and the components

Copied from original issue: driftyco/ionic2#832

Activity

  1. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @adamdbradley on December 30, 2015 17:38

    Yes this is on our roadmap to complete and we would love to get more feedback from experienced RTL dev's to help us point out where we need to improve. Would you be able to provide a checklist of certain parts of ionic2 that do not work well with RTL. Our goal would be to provide an additional RTL css file, and have any JS adjust accordingly depending if the html element has dir="rtl" or not. Thanks

  2. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 18:39

    It's my pleasure to help ionic2 team to support RTL
    firest it's easy to watch what are the bad effects if we use rtl direction
    we can add this attr to html tag that will convert all website to to rtl

    or we can use it in the body as a style like this style="direction:rtl"

    if ionic team plan to support rtl

    thay will need to add the target direction in App configurations , because the application will need to know what is the direction on the start up
    , and if the developer need to change the app language to rtl language in runtime then we should refresh all app (like native android,windows phone app , ios need to restart the application to change it's direction)

    now when i try to change ionic2 html direction i found that there are things aleady support rtl direction coz pure html konw how to deal with rtl direction
    but thare are things need to be support rtl direction
    first thing is animation
    i donn't know if ionic team do the animation with css or javascript code , in both cases all animation witch have rtl or ltr will need to add another animation direction , not only change varialbe but add another one coz many things will need to change

    I would like to provide assistance as i can to ionic team to help in this great library

    i know my English is not good , but i hope you understand my words :)

  3. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 18:44

    plz change this goal " Our goal would be to provide an additional RTL css file "
    because we need the two direction in the same application , based on the user's choice , some time it will be in runtime

  4. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @adamdbradley on December 30, 2015 18:51

    we need the two direction in the same application , based on the user's choice , some time it will be in runtime

    Ionic itself will be able to dynamically add this css file for you, depending on the <html dir="rtl">

  5. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 19:23

    these imgs from trying to change direction of onic-conference-app example
    if ionic team cover the rtl direction in this example i think it will be not less than 90% of rtl support

    Image of Yaktocat

  6. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 19:26

    Image of Yaktocat

  7. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 19:27

    Image of Yaktocat

  8. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 30, 2015 20:21

    any icon which are right,left,back or forward arrow like back-button icon will need this style
    {
    -webkit-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -o-transform: rotate(180deg);
    -ms-transform: rotate(180deg);
    transform: rotate(180deg);
    }

  9. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @adamdbradley on December 31, 2015 4:27

    So @brandyscarney had a good idea that we create all the RTL scss files within the repo and get them ready to be filled.

    I was thinking that instead of dynamically adding another rtl css, we could have a default $rtl-support: false sass variable that can be updated in each app's sass variables. So in most cases the extra rtl css wouldn't be added to apps, but for those who require the rtl css they can set $rtl-support: true.

    Then within our new rtl scss files, the css can be wrapped with @if $rtl-support. This way we can keep the css files separated and easier to edit, and provide rtl support out of the box. Think this will work @mashaly100200 ?

  10. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on December 31, 2015 11:48

    yes load rtl dynamically is a good idea ,

    let us start with animation , coz it may be need more effort

    • i want to know is it possible to add specific page transition animation when do push and pop pages ?
    • and how developer add this specific animation to the tow pages witch enter and leave ?
    • can developer watch back event then add his specific animation also to the two pages ?

    if your answer are yes for the previous three questions , then i can congratulate my self coz animation topic don't need any effort and full support rtl direction and ionic team deserve a very big thanks :)

  11. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @adamdbradley on January 1, 2016 1:53

    This is the transition animation for ios: https://github.com/driftyco/ionic2/blob/master/ionic/animations/ios-transition.ts

    Not sure if this should add logic for RTL, or if there should be a new animation instead. You can however add your own transition, and override the pageTransition config: https://github.com/driftyco/ionic2/blob/master/ionic/config/modes.ts#L24

  12. mhartington commented on Jan 18, 2016

    @mhartington
    ContributorAuthor

    From @mashaly100200 on January 1, 2016 21:55

    hi @adamdbradley , merry christmas

    i finished a custom animation class which reverse the default animation class behavior depend on documen.dir
    https://gist.github.com/mashaly100200/bf713f2b558285322155
    i tested it , and i will test it in real projects soon (inshaa allah)

    also i finished some of css classes that was need to be reversed
    https://gist.github.com/mashaly100200/dc23529e570034b0dfb9

    and if i face more classes need to be reversed , i will add it to this file until i finish one or two real project

    also rtl need these configurations in app constructor
    https://gist.github.com/mashaly100200/692160b036422d7b018c

    i was trying to add all configuration in one place so i found that i can add all things in the app contractor

    hope these things can help to make ionic2 fully support rtl

    Please feel free to add any corrections or suggestions .

  13. 60 remaining items

  14. AmitMY commented on May 24, 2017

    @AmitMY
    Contributor

    You set your default 'dir' on the HTML tag, and if you want to change it in runtime, you do 'this.platform.setDit('rtl', true)'.

    Don't use the dir attribute anywhere else, as nested directions are not supported.

    Finally, please use the nightly version, as it is more RTL ready than 3.2.1

    If you have any other support questions, please use the ionic forum, and for bugs/features use github

  15. joesleiman commented on May 24, 2017

    @joesleiman

    @msoni11 no ionic 3.2.0

  16. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY i'm using in all my app in every root tag [att.dir]='isRtl? 'rtl':'ltr'' (in every form : like ion-content)
    isn't good ?

  17. Khalid-Nowaf commented on May 24, 2017

    @Khalid-Nowaf

    @joesleiman
    for now, I use material design page transition only, which is an alternative to avoid page transition from left to right.

    // in app.module.ts
    .
    .
    imports: [
        BrowserModule,
        IonicModule.forRoot(MyApp, {
           pageTransition: 'md-transition' // change the page Transition to avoid "LRT" page Transition 
        })
    .
    .
  18. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY how can i change the back button icon to right arrow instead of left arrow (when change it to rtl)

  19. AmitMY commented on May 24, 2017

    @AmitMY
    Contributor

    @joesleiman No, having dir="rtl" on ion-content is not guaranteeing support. You should always use this.platform.setDir('rtl', true) and remove all of the dir attributes except the one in the html tag. It also controls direction of ionic components from typescript, such as gestures. (note that setDir with true also updates the html tag with the correct dir)

    About the back button, if you use the proper way to set direction, as mentioned above, it will flip your arrows, as done here - #11634. It is only available in the nightly version, and a new version (3.3.0) will be released later today.

    I ask again, please, for these kind of support questions use the forum. Github is for bugs/feature requests.

    You can read more about RTL here - https://github.com/AmitMY/ionic-site/blob/543cc0dd6d198edd5aa2a9a31ac5bd4702ef5332/content/docs/rtl-support/index.md
    This is the official RTL documentation, but it is not yet done so it is not in the website.

  20. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY ok i will do ... thank you so much ,

  21. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY if the user put this.platform.setDir('rtl',true); and close the app and then return to it how can i save for html tag dir='rtl' . so isn't good idea to use it. because it return to dir="ltr"

  22. AmitMY commented on May 24, 2017

    @AmitMY
    Contributor

    @joesleiman So if your app is multidirectional, and you use the user preferences to decide which side, I would recommend using NativeStorage, and storing for the key "preferences" the object: {lang: "he", dir: "rtl"}, and then in app.component.ts on platform.ready check if the user has preferences. If he does, apply them by setDir.

    No other solution for now.

  23. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY when i use setDir : still the ion-select >> ion-alert : have issue in rtl direction on md (android)

  24. joesleiman commented on May 24, 2017

    @joesleiman

    @AmitMY i solved it by this :
    html[dir="rtl"] .alert-md .alert-radio-icon {
    left: 0px;
    right: 13px;
    }

  25. AmitMY commented on May 24, 2017

    @AmitMY
    Contributor

    I think you are not using the nightly version as I suggested (3.2.1-201705231529), and if you are using it, it is a case of overridden style, and it is fixed here #11635

  26. joesleiman commented on May 24, 2017

    @joesleiman
  27. ionitron-bot commented on Sep 2, 2018

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  28. locked and limited conversation to collaborators on Sep 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

help wanted

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions