From 925f443ee39a06b277c3e7a6c0110e5a8550573f Mon Sep 17 00:00:00 2001 From: chouchongYHMing <121396869+chouchongYHMing@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:34:07 +0800 Subject: [PATCH] Update: update some expression of proposal --- docs/i18n-docs.md | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/docs/i18n-docs.md b/docs/i18n-docs.md index 7882cdf..41a3444 100644 --- a/docs/i18n-docs.md +++ b/docs/i18n-docs.md @@ -15,7 +15,7 @@ creation-date: 2024-08-19 ## Summary -Internationalization (also called i18n) is essential for software that aims to become global. During the development of the Karmada dashboard, we encountered inefficiencies, errors, and lack of engineering rigor in manually maintaining translation content (also called locales files). To solve these issues and meet the i18n needs of the Karmada dashboard project, we developed a ready-to-use automated i18n tool. +Internationalization (aka i18n) is essential for software that aims to become global. During the development of the Karmada dashboard, we suffered from low efficiency、 easy to make mistakes、lack of engineering due to maintaining i18n translation (aka locales) manually. To solve these issues and meet the i18n needs of the Karmada dashboard project, we developed a out-of-the-box automated i18n tool. @@ -52,15 +52,6 @@ During the development of the Karmada dashboard, early on, we maintained the loc ## Proposal - ### User Stories (Optional) -Convert the input files into an AST, traverse the AST to find nodes which containing Chinese characters, calculate the code points corresponding to the Chinese characters and save them in the i18nMap, and save the transformed AST nodes in CNpath. After completing one scan, continue to traverse CNpath, converting the Chinese characters in the corresponding AST nodes into the form of i18n function calls, and generate a new AST tree to return. +Convert the input files into an AST, traverse the AST to find nodes which containing Chinese characters, calculate the code points corresponding to the Chinese characters and save them in the i18nMap, and save the transformed AST nodes in CNpath. After the first round of scanning finished, continue to traverse CNpath, converting the Chinese characters in the corresponding AST nodes into the form of i18n function calls, and generate a new AST tree to return. @@ -150,7 +141,7 @@ Convert the input files into an AST, traverse the AST to find nodes which contai -If the original code does not include an import statement for the i18n instance, an appropriate import statement needs to be inserted. This completes the main workflow of code generation. The process of code generation might inadvertently alter statements unrelated to i18n. To address this issue, a prettier process is introduced to style the generated code according to the original coding style, minimizing changes which brought by code-gen. Finally, the newly generated code is written back into the original file. +If the original code does not include an import statement for the i18n instance, an appropriate import statement needs to be inserted. This completes the main workflow of code generation. The process of code generation might inadvertently alter statements unrelated to i18n. To address this issue, a prettier process is introduced to style the generated code according to the original coding style, minimizing changes which were introduced by code-gen. Finally, the newly generated code is written back into the original file.