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

Set RTL direction only for one languages not for whole of the languages #2

Open
BaseMax opened this issue Jun 7, 2021 · 3 comments

Comments

@BaseMax
Copy link

BaseMax commented Jun 7, 2021

Hi there;

Is there a way to keep a language RTL?
We are going to have several different languages, one of which is RTL.

Any guidance and help is appreciated.

@ckoliber
Copy link
Owner

ckoliber commented Jun 7, 2021

@BaseMax
You can use <bdo> tags for RTL strings in a LTR context

Set the configuration as bellow:

<script>
    window.$docsify = {
        rtl: {
            body: "ltr",
            side: "ltr",
            bdo: "rtl"
        }
    };
</script>

@BaseMax
Copy link
Author

BaseMax commented Jun 7, 2021

Hello @ckoliber;

Thanks, But I want to move sidebar and other it's text to right side.

It's what I'm trying..

<style>
/* Persian and Arabic language */
body[data-page^="fa/"] {
  direction: rtl !important;
  text-align: right !important;
  /*--sidebar-width:;*/
}
body[data-page^="fa/"] .sidebar {
  transform: none !important;
  right: 0px !important;
}
body[data-page^="fa/"].close .sidebar {
  right: -300px !important;
}
@media (min-width: 48em) {
  body[data-page^="fa/"] .sidebar+.content {
    margin-left: 0px !important;
    margin-right: var(--sidebar-width) !important;
  }
}
body[data-page^="fa/"] .app-nav {
  left: 30px;
}
body[data-page^="fa/"] .sidebar-toggle {
  transform: none !important;
  right: var(--sidebar-width) !important;
}
body[data-page^="fa/"].close .sidebar-toggle {
  transform: none !important;
  right: 0px !important;
}
@media (min-width: 48em) {
  nav.app-nav {
    margin-left: 0px !important;
    margin-right: var(--sidebar-width) !important;
  }
}
</style>

It's not ready yet and I still need help.

Our documentation has multi-languages. one is LTR and the other is RTL.

@ckoliber
Copy link
Owner

ckoliber commented Jun 7, 2021

Instead of adding custom css code based on your page language, set the plugin config dynamically

For Persian language try rtl body and side, and for English language set direction of body and side to ltr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants