sicp icon indicating copy to clipboard operation
sicp copied to clipboard

Added i18n component and related scripts

Open yihao03 opened this issue 9 months ago • 8 comments

run yarn trans to start translation

yihao03 avatar Mar 28 '25 02:03 yihao03

breaking changes are made: xml repositories are divided into folders, currently consisting of en and cn folders to store translated content. The same applies to the json folder after running "yarn json". Frontend needs to be changed accordingly to fetch json files from the corresponding url

yihao03 avatar Apr 12 '25 07:04 yihao03

Did not look at the contents of the zh_CN folder. I assume they are generated by AI? Or was there manual editing? If the former, please add a gitattributes file so that reviewers (and GitHub) knows it's machine generated

All the AI translated XMLs will go into the translated_xmls branch, so I will delete the zh_CN folder. Should I add gitattributes file to the translated_xmls branch to mark they are generated by AI?

coder114514 avatar Jul 05 '25 11:07 coder114514

Did not look at the contents of the zh_CN folder. I assume they are generated by AI? Or was there manual editing? If the former, please add a gitattributes file so that reviewers (and GitHub) knows it's machine generated

All the AI translated XMLs will go into the translated_xmls branch, so I will delete the zh_CN folder. Should I add gitattributes file to the translated_xmls branch to mark they are generated by AI?

How is the zh_CN folder different from the translated_xmls branch? Why not just merge the translations directly to master instead of using a separate branch?

RichDom2185 avatar Jul 05 '25 11:07 RichDom2185

Did not look at the contents of the zh_CN folder. I assume they are generated by AI? Or was there manual editing? If the former, please add a gitattributes file so that reviewers (and GitHub) knows it's machine generated

All the AI translated XMLs will go into the translated_xmls branch, so I will delete the zh_CN folder. Should I add gitattributes file to the translated_xmls branch to mark they are generated by AI?

How is the zh_CN folder different from the translated_xmls branch? Why not just merge the translations directly to master instead of using a separate branch?

They are the same. The translated_xmls branch is separately created because in the workflow for translation (translate-changed, translate-everything) an action called deploy which pushes files to a branch is used to push AI generated translations to GitHub, so the branch is created for this.

coder114514 avatar Jul 05 '25 11:07 coder114514

Did not look at the contents of the zh_CN folder. I assume they are generated by AI? Or was there manual editing? If the former, please add a gitattributes file so that reviewers (and GitHub) knows it's machine generated

All the AI translated XMLs will go into the translated_xmls branch, so I will delete the zh_CN folder. Should I add gitattributes file to the translated_xmls branch to mark they are generated by AI?

How is the zh_CN folder different from the translated_xmls branch? Why not just merge the translations directly to master instead of using a separate branch?

They are the same. The translated_xmls branch is separately created because in the workflow for translation (translate-changed, translate-everything) an action called deploy which pushes files to a branch is used to push AI generated translations to GitHub, so the branch is created for this.

I see, noted, and what is the rationale of running it in a workflow, as opposed to running it locally?

RichDom2185 avatar Jul 05 '25 11:07 RichDom2185

Did not look at the contents of the zh_CN folder. I assume they are generated by AI? Or was there manual editing? If the former, please add a gitattributes file so that reviewers (and GitHub) knows it's machine generated

All the AI translated XMLs will go into the translated_xmls branch, so I will delete the zh_CN folder. Should I add gitattributes file to the translated_xmls branch to mark they are generated by AI?

How is the zh_CN folder different from the translated_xmls branch? Why not just merge the translations directly to master instead of using a separate branch?

They are the same. The translated_xmls branch is separately created because in the workflow for translation (translate-changed, translate-everything) an action called deploy which pushes files to a branch is used to push AI generated translations to GitHub, so the branch is created for this.

I see, noted, and what is the rationale of running it in a workflow, as opposed to running it locally?

sicp.sourceacademy.org is a static site, so the translated XMLs need to be deployed too, and thus we are storing them on GitHub.

This is not really about the translation workflows. The translator can be run locally and then the generated content can be manually pushed to the translated_xmls branch.

coder114514 avatar Jul 05 '25 12:07 coder114514

@yihao03 I still don't understand why you removed the zh_CN directory. I know it's AI created. But we need it for deployment right? Why run it as a workflow and push to a separate branch? Why do we need the separate branch at all?

Just run the command locally and push it to master branch?

In my view, if it's going to be deployed, then it should me in the master branch not some other branch.

RichDom2185 avatar Aug 19 '25 16:08 RichDom2185

@yihao03 I still don't understand why you removed the zh_CN directory. I know it's AI created. But we need it for deployment right? Why run it as a workflow and push to a separate branch? Why do we need the separate branch at all?

Just run the command locally and push it to master branch?

In my view, if it's going to be deployed, then it should me in the master branch not some other branch.

Hi, this was a design decision made by @coder114514 as he was in charge of the deployment workflow, while I mainly worked on the translation logic. However, I do agree with you that zh_CN should live in the master branch as that was my original design too.

yihao03 avatar Aug 20 '25 02:08 yihao03