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 Simplified Chinese Support #772

Merged
merged 36 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
e1a73f8
Add Simplified Chinese Support
smallg0at Sep 7, 2023
0ddfb07
Add zh_cn CliRunner tests
smallg0at Sep 7, 2023
fa8aecf
fix chinese help
smallg0at Sep 7, 2023
0cfa5f2
align clitest names
smallg0at Sep 7, 2023
9598846
Fix minor flaws
smallg0at Sep 7, 2023
2f82660
Modify Chinese internal name
smallg0at Sep 7, 2023
612444b
Fix Pipeline tab not raffected by localization
smallg0at Sep 7, 2023
fe965f4
refine zh_cn text
smallg0at Sep 7, 2023
2bb305f
Make tile MenuItem localizable
smallg0at Sep 7, 2023
a536f54
add spaces between char
smallg0at Sep 7, 2023
99f6228
Merge branch 'master' into master
lupino3 Sep 10, 2023
3fca8cc
fix: en docs typo
smallg0at Sep 12, 2023
fb2c8ff
add zh_cn docs
smallg0at Sep 12, 2023
b8361cc
feat: add zhcn docs build script
smallg0at Sep 12, 2023
8779127
fix: malformed table
smallg0at Sep 13, 2023
bc76473
action: add zhcn docs pdf upload
smallg0at Sep 13, 2023
7c742b3
neutralize: codacy warnings
smallg0at Sep 13, 2023
54bb967
fix PDF build by specifying a supported language
lupino3 Sep 13, 2023
10d23da
wip: try to fix rst2pdf for zh_CN output (not working)
lupino3 Sep 13, 2023
74b6a04
wip: move font in the conf dir (still not working)
lupino3 Sep 13, 2023
57a59fa
fix: still trying to fix blocky docs issue
smallg0at Sep 14, 2023
027d123
wip: recover stylesheet
smallg0at Sep 14, 2023
1566ee4
Merge branch 'EduMIPS64:master' into master
smallg0at Sep 16, 2023
1aa0a58
Remove zh docs pdf upload action
smallg0at Sep 16, 2023
12dda02
fix: correct workflow get version
smallg0at Sep 18, 2023
88af27b
fix: ci cannot find right jar
smallg0at Sep 19, 2023
5185761
wip: try to fix deploy-web
smallg0at Sep 19, 2023
09d19af
wip: try to allow rst2pdf to find correct styles
smallg0at Sep 20, 2023
e53e13f
wip: force utf-8 everywhere
smallg0at Sep 20, 2023
3303eb9
Revert "wip: try to allow rst2pdf to find correct styles"
smallg0at Sep 20, 2023
53bd8f9
add: garbled text warning
smallg0at Sep 21, 2023
85b4dce
Merge branch 'EduMIPS64:master' into master
smallg0at Sep 21, 2023
789a842
fix: tiny errors
smallg0at Sep 21, 2023
52b0cbf
Merge branch 'master' of https://github.com/smallg0at/edumips64
smallg0at Sep 21, 2023
a858e8f
fix: correct error
smallg0at Sep 21, 2023
4e8b71f
Merge branch 'EduMIPS64:master' into master
smallg0at Sep 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ jobs:
with:
name: Italian manual (PDF)
path: ./build/docs/it/pdf/EduMIPS64.pdf
#
# Disabled due to not working properly
#
# - name: Upload Simplified Chinese Manual PDF
# uses: actions/upload-artifact@v3.1.2
# with:
# name: Chinese manual (PDF)
# path: ./build/docs/zh/pdf/EduMIPS64.pdf

- name: Upload JAR
uses: actions/upload-artifact@v3.1.2
Expand Down Expand Up @@ -137,6 +145,7 @@ jobs:

deploy-web:
name: Deploy web application
permissions: write-all
runs-on: ubuntu-latest
needs: build-web
steps:
Expand Down
25 changes: 23 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ application {
val codename: String by project
val version: String by project




// Specify Java source/target version and source encoding.
tasks.compileJava {
sourceCompatibility = "17"
Expand All @@ -75,6 +78,10 @@ tasks.register<PythonTask>("htmlDocsIt") {
workDir = "${projectDir}/docs/user/en/src"
command = buildDocsCmd("it", "html")
}
tasks.register<PythonTask>("htmlDocsZh") {
workDir = "${projectDir}/docs/user/zh/src"
command = buildDocsCmd("zh", "html")
}

tasks.register<PythonTask>("pdfDocsEn") {
workDir = "${projectDir}/docs/user/en/src"
Expand All @@ -86,10 +93,15 @@ tasks.register<PythonTask>("pdfDocsIt") {
command = buildDocsCmd("it", "pdf")
}

tasks.register<PythonTask>("pdfDocsZh") {
workDir = "${projectDir}/docs/user/zh/src"
command = buildDocsCmd("zh", "pdf")
}


// Catch-all task for documentation
tasks.create<GradleBuild>("allDocs") {
tasks = listOf("htmlDocsIt", "htmlDocsEn", "pdfDocsEn", "pdfDocsIt")
tasks = listOf("htmlDocsIt","htmlDocsZh", "htmlDocsEn", "pdfDocsEn", "pdfDocsZh", "pdfDocsIt")
description = "Run all documentation tasks"
}

Expand All @@ -115,6 +127,14 @@ tasks.create<Copy>("copyHelpIt") {
into ("${docsDir}/user/it")
dependsOn("htmlDocsIt")
}
tasks.create<Copy>("copyHelpZh") {
from("${buildDir}/docs/zh") {
include("html/**")
exclude("**/_sources/**")
}
into ("${docsDir}/user/zh")
dependsOn("htmlDocsZh")
}

tasks.create<Copy>("copyHelp") {
from("docs/") {
Expand All @@ -124,6 +144,7 @@ tasks.create<Copy>("copyHelp") {
into ("${docsDir}")
dependsOn("copyHelpEn")
dependsOn("copyHelpIt")
dependsOn("copyHelpZh")
}

/*
Expand Down Expand Up @@ -268,7 +289,7 @@ tasks.create<Exec>("msi"){
}

println("Creating EduMIPS64-${version}.msi.");
val cmd = "jpackage.exe --main-jar edumips64-${version}.jar --input ./build/libs/ --app-version ${version} --name EduMIPS64 --description \"Educational MIPS64 CPU Simulator\" --vendor \"EduMIPS64 Development Team\" --copyright \"Copyright ${LocalDateTime.now().year}, EduMIPS64 development Team\" --license-file ./LICENSE --win-shortcut --win-dir-chooser --win-menu --type msi --icon ./src/main/resources/images/ico.ico --win-per-user-install"
val cmd = "jpackage.exe --main-jar edumips64-${version}.jar --input ./build/libs/ --app-version ${version} --name EduMIPS64 --description \"Educational MIPS64 CPU Simulator\" --vendor \"EduMIPS64 Development Team\" --copyright \"Copyright ${LocalDateTime.now().year}, EduMIPS64 development Team\" --license-file ./LICENSE --win-shortcut --win-dir-chooser --win-menu --type msi --icon ./src/main/resources/images/ico.ico --win-per-user-install --java-options -Dfile.encoding=utf-8"
commandLine(cmd.split(" "));
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/user/en/src/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ usual, the strings containing the error message and the success message.
In the .text section, we save the params_sys4 address to register r14, we save
in the memory cells for the SYSCALL parameters the file descriptor (that we
suppose to have in $s2) and the address from where we must take the bytes to
weite.
write.

Next we can call SYSCALL 3, and then we call the print_string function
passing as argument error_3 or ok_message, according to the success of the
Expand Down
38 changes: 38 additions & 0 deletions docs/user/zh/EduMIPS64.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE helpset
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
"http://java.sun.com/products/javahelp/helpset_2_0.dtd">


<!--This Helpset was first generated by JHelpDev 0.63 (jhelpdev.sourceforge.net),
and then modified by Andrea Spadaccini using as a guideline the JavaHelp
System User's Guide.-->

<helpset version="2.0">
<title>EduMIPS64 撣桀</title>

<maps>
<homeID>top</homeID>
<mapref location="Map.jhm"/>
</maps>

<view>
<name>TOC</name>
<label>�桀�</label>
<type>javax.help.TOCView</type>
<data>EduMIPS64TOC.xml</data>
</view>

<presentation default="true" displayviewimages="false">
<name>main window</name>
<size width="400" height="400" />
<location x="200" y="200" />
<title>EduMIPS64 撣桀</title>
<toolbar>
<helpaction image = "img_back">javax.help.BackAction</helpaction>
<helpaction image = "img_fwd">javax.help.ForwardAction</helpaction>
<helpaction image = "img_home">javax.help.HomeAction</helpaction>
<helpaction image = "img_print">javax.help.PrintAction</helpaction>
</toolbar>
</presentation>
</helpset>
4 changes: 4 additions & 0 deletions docs/user/zh/EduMIPS64Index.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE index PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN" "http://java.sun.com/products/javahelp/index_2_0.dtd"><!--generated by JHelpDev Version: 0.63, 14 May 2008, see jhelpdev.sourceforge.net-->

<index version="1.0"/>
17 changes: 17 additions & 0 deletions docs/user/zh/EduMIPS64TOC.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN" "http://java.sun.com/products/javahelp/toc_2_0.dtd"><!--generated by JHelpDev Version: 0.63, 14 May 2008, see jhelpdev.sourceforge.net-->

<toc version="1.0">
<tocitem text="甈Z�霈輸 EduMIPS64 �﹝嚗� " target="index"/>

<tocitem text="皞�隞嗆撘�" target="source-files-format"/>

<tocitem text="�誘��" target="instructions"/>

<tocitem text="瘚桃��" target="fpu"/>

<tocitem text="�冽�" target="user-interface"/>

<tocitem text="隞��蝷箔�" target="examples"/>

</toc>
Binary file added docs/user/zh/JavaHelpSearch/DOCS
Binary file not shown.
1 change: 1 addition & 0 deletions docs/user/zh/JavaHelpSearch/DOCS.TAB
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e�躚u躚�'@2,�+赮噢囿垢篨鋼虱膮縒牧栘�姥獄篨恬浦的儐囿牧磢儐荀漯物禤賓磢樽儐錭綸漯牧磢鍆阜樽儐虱遝篨牧垂牧牧恃牧的姿知漯牧鋋捉漯姿牧犖知矽禤的狙謇垣笑狙悚辨禤精盂儐瑣氋恰物遴磢禤漯的貌物漁虎垣狙牧虎粽虎磢牧牧悚漯遙殉牧牧虱囿牧牧牧牧牧牧牧牧牧牧爬
1 change: 1 addition & 0 deletions docs/user/zh/JavaHelpSearch/OFFSETS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
€溾l�m詡 € >顊�j浶 @ f讔靼D
Binary file added docs/user/zh/JavaHelpSearch/POSITIONS
Binary file not shown.
2 changes: 2 additions & 0 deletions docs/user/zh/JavaHelpSearch/SCHEMA
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
JavaSearch 1.0
TMAP bs=2048 rt=1 fl=-1 id1=1045 id2=1
Binary file added docs/user/zh/JavaHelpSearch/TMAP
Binary file not shown.
21 changes: 21 additions & 0 deletions docs/user/zh/Map.jhm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Map Version 1.0//EN" "http://java.sun.com/products/javahelp/map_2_0.dtd">

<map version="1.0" xml:lang="zh">
<mapID target="top" url="html/index.html "/>
<mapID target="index" url="html/index.html"/>
<mapID target="user-interface" url="html/user-interface.html"/>
<mapID target="instructions" url="html/instructions.html"/>
<mapID target="fpu" url="html/fpu.html"/>
<mapID target="search" url="html/search.html"/>
<mapID target="source-files-format" url="html/source-files-format.html"/>
<mapID target="genindex" url="html/genindex.html"/>
<mapID target="examples" url="html/examples.html"/>
<mapID target="_static.file" url="html/_static/file.png"/>
<mapID target="_static.minus" url="html/_static/minus.png"/>
<mapID target="_static.plus" url="html/_static/plus.png"/>
<mapID target="img_back" url="img/Back.png"/>
<mapID target="img_fwd" url="img/Forward.png"/>
<mapID target="img_home" url="img/Home.png"/>
<mapID target="img_print" url="img/Print.png"/>
</map>
Binary file added docs/user/zh/img/Back.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/Forward.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/Home.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/Print.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/exception_cfg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/exception_mask_cfg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/fcsr_register.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/fpu_rounding.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/user/zh/img/invalid_operation_trap.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
138 changes: 138 additions & 0 deletions docs/user/zh/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
PAPER =
BUILDDIR = ../output

# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest

help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " pdf to make PDF files using rst2pdf"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"

clean:
-rm -rf $(BUILDDIR)/*

html:
$(SPHINXBUILD) --version
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."

json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."

htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EduMIPS64.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EduMIPS64.qhc"

devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/EduMIPS64"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EduMIPS64"
@echo "# devhelp"

epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."

latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

pdf:
$(SPHINXBUILD) -b pdf $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished. The PDF files are in $(BUILDDIR)/latex."

text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

35 changes: 35 additions & 0 deletions docs/user/zh/src/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
#
# EduMIPS64 documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 26 23:10:10 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
#
# Note: all the common configuration of the EduMIPS64 documentation is stored
# in docs/common_conf.py. This file just imports all the identifiers from that
# module and adds language-specific configuration items.

import sys, os
sys.path.append(os.path.abspath("../.."))
from common_conf import *

pdf_stylesheets = ['sphinx', 'kerning', 'a4', 'zh_CN.json', 'chinese']
pdf_font_path = [os.path.abspath(".\\docs\\zh\\src"),'C:\\Windows\\Fonts']
pdf_language = "zh_CN"
source_encoding = "utf-8"
language = "zh_CN"
copyright = u'2011, Andrea Spadaccini (and the EduMIPS64 development team)'
man_pages = [
('index', 'edumips64', u'EduMIPS64 Documentation',
[u'Andrea Spadaccini (and the EduMIPS64 development team)'], 1)
]
latex_documents = [
('index', 'EduMIPS64.tex', u'EduMIPS64 Documentation',
u'Andrea Spadaccini (and the EduMIPS64 development team)', 'manual'),
]