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

Improve handling of RTL languages #395

Closed
wants to merge 1 commit into from
Closed

Improve handling of RTL languages #395

wants to merge 1 commit into from

Conversation

delucis
Copy link
Member

@delucis delucis commented Apr 28, 2022

This PR stores each language’s writing direction in src/i18n/languages.ts to avoid needing to specify it in Markdown frontmatter (which is what Arabic has done up until now).

This allows us to layout RTL-language pages correctly even when they contain LTR fallback content. After #365 the site navigation was on the right on the Arabic “Getting Started” page as expected, but on the left for fallback pages. Making this a per-language and not a per-page setting makes this consistent.

Just to demonstrate what this fixes, here are two Arabic pages as they render currently:

Arabic content Fallback content
image image

This commit also updates the add-language script to collect writing direction.

Stores each language’s writing direction in the languages file to avoid needing to specify it in Markdown frontmatter as Arabic has done up until now.

This also allows us to layout RTL-language pages correctly even when they contain LTR fallback content. After #365 the site navigation was on the right on the Arabic “Getting Started” page, but on the left for fallback pages. Making this a per-language and not a per-page setting makes this consistent.

This commit also updates the `add-language` script to collect writing direction.
@netlify
Copy link

netlify bot commented Apr 28, 2022

Deploy Preview for astro-docs-2 ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9440181
🔍 Latest deploy log https://app.netlify.com/sites/astro-docs-2/deploys/626affdf5457bb0008e5f4cb
😎 Deploy Preview https://deploy-preview-395--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sarah11918 sarah11918 added i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! site improvement Some thing that improves the website functionality - ask @delucis for help! labels Apr 30, 2022
@delucis
Copy link
Member Author

delucis commented May 4, 2022

Closing this as it complicates our languages dictionary and won't be needed for now.

@delucis delucis closed this May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! site improvement Some thing that improves the website functionality - ask @delucis for help!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants