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

🌐 Add Persian translation for docs/fa/docs/index.md and tweak right-to-left CSS #2395

Merged
merged 8 commits into from
Jul 20, 2022

Conversation

mohsen-mahmoodi
Copy link
Contributor

Hi

This is a PR to start the Persian documentation translation (lang=fa).
It includes only files generated by running python ./scripts/docs.py new-lang fa according to the Development - Contributing > Docs > Translations > New Language
You can track Persian translations on this issue: #2041

Thanks a lot.

@mohsen-mahmoodi mohsen-mahmoodi changed the title Start persian translation Start Persian translation Nov 23, 2020
@codecov
Copy link

codecov bot commented Nov 23, 2020

Codecov Report

Merging #2395 (3e2aa32) into master (e35df68) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##            master     #2395   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          532       532           
  Lines        13684     13684           
=========================================
  Hits         13684     13684           
Impacted Files Coverage Δ
fastapi/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 50fb34b...3e2aa32. Read the comment docs.

@github-actions
Copy link
Contributor

📝 Docs preview for commit d2b3bd8 at: https://5fbb0ee4596b760d25c8e452--fastapi.netlify.app

@github-actions
Copy link
Contributor

📝 Docs preview for commit c35c1f5 at: https://5fbbbcd8d3ff81c63ada460b--fastapi.netlify.app

@tiangolo tiangolo added awaiting-review lang-all Translations lang-fa Persian translations labels Nov 25, 2020
@mohsen-mahmoodi
Copy link
Contributor Author

Added index page translation to this PR.

Copy link

@onionj onionj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read the codes and the translations , and i see no problem in it.

Copy link

@TorhamDev TorhamDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very good idea 👌

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you! 🙇

I have a couple of questions about the CSS styles, that we would need to figure out a way to make them work with all the multi-language docs versions.

docs/fa/docs/css/rtl.css Outdated Show resolved Hide resolved
docs/fa/docs/css/rtl.css Outdated Show resolved Hide resolved
Comment on lines 13 to 15
.md-content__inner h1{
direction: ltr !important;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I see that most of these settings only set some elements to always be ltr, I think it would be safe to move them to the main CSS (at docs/en/docs/css/custom.css). That file is then copied to all the languages.

Also because when the MkDocs configs are regenerated the custom CSS for Persian would be overridden, so, if these CSS styles can be put in a way that applies to everything, it will all work correctly. But if it's absolutely needed to have custom CSS styles only for right-to-left languages, then I would need to figure out a way to support it in the scripts that generate the multi-language docs. 😬

But that would also depend on if the display: inline-block; are necessary or not...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the changes that make some styles ltr are safe in every other language and it makes sense because they are applied to codes and links and these two items are always ltr, no matter what the language is. But I will pull the latest changes and check if everything is OK before resolving this thread.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked it. Yes it is totally safe to move these ltr changes to the main CSS.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to check the latest changes and then reverted my branch to the final changes you made.

@tiangolo tiangolo changed the title Start Persian translation 🌐 Add Persian translation for docs/fa/docs/index.md and tweak right-to-left CSS Jul 20, 2022
@github-actions
Copy link
Contributor

📝 Docs preview for commit ff0c2f2 at: https://62d7f1b4f1a9454617ec76f2--fastapi.netlify.app

@tiangolo tiangolo enabled auto-merge (squash) July 20, 2022 12:22
@tiangolo
Copy link
Member

Thank you @mohsen-mahmoodi! 🙇 🚀

And thanks for the reviews @rabbitix, @onionj, @SepehrRasouli, @TorhamDev 🍰 ☕

@tiangolo tiangolo merged commit 3b58392 into fastapi:master Jul 20, 2022
JeanArhancet pushed a commit to JeanArhancet/fastapi that referenced this pull request Aug 20, 2022
…-to-left CSS (fastapi#2395)

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved-2 lang-all Translations lang-fa Persian translations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants