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

[UG] Add RTL config section #2098

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 27 additions & 3 deletions userguide/content/en/docs/language/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Multi-language Support
weight: 7
description: Support multiple languages in your site.
cSpell:ignore: Goldydocs rtlcss subdir operativsystem skyen Norsk
---

If you'd like to provide site content in multiple languages, the Docsy theme and
Expand All @@ -12,9 +13,9 @@ navigate between language versions.

To add content in multiple languages, you first need to define the available
languages in a `languages` section in your site configuration. Each language can
have its own language-specific configuration. For example, the Docsy Example
Site config specifies that it provides content in English and Norwegian, and
that the language version visitors will see by default is English:
have its own language-specific configuration. For example, the [Docsy example]
site config specifies that it provides content in English, Norwegian, and
Persian. The default language is English:

<!-- prettier-ignore-start -->
{{< tabpane >}}
Expand Down Expand Up @@ -125,6 +126,27 @@ For adding multiple language versions of other site elements such as button
text, see the [internationalization bundles](#internationalization-bundles)
section below.

### Right-to-left languages

Docsy supports top-down Right-To-Left (RTL) languages such as Persian through
[Bootstrap's RTL feature][bs-rtl], which uses [RTLCSS].

If your multilingual site includes an RTL language (configured with
`languageDirection: rtl`), then your project needs to include the [`rtlcss`
package]. You can add this package to your dev dependencies as follows:

```sh
npm install rtlcss --save-dev
```

For an example of Docsy's RTL support, see the [Persian pages] of the [Docsy
example].

[bs-rtl]: https://getbootstrap.com/docs/5.3/getting-started/rtl/
[RTLCSS]: https://rtlcss.com/
[`rtlcss` package]: https://www.npmjs.com/package/rtlcss
[Persian pages]: https://example.docsy.dev/fa/

## Selecting a language

If you configure more than one language in your
Expand Down Expand Up @@ -160,3 +182,5 @@ directory. For example, if you want to override any of Docsy's
create your own `/i18n/en.toml` with just your custom strings. Any values you
specify in this file will override the theme versions, while the remaining
strings will come from the theme's corresponding internationalization bundle.

[Docsy example]: https://example.docsy.dev/