A method and system for automatic multilingual internationalization processing in a front-end engineering build phase
Patent Information
- Application Number
- CN202611042360.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-14
- Publication Date
- 2026-10-09
AI Technical Summary
然而,由于源代码中并非所有字符串文本均需要被多语言国际化(例如模块导入路径、控制台调试输出、代码注释等不应被替换),而现有方案在基于抽象语法树进行自动转换时,缺乏对节点上下文信息的有效利用,通常仅依据节点本身的字符串值进行匹配,无法准确区分需要多语言国际化的文本与无需多语言国际化的文本,导致不应被转换的文本被误转换,或者应被转换的文本被遗漏,转换准确度不足
[0027]1、实现全流程自动化;
Smart Images

Figure CN122884585A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of front-end engineering construction technology, and in particular to an automatic multilingual internationalization processing method and system for the front-end engineering construction stage. Background Technology
[0002] In the practice of multilingual internationalization in front-end projects, converting hard-coded text in the source code into multilingual internationalization function calls and generating corresponding translation resource files is a necessary step in front-end project construction. To accomplish this conversion, existing technologies mainly employ the following processing methods.
[0003] One approach is purely manual processing, where developers manually replace the hard-coded text in the source code with multilingual internationalization function calls, manually assign keys to each text, and then manually write translation resource files for each language. This method is labor-intensive, inefficient, and prone to omissions or errors due to manual operation.
[0004] Another approach involves using scanning tools to assist in extracting terms. Developers run these tools to scan the source code, and the tools extract hard-coded text using regular expressions and other methods, generating a term list. However, developers still need to modify the source code one by one according to the term list, manually replacing each instance of hard-coded text with multilingual internationalized function calls. This method does not automate the code conversion, and developers still have to undertake a significant amount of manual modification work.
[0005] Another approach is to automatically translate the source code during the build phase using abstract syntax tree (AST) analysis. This involves parsing the AST during compilation, identifying hard-coded text nodes, and automatically replacing them with multilingual internationalized function calls, while simultaneously generating corresponding translation resource files. However, not all strings in the source code need to be internationalized (e.g., module import paths, console debug output, code comments should not be replaced). Existing solutions, when performing automatic translation based on ASTs, lack effective utilization of node context information. They typically match only the string value of the node itself, failing to accurately distinguish between text requiring and not requiring internationalization. This leads to the mistranslation of text that should not be translated, or the omission of text that should be translated, resulting in insufficient translation accuracy. Summary of the Invention
[0006] In view of the above-mentioned shortcomings in the current front-end engineering construction technology, the present invention provides an automatic multilingual internationalization processing method and system for the front-end engineering construction stage, which can automatically complete the conversion of hard-coded text to multilingual internationalized function calls during the construction stage, while ensuring the accuracy of the conversion.
[0007] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions:
[0008] An automatic multilingual internationalization processing method in the front-end project build phase includes:
[0009] Integrate multilingual internationalization processing logic into the front-end engineering build process;
[0010] During the code compilation stage of the construction process, the source code is subjected to syntax analysis. Based on the syntax analysis results, text content that requires multilingual internationalization is identified, and text content that does not require multilingual internationalization is filtered out.
[0011] The identified text content is replaced with multilingual internationalization function calls, and a mapping relationship is established between the text content and multilingual internationalization key names;
[0012] In the resource output stage of the construction process, multilingual internationalization resource files are generated according to the mapping relationship.
[0013] According to one aspect of the present invention, the integration of multilingual internationalization processing logic into the front-end engineering build process includes: registering an automatic multilingual internationalization plugin to the plugin system of the build tool, and automatically activating the multilingual internationalization processing logic when the build process starts through the plugin loading mechanism of the build tool.
[0014] According to one aspect of the present invention, the code compilation stage of the build process further includes: performing syntax analysis on the source code; during the stage where the build tool performs conversion processing on each source code file, parsing the currently processed source code file into an abstract syntax tree; and traversing the string type nodes and / or template string type nodes in the abstract syntax tree to identify the text content contained therein.
[0015] According to one aspect of the present invention, the step of identifying text content that requires multilingual internationalization based on grammatical analysis results and filtering out text content that does not require multilingual internationalization includes: obtaining the parent node type information and / or position information of the traversed node; when the parent node type belongs to a preset set of node types that do not require processing, skipping the current node; the set of node types that do not require processing includes at least: module import / export declaration nodes, console log output nodes, and comment nodes.
[0016] According to one aspect of the present invention, the step of identifying text content that requires multilingual internationalization based on the results of grammatical analysis and filtering out text content that does not require multilingual internationalization further includes: reading the comment content corresponding to the source code line where the currently traversed node is located, and skipping the current node when the comment content contains a preset skip flag.
[0017] According to one aspect of the present invention, the step of identifying text content requiring multilingual internationalization based on grammatical analysis results includes: detecting whether a string in a traversed node contains target language characters; when the string contains both target language characters and characters from other languages, extracting a continuous segment containing the target language characters from the string as text content requiring multilingual internationalization, wherein the non-target language character portion of the string remains unchanged.
[0018] According to one aspect of the present invention, replacing the identified text content with a multilingual internationalized function call includes: selecting a replacement strategy matching the context type based on the context type of the traversed node, and replacing the string content of the node with a multilingual internationalized function call node with the key name as the unique parameter; the context type includes at least one of the following: variable declaration, function call parameter, array element, object attribute value, binary expression operand, conditional expression branch, and return statement.
[0019] According to one aspect of the present invention, the step of replacing the identified text content with a multilingual internationalization function call and establishing a mapping relationship between the text content and the multilingual internationalization key name includes: obtaining the existing key name set in the generated mapping relationship, detecting whether there is a missing key name in the key name set; if there is, assigning the current text content to the missing key name; if there is no missing key name, generating a new key name according to an incrementing rule and assigning it to the current text content.
[0020] According to one aspect of the present invention, after replacing the identified text content with a multilingual internationalization function call, the method further includes: detecting whether the abstract syntax tree of the current source code file already contains an import declaration node corresponding to the multilingual internationalization function; if not, inserting the import declaration node at the top of the abstract syntax tree.
[0021] An automated multilingual internationalization processing system for the front-end engineering build phase includes:
[0022] An integration module integrates multilingual internationalization processing logic into the front-end engineering build process;
[0023] The filtering module performs syntax analysis on the source code during the code compilation stage of the build process, identifies text content that requires multilingual internationalization based on the syntax analysis results, and filters out text content that does not require multilingual internationalization.
[0024] The calling module replaces the identified text content with multilingual internationalization function calls and establishes a mapping relationship between the text content and multilingual internationalization key names;
[0025] The output module generates multilingual internationalization resource files based on the mapping relationship during the resource output stage of the construction process.
[0026] Advantages of implementing this invention:
[0027] 1. Achieve full-process automation;
[0028] By building a tool plugin's transform hook, the entire process of term recognition, code conversion, resource file generation, and automatic translation is automatically completed during the code compilation phase. Developers do not need to manually modify the text in the source code, nor do they need to manually write translation files, significantly reducing the manpower cost of multilingual internationalization for front-end projects. Compared to the methods in existing technical solutions one and two that require a lot of manual operation, this invention achieves end-to-end automation from source code to multilingual internationalized finished products.
[0029] 2. Intelligent term recognition with high accuracy;
[0030] This invention employs an intelligent recognition mechanism based on AST context analysis. By analyzing the type and location information of AST parent nodes, it can accurately distinguish between text requiring multilingual internationalization and text that does not require processing (such as module paths, log outputs, comments, etc.). It also supports marking specific lines of code with comment instructions to skip processing, providing developers with precise control. Compared to the existing solution three, which relies solely on regular expression matching, this invention significantly reduces false and false recognition.
[0031] 3. Incremental update mechanism, high processing efficiency;
[0032] This invention compares the differences in terms across compilation cycles and processes only the changed files and terms, avoiding repeated scanning and conversion of unchanged files. Compared to the existing solution three, which requires a full scan for each build, this invention significantly shortens build time and improves development efficiency in large-scale front-end projects.
[0033] 4. Supports multiple translation sources and is flexible and scalable;
[0034] This invention provides a unified translation service adapter interface, supporting access to multiple translation service providers and featuring incremental translation, batch processing, frequency control, and quota management mechanisms. Compared to the existing solution three, which binds to a single translation service, this invention offers better flexibility, fault tolerance, and scalability.
[0035] 5. Adaptation to common build tools;
[0036] This invention uses a standardized plugin registration and hook mechanism to decouple the core AST analysis and term processing logic from specific build tools, making it compatible with various mainstream front-end build tools such as Rollup, Vite, and Webpack, and possessing good portability. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a flowchart illustrating an automatic multilingual internationalization processing method for the front-end engineering construction stage as described in this invention.
[0039] Figure 2 This is a detailed flowchart of the AST-based intelligent term recognition described in this invention;
[0040] Figure 3 This is a flowchart illustrating an automatic multilingual internationalization processing system for the front-end engineering construction stage as described in this invention. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] Example 1
[0043] like Figure 1 As shown, an automatic multilingual internationalization processing method in the front-end project build phase includes the following steps:
[0044] Step S1: Integrate the multilingual internationalization processing logic into the front-end project build process;
[0045] Step S1 specifically includes the following steps:
[0046] Step S11: Register and configure the build tool plugin;
[0047] Register the automatic multilingual internationalization method as a plugin to the plugin system of front-end engineering build tools (including but not limited to Rollup, Vite, and Webpack); read and merge configuration parameters, including source code file filtering rules, multilingual internationalization function call names, term matching rules, multilingual internationalization resource file output paths, and translation service configuration information; initialize a global term collector and establish a data structure mapping source code file paths to terms.
[0048] Step S12: Filter source code files;
[0049] like Figure 1 As shown, in the code transformation hook of the build tool, the source code files participating in the build are filtered according to the configured file filtering rules to determine the set of files that need to be processed for multilingual internationalization; files that do not match the filtering rules are skipped directly and the original code is returned without processing.
[0050] Step S2: During the code compilation stage of the build process, perform syntax analysis on the source code, identify text content that requires multilingual internationalization based on the syntax analysis results, and filter out text content that does not require multilingual internationalization.
[0051] like Figure 2 As shown, for the source code files selected in step S1, a parser (such as Babel Parser) is used to parse the source code text into an Abstract Syntax Tree (AST); the AST nodes are traversed, and the following intelligent recognition logic is performed on string literal nodes and template string nodes:
[0052] (a) Context-aware filtering: Analyze the parent node type and position information of the current node, and exclude the following types of nodes from processing: module path strings in import / export declarations, output text in console object method calls, and code comment content;
[0053] (b) Comment instruction recognition: Scan the comments in the source code to detect whether they contain predefined skip flags (e.g., / * no-i18n-auto * / ). If detected, skip the corresponding AST node without processing.
[0054] (c) Multilingual text matching: Based on the configured matching rules, detect whether the string node contains text characters of the target language. The matching rules can be defined by regular expressions, and the default is to match the range of Chinese characters.
[0055] (d) Mixed text splitting: For mixed strings that contain both target language text and characters from other languages, accurately extract the target language text portion that requires multilingual internationalization, while keeping the characters from other languages unchanged.
[0056] Step S3: Replace the identified text content with multilingual internationalization function calls, and establish a mapping relationship between the text content and multilingual internationalization key names;
[0057] Step S3 specifically includes the following steps:
[0058] Step S31: Entry collection and key assignment;
[0059] For each term identified in step S2, a unique term key is assigned through a global term collector, establishing a mapping relationship between terms and keys. The term key allocation strategy includes: a default numeric increment strategy—automatically scanning the existing term configuration, detecting whether there are empty key positions caused by deleted terms, prioritizing filling empty key positions with new terms to maintain key compactness, and incrementally assigning new keys when there are no empty key positions; and a custom strategy—supporting custom key generation rules through configuration functions. Simultaneously, the mapping relationship between terms, keys, and source file paths is updated in the resource mapping data structure.
[0060] Step S32: AST node replacement and multilingual internationalization dependency injection;
[0061] like Figure 2 As shown, based on the context type of the AST node containing the term, a corresponding node replacement strategy is selected for code transformation. The context types include variable declarations, function call parameters, array elements, binary expression operands, object attribute values, conditional expression branches, logical expression operands, return statements, and assignment expressions. The original string nodes are replaced with multilingual internationalized function call nodes, which contain the corresponding term keys as parameters. It is checked whether there are already import declarations for multilingual internationalization dependencies in the current source code file. If not, the import declarations for multilingual internationalization dependencies are automatically injected at the top of the AST. The modified AST is then regenerated into source code text using a code generator.
[0062] Step S4: In the resource output stage of the construction process, generate multilingual internationalization resource files according to the mapping relationship;
[0063] In the build tool's output hook (generateBundle hook), the differences between the term configuration data in the current compilation cycle and the term configuration data stored in the previous cycle are compared; when a term change is detected, the following incremental update operation is performed:
[0064] (a) Adding new terms: Adding newly discovered terms and their keys to the multilingual internationalization resource file;
[0065] (b) Term deletion: When a term is removed from the source code, the corresponding key-value pair is deleted from the multilingual internationalization resource file;
[0066] (c) Term update: When the content of a term in the source code changes, update the value of the corresponding key in the multilingual internationalization resource file;
[0067] Write the updated term configuration data to the multilingual internationalization resource file; at the same time, generate a resource mapping file at the source code file level based on the configuration, recording the terms contained in each source code file and their occurrence count.
[0068] Example 2
[0069] After the front-end project is built, in order to achieve the automatic generation of multilingual resource files, this embodiment provides a multi-source automatic translation method. This method automatically translates the source language multilingual internationalization resource files into one or more target languages.
[0070] Multi-source automatic translation:
[0071] When automatic translation is enabled in the configuration, the translation service is invoked through a unified translation service adapter interface; the translation processing includes:
[0072] (a) Incremental translation: Read the existing target language translation file, translate only the newly added terms in the source language resource file, and leave the already translated terms unchanged; at the same time, clean up the expired terms in the target language translation file that have been deleted from the source file;
[0073] (b) Batch translation: Group the terms to be translated according to the character length limit, and call the batch translation interface of the translation service to improve translation efficiency;
[0074] (c) Frequency control: Based on the application interface call frequency limit of the translation service, the request interval is controlled by a timed delay mechanism to avoid exceeding the service frequency limit;
[0075] (d) Character quota control: The total number of characters consumed in this translation is accumulated. When the total consumption reaches the preset quota limit, the translation stops to prevent exceeding the service quota.
[0076] After translation is completed, the translation results for each target language are written into the corresponding multilingual internationalization resource file.
[0077] Example 3
[0078] In another embodiment of the present invention, the identification of text content requiring multilingual internationalization and the filtering of text content not requiring multilingual internationalization based on the results of grammatical analysis are achieved by regular expression matching rather than node analysis based on abstract syntax trees.
[0079] Specifically, during the code conversion phase of the build tool, the text content of the source code file is read directly. Predefined regular expression patterns (e.g., / [\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]+ / g) are used to match consecutive segments of Chinese characters in the source code. Each matched segment is treated as a text term to be internationalized in multiple languages. Meanwhile, to reduce the false recognition rate, the source code is preprocessed before regular expression matching: single-line comments (content starting with / / ) and multi-line comments (content between / * ... * / ) are removed, and then regular expression matching is performed on the remaining code.
[0080] However, this approach has the following shortcomings compared to the abstract syntax tree-based approach: Because regular expressions cannot recognize the syntactic structure of code, for text in string concatenation expressions (e.g., 'current page number: ' + pageNum), the regular expression can only match the 'current page number:' part and cannot recognize that pageNum is a variable rather than text; for strings embedded in complex expressions, it cannot determine whether multilingual internationalization should be performed based on the context (e.g., when both object property names and values are strings, the regular expression cannot distinguish which should be converted). Therefore, this approach has lower recognition accuracy than the abstract syntax tree-based approach. Nevertheless, for projects with low accuracy requirements and small code size, this approach still has practical value due to its simple implementation and lack of additional syntax parsing dependencies.
[0081] Example 4
[0082] In another embodiment of the present invention, the multilingual internationalization processing logic is not integrated into the plugin system of the front-end engineering build tool, but is implemented as an independent command-line tool and runs independently outside the build process.
[0083] Specifically, the processing logic described in steps S1 to S4 of Embodiment 1—including source code file filtering, intelligent term recognition based on abstract syntax trees, term collection and key allocation, abstract syntax tree node replacement and multilingual internationalization dependency injection, and multilingual internationalization resource file generation—is encapsulated into a standalone command-line tool. When needed, developers execute a preset command in the terminal (e.g., `i18n-auto --src . / src --output . / locales`). The command-line tool scans all source code files in the specified directory, executes the aforementioned processing logic, and generates or updates multilingual internationalization resource files. This command-line tool can be integrated into a continuous integration / continuous delivery pipeline and automatically triggered before each code merge or release.
[0084] The advantage of this approach is that it does not rely on any specific build tool, making it applicable to projects using different build tools without increasing the time overhead during the build process. Its disadvantages are: the command-line tool executes independently of the build process, making it unable to utilize the real-time file change monitoring mechanism provided by the build tool. Therefore, it cannot handle code changes in real time during development, and developers must manually rerun the command-line tool after each source code modification to see the multi-language internationalization effect. Furthermore, the command-line tool requires additional learning and execution steps, resulting in a less smooth development experience compared to plugin integration solutions.
[0085] Example 5
[0086] In another embodiment of the present invention, the multilingual internationalization processing logic is implemented in the form of a Git Hook script, which is triggered during the code submission phase, rather than being integrated into the front-end engineering build tool.
[0087] Specifically, a pre-commit or pre-push hook script is registered in the project's Git repository. This script includes the processing logic described in steps S1 to S4 of Example 1, such as source code file filtering, intelligent term recognition based on abstract syntax trees, term collection and key assignment, abstract syntax tree node replacement and multilingual internationalization dependency injection, and multilingual internationalization resource file generation. When the developer executes the `git commit` or `git push` command, Git automatically triggers this hook script before the commit or push operation is completed. It performs multilingual internationalization processing on the changed source code files involved in this commit and includes the generated multilingual internationalization resource files in this commit.
[0088] Furthermore, the Git Hook solution can also be extended to an independent task phase in a continuous integration / continuous delivery pipeline. That is, before the code building phase of the continuous integration / continuous delivery pipeline, a multi-language internationalization preprocessing phase is added to execute the above-mentioned processing logic.
[0089] The advantage of this approach is its complete decoupling from the build process, ensuring no impact on build performance during development and guaranteeing that each code commit includes multilingual internationalization code conversions and resource files. Its disadvantage lies in the delay in processing: developers cannot preview the multilingual internationalization effects in real-time during the coding phase; they can only see the conversion results after committing the code. If the conversion results do not meet expectations (e.g., misidentification or omission), developers need to modify the code and commit again, resulting in multiple correction records in the commit history and increasing the complexity of version management. Furthermore, the distribution and maintenance of Git Hook scripts require additional team collaboration costs, and differences in configuration between different developers' local environments may cause hook script execution failures.
[0090] Example 6
[0091] like Figure 3 As shown, an automated multilingual internationalization processing system for the front-end engineering build phase includes:
[0092] The integration module M1 integrates multilingual internationalization processing logic into the front-end engineering build process;
[0093] The filtering module M2 performs syntax analysis on the source code during the code compilation stage of the construction process, identifies text content that requires multilingual internationalization based on the syntax analysis results, and filters out text content that does not require multilingual internationalization.
[0094] The module M3 is invoked to replace the identified text content with multilingual internationalization function calls and to establish a mapping relationship between the text content and multilingual internationalization key names.
[0095] The output module M4 generates multilingual internationalization resource files according to the mapping relationship during the resource output stage of the construction process.
[0096] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An automatic multilingual internationalization processing method in the front-end project build phase, characterized in that, include: Integrate multilingual internationalization processing logic into the front-end engineering build process; During the code compilation stage of the construction process, the source code is subjected to syntax analysis. Based on the syntax analysis results, text content that requires multilingual internationalization is identified, and text content that does not require multilingual internationalization is filtered out. The identified text content is replaced with multilingual internationalization function calls, and a mapping relationship is established between the text content and multilingual internationalization key names; In the resource output stage of the construction process, multilingual internationalization resource files are generated according to the mapping relationship.
2. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 1, characterized in that, The integration of multilingual internationalization processing logic into the front-end project build process includes: registering the automatic multilingual internationalization plugin to the plugin system of the build tool, and automatically activating the multilingual internationalization processing logic when the build process starts through the plugin loading mechanism of the build tool.
3. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 1, characterized in that, The code compilation phase of the build process also includes: performing syntax analysis on the source code; during the phase in which the build tool converts each source code file, parsing the currently processed source code file into an abstract syntax tree; and traversing the string type nodes and / or template string type nodes in the abstract syntax tree to identify the text content contained therein.
4. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 3, characterized in that, The process of identifying text content that requires multilingual internationalization based on grammatical analysis results and filtering out text content that does not require multilingual internationalization includes: obtaining the parent node type information and / or position information of the traversed node; when the parent node type belongs to a preset set of node types that do not require processing, skipping the current node; the set of node types that do not require processing includes at least: module import / export declaration nodes, console log output nodes, and comment nodes.
5. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 3, characterized in that, The method of identifying text content that requires multilingual internationalization based on syntax analysis results and filtering out text content that does not require multilingual internationalization also includes: reading the comment content corresponding to the source code line where the currently traversed node is located, and skipping the current node when the comment content contains a preset skip flag.
6. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 3, characterized in that, The text content requiring multilingual internationalization identified based on the grammatical analysis results includes: Detect whether the string in the traversed node contains target language characters; when the string contains both target language characters and other language characters, extract the continuous segment containing the target language characters from the string as the text content that needs to be internationalized in multiple languages, and leave the non-target language character part of the string unchanged.
7. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 3, characterized in that, The step of replacing the identified text content with a multilingual internationalized function call includes: selecting a replacement strategy that matches the context type based on the context type of the traversed node, and replacing the string content of the node with a multilingual internationalized function call node with the key name as the only parameter; the context type includes at least one of the following: variable declaration, function call parameter, array element, object attribute value, binary expression operand, conditional expression branch, and return statement.
8. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 1, characterized in that, The step of replacing the identified text content with multilingual internationalization function calls and establishing a mapping relationship between the text content and multilingual internationalization key names includes: obtaining the existing key name set in the generated mapping relationship, detecting whether there are empty key names in the key name set; if there are, assigning the current text content to the empty key name; if there are no empty key names, generating new key names according to the incrementing rule and assigning them to the current text content.
9. The automatic multilingual internationalization processing method in the front-end project construction stage according to claim 1, characterized in that, After replacing the identified text content with a multilingual internationalization function call, the method further includes: detecting whether the abstract syntax tree of the current source code file already contains the import declaration node corresponding to the multilingual internationalization function; if not, inserting the import declaration node at the top of the abstract syntax tree.
10. An automatic multilingual internationalization processing system for the front-end engineering construction phase, characterized in that, The automatic multilingual internationalization processing method for the front-end engineering construction stage according to any one of claims 1 to 9 includes: An integration module integrates multilingual internationalization processing logic into the front-end engineering build process; The filtering module performs syntax analysis on the source code during the code compilation stage of the build process, identifies text content that requires multilingual internationalization based on the syntax analysis results, and filters out text content that does not require multilingual internationalization. The calling module replaces the identified text content with multilingual internationalization function calls and establishes a mapping relationship between the text content and multilingual internationalization key names; The output module generates multilingual internationalization resource files based on the mapping relationship during the resource output stage of the construction process.