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

Translate documentation into Simplified Chinese #3346

Merged
merged 30 commits into from
Sep 15, 2024

Conversation

GeorgeHu6
Copy link
Contributor

Pull Request Checklist

  • Ensured tests pass and (if applicable) updated functional test output
  • Conformed to code style guidelines by running appropriate linting tools
  • Added tests for changed code
  • Updated documentation for changed code

@justinmayer
Copy link
Member

Hi George. Are the translations fully up-to-date with documentation in the current main branch? Including, for example, the documentation addition in #2761?

@GeorgeHu6
Copy link
Contributor Author

Yes, all of the translations are fully up-to-date.

@justinmayer
Copy link
Member

Excellent! If I may ask, how do you intend to ensure that the translation stays in-sync and up-to-date with documentation changes in the future? Just curious! 😊

@GeorgeHu6
Copy link
Contributor Author

At present, I will manually check the update of the doc. Recently, I have been working on my workflow system which makes it possible to keep me informed of doc updates.

@justinmayer
Copy link
Member

Given that I have never used Sphinx in a multilingual context, could you let me know the exact steps needed to build and view the Chinese version of the Pelican documentation?

@GeorgeHu6
Copy link
Contributor Author

OK, Chinese version of documentation can be built as following steps:

  1. download all the po files to docs/locale/zh_CN/LC_MESSAGES
  2. Run sphinx-build -b html -D language=zh_CN . ./_build/html/zh_CN/ in folder docs (make sure locale_dirs = ["locale/"] has been set in conf.py) and all of the translated HTML files will be generated in docs/_build/html/zh_CN .

@justinmayer
Copy link
Member

Thank you, George. Here are the (slightly modified) steps I took to locally view the Chinese documentation:

cd ~/Projects/pelican/
gh pr checkout 3346
cd docs
sphinx-build -b html -D language=zh_CN . ./_build-zh_CN/
python -m http.server -d _build-zh_CN

… after which I was able to view the Chinese documentation at: http://localhost:8000 🎉

I don't understand exactly what is required on the ReadTheDocs side of the equation, although it is possible that the only necessary step is to create a separate pelican-zh_CN RtD project and associate it with Chinese, as documented here: https://docs.readthedocs.io/en/stable/localization.html#projects-with-multiple-translations-sphinx-only

@GeorgeHu6
Copy link
Contributor Author

Yeah, it is very convenient to add a translation version of project in RtD. After doing some tests in my own RtD account, I came up with a way to add a translation to an existing RtD project:

  1. Create a new RtD project and make sure the project meet the following requirements:
    • set locale_dirs in conf.py
    • translated po files in the directory which set by locale_dirs
    • set the language of RtD project as "Simplified Chinese"
  2. After the new RtD project is built, add the new project to the "Translations" section of original project

@justinmayer
Copy link
Member

Hi @GeorgeHu6. Would you be willing to update your Chinese translation of the documentation to include the Skip Posts feature from #3305? Once you have added a translation for this new feature, I would like to merge this pull request and issue a new Pelican release 😊

@GeorgeHu6
Copy link
Contributor Author

Sure, Chinese translation of the documentation is totally up to date now.

@justinmayer justinmayer changed the title Complete the Chinese translation of docs Translate documentation into Simplified Chinese Sep 15, 2024
Copy link
Member

@justinmayer justinmayer left a comment

Choose a reason for hiding this comment

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

Many thanks for all your work on this translation, George. I am pleased to add this to Pelican. Much appreciated! 🥇

@justinmayer justinmayer merged commit e609b4d into getpelican:main Sep 15, 2024
16 checks passed
@justinmayer
Copy link
Member

Translation is now live! 🎉 https://docs.getpelican.com/en/latest/ ➡️ (tap Flyout Menu) ➡️ Languages ➡️ zh-cn

@GeorgeHu6
Copy link
Contributor Author

Yeah! Thank you all guys. I will try to keep the Chinese translation up to date.

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

Successfully merging this pull request may close these issues.

2 participants