Skip to content

Add Simplified Chinese translation of a_tour_of_sage and tutorial #39792

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

Merged
merged 13 commits into from
Apr 29, 2025

Conversation

fisheryv
Copy link
Contributor

@fisheryv fisheryv commented Mar 26, 2025

Sagemath has long been without Simplified Chinese translations for its tutorials, which I believe significantly hinders the use and spread of SageMath. Therefore, I've decided to initiate a project to translate all tutorials into Simplified Chinese, striving for the translations to be faithful, fluent, and elegant. Here is the Simplified Chinese translation of a_tour_of_sage and sage_tutorial.

I think we can closed the issue #9577 and #12559 .

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

@tscrim
Copy link
Collaborator

tscrim commented Mar 28, 2025

There already was a translation to Chinese (I think simplified) of some parts of the introduction to SageMath: #9577, #12559. The problem why they were not merged was technical with the documentation not building properly (I think only in the pdf doc) IIRC. This might still be an issue that needs to be addressed.

@fisheryv
Copy link
Contributor Author

There already was a translation to Chinese (I think simplified) of some parts of the introduction to SageMath: #9577, #12559. The problem why they were not merged was technical with the documentation not building properly (I think only in the pdf doc) IIRC. This might still be an issue that needs to be addressed.

Thank you @tscrim .

I am able to successfully generate HTML documents on my local machine. Now, I will focus on resolving the problem where simplified Chinese documents fail to convert to PDF format correctly.

@fisheryv
Copy link
Contributor Author

Hi, @tscrim

I think I have fixed the problem where simplified Chinese documents fail to convert to PDF. The attachment contains a Simplified Chinese PDF document of a_tour_of_sage that I generated locally.

a_tour_of_sage.pdf

Copy link

github-actions bot commented Mar 31, 2025

Documentation preview for this PR (built with commit bf25803; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@tscrim
Copy link
Collaborator

tscrim commented Mar 31, 2025

Can I ask one other thing? You don't need to do this in order to get a positive review, but this seems like a good place to do it.

Could you also merge in the translation of the tutorial #9577 into your PR? You can find instructions how to get the old branch here.

@dimpase
Copy link
Member

dimpase commented Apr 1, 2025

it seems to me that the CI is running lualatex rather than xelatex, and this might explain
https://github.com/sagemath/sage/actions/runs/14165616732/job/39688003779?pr=39792#step:12:19456
and the subsequent error. I'd rather see luatex used throughout, as this is the engine recommended over xelatex.

Is it possible/easy to change?

@dimpase
Copy link
Member

dimpase commented Apr 1, 2025

here is the actual error:

2025-03-31T13:18:44.5282148Z [sagemath_doc_pdf-none] [spkg-install] Running 'xelatex --file-line-error --interaction=batchmode  -recorder  "a_tour_of_sage.tex"'
2025-03-31T13:18:44.5282258Z [sagemath_doc_pdf-none] [spkg-install] ------------
2025-03-31T13:18:44.5282584Z [sagemath_doc_pdf-none] [spkg-install] This is XeTeX, Version 3.141592653-2.6-0.999995 (TeX Live 2023/Debian) (preloaded format=xelatex)
2025-03-31T13:18:44.5282741Z [sagemath_doc_pdf-none] [spkg-install]  restricted \write18 enabled.
2025-03-31T13:18:44.5282885Z [sagemath_doc_pdf-none] [spkg-install] entering extended mode
2025-03-31T13:18:44.5283184Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Missing input file 'ctexhook.sty' (or dependence on it) from following:
2025-03-31T13:18:44.5283383Z [sagemath_doc_pdf-none] [spkg-install]   ! LaTeX Error: File `ctexhook.sty' not found.
2025-03-31T13:18:44.5283628Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Sometimes, the -f option can be used to get latexmk
2025-03-31T13:18:44.5283810Z [sagemath_doc_pdf-none] [spkg-install]   to try to force complete processing.
2025-03-31T13:18:44.5284065Z [sagemath_doc_pdf-none] [spkg-install]   But normally, you will need to correct the file(s) that caused the
2025-03-31T13:18:44.5284226Z [sagemath_doc_pdf-none] [spkg-install]   error, and then rerun latexmk.
2025-03-31T13:18:44.5284488Z [sagemath_doc_pdf-none] [spkg-install]   In some cases, it is best to clean out generated files before rerunning
2025-03-31T13:18:44.5284676Z [sagemath_doc_pdf-none] [spkg-install]   latexmk after you've corrected the files.
2025-03-31T13:18:44.5284879Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Getting log file 'a_tour_of_sage.log'
2025-03-31T13:18:44.5285055Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Examining 'a_tour_of_sage.fls'
2025-03-31T13:18:44.5285235Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Examining 'a_tour_of_sage.log'
2025-03-31T13:18:44.5285425Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Log file says no output from latex
2025-03-31T13:18:44.5285635Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: For rule 'pdflatex', no output was made
2025-03-31T13:18:44.5285854Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Errors, so I did not complete making targets
2025-03-31T13:18:44.5286080Z [sagemath_doc_pdf-none] [spkg-install] Collected error summary (may duplicate other messages):
2025-03-31T13:18:44.5286299Z [sagemath_doc_pdf-none] [spkg-install]   pdflatex: Command for 'pdflatex' gave return code 1
2025-03-31T13:18:44.5286610Z [sagemath_doc_pdf-none] [spkg-install]       Refer to 'a_tour_of_sage.log' and/or above output for details
2025-03-31T13:18:44.5286742Z [sagemath_doc_pdf-none] [spkg-install] 
2025-03-31T13:18:44.5286951Z [sagemath_doc_pdf-none] [spkg-install] make[4]: *** [Makefile:29: a_tour_of_sage.pdf] Error 12
2025-03-31T13:18:44.5287288Z [sagemath_doc_pdf-none] [spkg-install] make[4]: Leaving directory '/sage/local/share/doc/sage/latex/zh/a_tour_of_sage'
2025-03-31T13:18:44.5287611Z [sagemath_doc_pdf-none] [spkg-install] Error building the documentation.
2025-03-31T13:18:44.5287785Z [sagemath_doc_pdf-none] [spkg-install] Traceback (most recent call last):
2025-03-31T13:18:44.5288004Z [sagemath_doc_pdf-none] [spkg-install]   File "<frozen runpy>", line 198, in _run_module_as_main
2025-03-31T13:18:44.5288193Z [sagemath_doc_pdf-none] [spkg-install]   File "<frozen runpy>", line 88, in _run_code
2025-03-31T13:18:44.5288445Z [sagemath_doc_pdf-none] [spkg-install]   File "/sage/src/sage_docbuild/__main__.py", line 532, in <module>
2025-03-31T13:18:44.5288586Z [sagemath_doc_pdf-none] [spkg-install]     sys.exit(main())
2025-03-31T13:18:44.5288717Z [sagemath_doc_pdf-none] [spkg-install]              ^^^^^^
2025-03-31T13:18:44.5288952Z [sagemath_doc_pdf-none] [spkg-install]   File "/sage/src/sage_docbuild/__main__.py", line 528, in main
2025-03-31T13:18:44.5289073Z [sagemath_doc_pdf-none] [spkg-install]     build()
2025-03-31T13:18:44.5289308Z [sagemath_doc_pdf-none] [spkg-install]   File "/sage/src/sage_docbuild/builders.py", line 298, in pdf
2025-03-31T13:18:44.5289539Z [sagemath_doc_pdf-none] [spkg-install]     raise RuntimeError(error_message % (command, tex_dir))
2025-03-31T13:18:44.5289884Z [sagemath_doc_pdf-none] [spkg-install] RuntimeError: failed to run $MAKE all-pdf in /sage/local/share/doc/sage/latex/zh/a_tour_of_sage

found in downloaded log archives (in CI you can click the cogwheel next to "search logs" in the upper right corner)

@tscrim
Copy link
Collaborator

tscrim commented Apr 1, 2025

@dimpase Thanks. Somehow before when I searched for "LateX Error" online it didn't find that part.

Hopefully switching to lualatex will fix the problem.

@fisheryv For some reason our release manager did a force-push of your branch with an updated version of Sage. Not sure why. Well, I would ignore that and do a force-push with your local branch with the changes @dimpase and I are suggesting.

@dimpase
Copy link
Member

dimpase commented Apr 1, 2025

note that .github/workflows/doc-build-pdf.yml installs the necessary TeX stuff; it runs on ubuntu, which Sage identifies as Debian, thus, one needs to apply

--- a/build/pkgs/texlive/distros/debian.txt
+++ b/build/pkgs/texlive/distros/debian.txt
@@ -21,3 +21,4 @@ texlive-lang-japanese
 texlive-lang-polish
 texlive-lang-portuguese
 texlive-lang-spanish
+texlive-lang-chinese

to make sure it's installed. (I think)

To be completely correct, similar changes should happen to all build/pkgs/texlive/distros/*.txt files.

@fisheryv fisheryv changed the title Add Simplified Chinese translation of a_tour_of_sage Add Simplified Chinese translation of a_tour_of_sage and tutorial Apr 4, 2025
@fisheryv
Copy link
Contributor Author

fisheryv commented Apr 4, 2025

Can I ask one other thing? You don't need to do this in order to get a positive review, but this seems like a good place to do it.

Could you also merge in the translation of the tutorial #9577 into your PR? You can find instructions how to get the old branch here.

@tscrim I merged in the translation of the tutorial. Since #9577 is very outdated, I have re-translated and refined it based on the latest version.

@fisheryv
Copy link
Contributor Author

fisheryv commented Apr 4, 2025

2025-03-31T13:18:44.5283184Z [sagemath_doc_pdf-none] [spkg-install] Latexmk: Missing input file 'ctexhook.sty' (or dependence on it) from following:
2025-03-31T13:18:44.5283383Z [sagemath_doc_pdf-none] [spkg-install] ! LaTeX Error: File `ctexhook.sty' not found.

Based on the error message above, the issue lies in the system not being able to find the ctexhook.sty file.
ctexhook.sty is a file in the CTEX package that supports Chinese typesetting. In theory, simply executing

tlmgr install ctex 

to install the CTEX package should resolve the issue.

@dimpase 's comments greatly inspired me, and I added Chinese language support in texlive/distros and included the ctex package in the package-list.txt file.

Copy link
Member

@dimpase dimpase left a comment

Choose a reason for hiding this comment

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

Good idea. Now, let's see how it runs on the CI. @tscrim @roed314 - please approve the CI runs

@dimpase
Copy link
Member

dimpase commented Apr 4, 2025

The branch is currently messed up, though. One needs to resolve the merge conflicts - which, I think, are a fallout of an unfortunate push by our release manager, @vbraun, few days ago. Volker, do you have an advice how to fix these easily?

@roed314
Copy link
Contributor

roed314 commented Apr 4, 2025

I'm happy to approve a CI run once the conflicts are resolved.

# Conflicts:
#	CITATION.cff
#	VERSION.txt
#	build/pkgs/configure/checksums.ini
#	build/pkgs/configure/package-version.txt
#	build/pkgs/sage_conf/version_requirements.txt
#	build/pkgs/sage_docbuild/version_requirements.txt
#	build/pkgs/sage_setup/version_requirements.txt
#	build/pkgs/sage_sws2rst/version_requirements.txt
#	build/pkgs/sagelib/version_requirements.txt
#	build/pkgs/sagemath_bliss/version_requirements.txt
#	build/pkgs/sagemath_categories/version_requirements.txt
#	build/pkgs/sagemath_coxeter3/version_requirements.txt
#	build/pkgs/sagemath_environment/version_requirements.txt
#	build/pkgs/sagemath_mcqd/version_requirements.txt
#	build/pkgs/sagemath_meataxe/version_requirements.txt
#	build/pkgs/sagemath_objects/version_requirements.txt
#	build/pkgs/sagemath_repl/version_requirements.txt
#	build/pkgs/sagemath_sirocco/version_requirements.txt
#	build/pkgs/sagemath_tdlib/version_requirements.txt
#	pkgs/sage-conf/VERSION.txt
#	pkgs/sage-conf_conda/VERSION.txt
#	pkgs/sage-conf_pypi/VERSION.txt
#	pkgs/sage-docbuild/VERSION.txt
#	pkgs/sage-setup/VERSION.txt
#	pkgs/sage-sws2rst/VERSION.txt
#	pkgs/sagemath-bliss/VERSION.txt
#	pkgs/sagemath-categories/VERSION.txt
#	pkgs/sagemath-coxeter3/VERSION.txt
#	pkgs/sagemath-environment/VERSION.txt
#	pkgs/sagemath-mcqd/VERSION.txt
#	pkgs/sagemath-meataxe/VERSION.txt
#	pkgs/sagemath-objects/VERSION.txt
#	pkgs/sagemath-repl/VERSION.txt
#	pkgs/sagemath-sirocco/VERSION.txt
#	pkgs/sagemath-tdlib/VERSION.txt
#	src/VERSION.txt
#	src/bin/sage-version.sh
#	src/sage/version.py
@fisheryv
Copy link
Contributor Author

fisheryv commented Apr 4, 2025

I'm happy to approve a CI run once the conflicts are resolved.

Hi, @roed314
Thank you for the reminder. All of the conflicts have been resolved.

@fisheryv
Copy link
Contributor Author

fisheryv commented Apr 6, 2025

This time the Build documentation (PDF) / build-doc-pdf passed, but the Build & Test / test-long failed, with errors as follows:

Unable to find image 'localhost:5000/sagemath/sage/sage-ubuntu-noble-standard-with-targets:ci' locally
ci: Pulling from sagemath/sage/sage-ubuntu-noble-standard-with-targets
... ...
docker: write /var/lib/docker/tmp/GetImageBlob3743008585: no space left on device.
See 'docker run --help'.
Error: Process completed with exit code 125.

I think this is most likely caused by system environment issues rather than the code itself. Could you provide some information or suggestions? @dimpase @roed314 @tscrim

@dimpase
Copy link
Member

dimpase commented Apr 6, 2025

I don't know how to fix this. Perhaps adding Chinese fonts for pdf building resulted in the space being exhausted.
Maybe one needs to trim what's being put in the Docker container? @tobiasdiez

fisheryv added 2 commits April 7, 2025 15:34
…ted during the CI Linux incremental process:

```
make[2]: ./tools/test-git-no-uncommitted-changes: No such file or directory
make[2]: *** [Makefile:257: test-git-no-uncommitted-changes] Error 127
```
@fisheryv
Copy link
Contributor Author

fisheryv commented Apr 9, 2025

I‘ve got the following error report during the CI Linux incremental process:

make[2]: ./tools/test-git-no-uncommitted-changes: No such file or directory
make[2]: *** [Makefile:257: test-git-no-uncommitted-changes] Error 127

I think we should add the tools/ directory to docker image.

@dimpase
Copy link
Member

dimpase commented Apr 9, 2025

Updating CI docker images happens in a way I don't know. Perhaps @tobiasdiez can comment.

@dimpase
Copy link
Member

dimpase commented Apr 11, 2025

I have extracted from https://github.com/sagemath/sage/actions/runs/14353554953/job/40301833433?pr=39792
the new Chinese pdf docs - attached. They look good (I don't read Chinese, but the characters look OK etc)
a_tour_of_sage.pdf
sage_tutorial.pdf

I think this can be set to positive review? Or do we want a native speaker to have a go? I can ask one of my former students to help.

@dimpase
Copy link
Member

dimpase commented Apr 12, 2025

I have extracted from https://github.com/sagemath/sage/actions/runs/14353554953/job/40301833433?pr=39792 the new Chinese pdf docs - attached. They look good (I don't read Chinese, but the characters look OK etc) a_tour_of_sage.pdf sage_tutorial.pdf

I think this can be set to positive review? Or do we want a native speaker to have a go? I can ask one of my former students to help.

eventual improvements are forthcoming in a few days.

@dimpase
Copy link
Member

dimpase commented Apr 12, 2025

that's what I received. I think this is good to go


I went through the first 5 pages of the text carefully, and then the first 30 pages less carefully.

The language used is a bit informal for a documentation and/or textbook but is otherwise easy to read and understand.

It is clear that this text is translated from English into Chinese, as the sentence structure is clearly English instead of Chinese. Thus a reader who only knows Mandarin but not English might find it amusing to read but will still understand what is written.

Overall, this is a good translation and will achieve the goal of helping Chinese-speaking people who are interested in Sage but is not fluent in English. The reader still needs to know a very minimal amount of English, but considering the target audiences, this requirement will probably be met by most readers.

@fisheryv
Copy link
Contributor Author

will achieve the goal of helping Chinese-speaking people who are interested in Sage but is not fluent in English. The reader still needs to know a very minimal amount of English, but considering the target audiences, this requirement will probably be met by most readers.

I really appreciate it. As a mathematics major, my literature skills are somewhat limited. In future translations, I will pay closer attention to the differences between the two languages and strive to strike a better balance between translation accuracy and fluency.

@dimpase
Copy link
Member

dimpase commented Apr 14, 2025

the review is by a maths prof., who grew up in Indonesia speaking Hokkein, Malay (Indonesian version), Mandarin, English - in some order :-)

@JarodYv
Copy link

JarodYv commented Apr 18, 2025

I have extracted from https://github.com/sagemath/sage/actions/runs/14353554953/job/40301833433?pr=39792
the new Chinese pdf docs - attached. They look good (I don't read Chinese, but the characters look OK etc)
a_tour_of_sage.pdf
sage_tutorial.pdf

I think this can be set to positive review? Or do we want a native speaker to have a go? I can ask one of my former students to help.

I majored in applied mathematics and statistics and I'm from Hong Kong. After carefully reviewing these two documents (particularly sage_tutorial.pdf), I think the translation to be of high quality overall. The mathematical terminology is accurately translated, and the language flows naturally in Chinese. The translator skillfully adapted the sentence structure rather than rigidly adhering to the English word order, enhancing readability. One minor suggestion: For specialized terms, it would be best to retain the original English vocabulary. @fisheryv

@dimpase
Copy link
Member

dimpase commented Apr 18, 2025

Let's merge this, and do further edits on a subsequent PR

@dimpase dimpase self-requested a review April 18, 2025 16:07
@vbraun
Copy link
Member

vbraun commented Apr 19, 2025

merge conflict, please fix

@fisheryv
Copy link
Contributor Author

merge conflict, please fix

I've merged upstream branch 'develop', no more conflictions.

@vbraun vbraun merged commit 3e469e1 into sagemath:develop Apr 29, 2025
29 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants