Multi-language configuration file automatic generation method, file conversion method and device
By automatically generating multilingual configuration files and automatically detecting template syntax, the high cost and low efficiency of multilingual text management in web front-end development are solved, achieving efficient and accurate text content management and detection, and improving development efficiency and code quality.
Patent Information
- Application Number
- CN202411010248.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-11
AI Technical Summary
In web front-end development, as the number of supported languages increases, the workload of maintaining multilingual text content increases exponentially, resulting in high development costs and low efficiency. Furthermore, existing technologies lack automated text content management and detection mechanisms.
By parsing configuration files, extracting text content, and generating unique identifiers, multilingual configuration files are automatically generated. Template syntax is detected in the source code, and text content is automatically converted. Template syntax ignoring and code submission checks are provided to ensure the correctness of the text content.
It reduces the cost and manual maintenance of multilingual development, improves development efficiency, ensures the accuracy and consistency of text content, and enhances code simplicity and performance.
Smart Images

Figure CN118760465A_ABST
Abstract
Description
Technical Field
[0002] The present invention belongs to the field of computer technology, and in particular relates to a multi-language configuration file automatic generation method, a file conversion method and a device. Background Art
[0003] In the current web front-end software development, there are already many solutions for converting the text of the website to the corresponding language in real time according to the language selected by the user and displaying it to the user. Usually, different texts in each language are maintained manually for display. For example, if a website needs to be able to switch between Chinese and English, then Chinese text and English text need to be maintained. In the development of the web front-end, when a new text is added, such as "product description", the developer needs to manually maintain the Chinese and English configuration files. At the same time, in order to establish the association between the texts, a key needs to be created to represent the text. When the website is switched to Chinese, the text corresponding to this key is obtained from the Chinese configuration file, and the same is true for English. When the number of languages supported by the website increases, the workload of front-end development that needs to maintain text is a multiple of the number of languages. Summary of the invention
[0004] The present invention aims to solve the above-mentioned technical problems and provides a method for automatically generating a multi-language configuration file, a method for converting a file and a device.
[0005] A method for automatically generating a multi-language configuration file, comprising: Obtain a configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, translate the text contents into various languages, and then insert the text contents and corresponding unique identifiers in different languages into various language configuration files under a preset multi-language configuration file directory in a preset format object; A source code file is obtained, a template syntax is found in the source code file, and a text content in the template syntax is detected whether it exists in each language configuration file. If not, a new unique identifier is generated for the text content. After the text content is translated into each language, the text content in different languages and the corresponding new unique identifier are inserted into each language configuration file in a preset format object.
[0006] Optionally, it also includes: Scan the multi-language configuration file directory, and create empty language configuration files corresponding to each language type according to the pre-configured language type. If a language configuration file already exists in the multi-language configuration file directory, the language configuration file will not be created.
[0007] Optionally, when the text content and the corresponding unique identifier are inserted into each language configuration file, if no language configuration file exists, an empty language configuration file is first created in the multi-language configuration file directory before the insertion operation is performed.
[0008] Optionally, when searching for template syntax in the source code file, all template syntax are read by regular matching.
[0009] Optionally, generating a new unique identifier for the text content includes: Get the module name corresponding to the specified module level in the directory path where the source code file is located as the prefix, generate a random number of a preset length as the suffix, and generate a new unique identifier.
[0010] Optionally, the random number is generated by a random combination of 26 uppercase letters, 26 lowercase letters, and numbers 0-9.
[0011] Optionally, the template syntax is text content in a preset format and the text content is in a preset first language.
[0012] Optionally, the template syntax is text content in a preset format, and the text content adopts a preset first language and a second language corresponding to the first language.
[0013] A file conversion method, comprising: A source code file is obtained, a template syntax is searched out in the source code file, text content in the template syntax is extracted, a unique identifier corresponding to the text content is obtained from a language configuration file obtained by the above-mentioned method for automatically generating a multi-language configuration file of the present invention, and the template syntax in the source code file is converted into a current language configuration file execution code, wherein the current language configuration file execution code contains the unique identifier.
[0014] Optionally, it also includes: After triggering the code submission instruction, the source code file is traversed to find out whether the template syntax is not converted. If it is, the unconverted template syntax is displayed; if it is not, the source code is saved.
[0015] Optionally, after finding the template syntax in the source code file, the method further includes: Determine whether the template syntax belongs to the ignored replacement range, if so, ignore the template syntax and continue to search for the next template syntax; After triggering the code submission instruction, the source code file is traversed to find whether the template syntax is not converted, and the template syntax belonging to the ignored replacement range is ignored.
[0016] Optionally, the ignore replacement range corresponds to several special syntaxes, and the special syntaxes can be written in the source code file in the form of comments.
[0017] Optionally, the ignoring replacement range includes at least one of ignoring a line of code, ignoring a code block, and ignoring the entire file.
[0018] A file conversion device, comprising: A configuration file parser, used to obtain a configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, and insert the text contents in different languages and the corresponding unique identifiers into each language configuration file under a preset multi-language configuration file directory in a preset format object; A template syntax converter is used to obtain a source code file, find out the template syntax in the source code file, and detect whether the text content in the template syntax exists in each language configuration file, obtain a unique identifier corresponding to the text content from the language configuration file, and convert the template syntax in the source code file into a current language configuration file execution code, wherein the current language configuration file execution code contains the unique identifier.
[0019] The configuration file generator is used to generate a new unique identifier for the text content in the template syntax when the text content does not exist in each language configuration file, and insert the text content in different languages and the corresponding new unique identifier into each language configuration file in a preset format object.
[0020] Beneficial effects: The present invention has at least one or more of the following advantages: 1. The present invention can detect the text content in the code of the developer and automatically generate a unique identifier of the corresponding text, and automatically generate the unique identifier and the corresponding text into the configuration files of all languages. The front-end development does not need to manually add the text to all configuration files one by one during the development process, and the developer does not need to manually search in the multi-language files to see if the text already exists, nor does it need to manually maintain the text and unique identifier in each language configuration, which can greatly reduce the development costs related to multiple languages.
[0021] 2. The writing method of template syntax allows developers to develop very conveniently without affecting the original development experience. And it can control which texts need to be extracted and converted and which do not. This makes the present invention flexible and autonomous. At the same time, during the development process of the entire functional module, because there is no need to care about the configuration file, you can focus on the page function itself without interrupting the flow state of development. You only need to focus on process coding, which will greatly improve development efficiency.
[0022] 3. The present invention converts the template syntax into the current language configuration file execution code. When in use, the converted source code file is executed. When the page is finally displayed, the code is directly executed through the current language configuration file, and the text in the current language is read through the unique identifier calling method. Compared with function calls, it saves more memory, has relatively better performance, and has simpler code.
[0023] 4. The template grammar of the present invention additionally provides text content in two languages, providing more flexible translation requirements for the same text content in different contexts, different languages and different business scenarios.
[0024] 5. The "text that needs to be converted but has not been converted" detection function provided by the present invention can effectively prevent the website from displaying language text incorrectly. At the same time, there is no need to manually check the code. These problematic texts will be automatically detected when the code is submitted, which greatly improves the error checking efficiency of developers and ensures the correctness of the text displayed in the set language on the website page.
[0025] The present invention provides several special syntaxes that can ignore conversions and can support special scenarios where no conversion is required, while taking into account stability and high scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of a multi-language configuration file directory of the present invention; Figure 2 A schematic diagram of the directory path where the module name uniquely identified by the present invention is located; Figure 3 A schematic diagram of a prompt after the code file is detected in the present invention; Figure 4 Schematic diagrams of several annotation forms of the special syntax of the present invention. DETAILED DESCRIPTION
[0027] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings so that the purpose, features and advantages of the present invention can be more clearly understood. It should be understood that the embodiments shown in the accompanying drawings are not intended to limit the scope of the present invention, but are only intended to illustrate the essential spirit of the technical solution of the present invention.
[0028] In the following description, certain specific details are set forth for the purpose of illustrating the various disclosed embodiments to provide a thorough understanding of the various disclosed embodiments. However, those skilled in the relevant art will recognize that the embodiments may be practiced without one or more of these specific details. In other cases, well-known devices, structures, and techniques associated with the present application may not be shown or described in detail to avoid unnecessarily obscuring the description of the embodiments.
[0029] References throughout the specification to "one embodiment" or "an embodiment" indicate that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment. Thus, the appearances of "in one embodiment" or "in an embodiment" in various places throughout the specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any manner in one or more embodiments.
[0030] In the following description, in order to clearly show the structure and working mode of the present invention, many directional words will be used for description, but the words "front", "back", "left", "right", "outside", "inside", "outward", "inward", "up", "down", etc. should be understood as convenient terms and should not be understood as restrictive terms.
[0031] An embodiment of the present invention provides a method for automatically generating a multi-language configuration file, the method specifically comprising the following steps: S11, obtain the configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, translate the text contents into various languages, and then insert the text contents and corresponding unique identifiers in different languages into various language configuration files under a preset multi-language configuration file directory in a preset format object.
[0032] The configuration file in this step is an existing language configuration file. In order to facilitate the switching of the website language, language configuration files of different languages will be configured in the website system. The language configuration file directory in the project can be pre-specified. The example of the present invention is src / locales in the root directory of the project, such as Figure 1 shown.
[0033] This step can be implemented through a file parser. The parsing and specific format of the configuration file are shown in the following example.
[0034] Configuration Files: { 'components.Vk0cYQ6B': 'Button component', 'components.qqosReqH': 'Label component', 'setting.GNGKlric': 'System Preferences', 'setting.ROHj7CJy': 'System information', } This step extracts the data in the Chinese configuration file, obtains the text content and the corresponding unique identifier, and converts it into a preset format for searching the unique identifier of the text in the configuration files of different languages: Chinese configuration file: { 'Button component': 'components.Vk0cYQ6B', 'Tag component': 'components.qqosReqH', 'System Preferences': 'setting.GNGKlric', 'System Information': 'setting.ROHj7CJy', } English configuration file: { 'Button Component': 'components.Vk0cYQ6B', 'Label Component': 'components.qqosReqH', 'System Preferences': 'setting.GNGKlric', 'System information': 'setting.ROHj7CJy', } It can be seen that in different language configuration files, the unique identifier is always the same, and the text content in each language configuration file is translated into different languages. Of course, the unique identifiers in all configuration files are generated using the same generation rules.
[0035] In this step, the translation of the text content needs to be implemented by the developer in different language files according to their own needs, for example, it can be implemented through a preset translator.
[0036] S12, obtaining the source code file, finding the template syntax in the source code file, and detecting whether the text content in the template syntax exists in each language configuration file. If not, a new unique identifier is generated for the text content. After translating the text content into each language, the text content in different languages and the corresponding new unique identifier are inserted into each language configuration file as a preset format object.
[0037] The template syntax in this step is predetermined. During the development process, developers use the template syntax to encode the text that needs to be detected and extracted so that the template syntax can be converted into the final running code.
[0038] This step can be implemented through a template syntax converter and a configuration file generator. The template syntax converter is used to detect and extract text content, and the configuration file generator is used to generate a unique identifier and insert it into the language configuration file together with the text content.
[0039] An example of template syntax is: yy / System Information / Among them, yy / is the beginning of the template, and the / at the end is the end of the template. The "system information" in the middle is the text content that needs to be detected and extracted into the language configuration file under the template syntax. This text will be automatically converted into the language text under the corresponding language configuration file according to the language settings in the actual website display.
[0040] When the text content in the template syntax does not exist in each language configuration file, for example, 'system information' does not exist in any language configuration file, a new key generated for 'system information' is: 'setting.ROHj7CJy'. At this time, 'system information' is used as the value. After 'system information' is translated, it is inserted into all language configuration files in the format of value: key.
[0041] In one embodiment, the method for automatically generating a multi-language configuration file further includes: S10, scanning the multi-language configuration file directory, and creating empty language configuration files corresponding to each language type according to the pre-configured language type. If a language configuration file already exists in the multi-language configuration file directory, the language configuration file is not created again.
[0042] For example, if there are two pre-configured language types, Chinese and English, create a Chinese configuration file and an English configuration file in the preset multi-language configuration file directory. Figure 1 As shown in , en-US.json represents an English configuration file for the English language, and zh-CN.json represents a Chinese configuration file for the Chinese language. Therefore, each language configuration file does not need to be manually created, and the present invention can automatically generate it.
[0043] This step can be achieved through the configuration file generator.
[0044] In one embodiment, when the text content and the corresponding unique identifier are inserted into each language configuration file, if no language configuration file exists, an empty language configuration file is first created in the multi-language configuration file directory before the insertion operation is performed.
[0045] In one embodiment, when searching for template syntax in a source code file, all template syntax are read through regular matching.
[0046] The specific regular code examples are as follows: const yyTemplateRegx = / yy\ / ((?!yy).)+\ / / g; The text content in the template syntax is extracted and stored through regular expressions.
[0047] This step can be achieved through a template syntax converter.
[0048] In one embodiment, a new unique identifier is generated for the text content, including: Get the module name corresponding to the specified module level in the directory path where the source code file is located as the prefix, generate a random number of a preset length as the suffix, and generate a new unique identifier.
[0049] An example of a generation rule of the unique identifier (key) of the present invention is: module name.uuid The module name is the specified module level in the directory path where the source code file is located, and the uuid is randomly generated from 8-bit uppercase and lowercase letters and numbers.
[0050] The random number is preferably generated by a random combination of 26 uppercase letters, 26 lowercase letters, and numbers 0 to 9. Therefore, the possible number of suffixes is 62^8, and the probability of repetition in a module is less than one in a hundred million.
[0051] like Figure 2 As shown, the upper left box is the directory path where the source code file is located. You can pre-specify which level to use as the module name, for example Figure 2 The key prefix in the configuration reading of langConfig is the module name processCenter specified in the project, which obviously specifies the third level of the directory.
[0052] In one embodiment, the template syntax is text content in a preset format and the text content uses a preset first language.
[0053] In this embodiment, the preset first language may be Chinese, English or other languages.
[0054] A preset format of template syntax is yy / text content / . Of course, other preset formats can also be used.
[0055] In one embodiment, the template syntax is text content in a preset format, and the text content uses a preset first language and a second language that corresponds to the first language.
[0056] In order to meet the special scenarios where the same Chinese text in different modules corresponds to different words and terms for translation into different languages, the template grammar of the present invention provides a specific writing method, that is, the template grammar contains text content in two different languages, and of course can also contain text content in multiple languages, and the text content in each language can be separated by a separator.
[0057] An example of template syntax is: yy / Text Content / The text content included in the above template can use vertical lines to specify the correspondence between Chinese and English. At this time, when the configuration file generator finally generates the configuration, the Chinese and English texts with the same key will be generated into the Chinese and English configuration files. At this time, the text content does not need to be translated and can be inserted into each language configuration file.
[0058] An embodiment of the present invention provides a file conversion method, the method comprising: Get the source code file, find the template syntax in the source code file, extract the text content in the template syntax, get the unique identifier corresponding to the text content from the language configuration file, convert the template syntax in the source code file into the current language configuration file execution code, and the current language configuration file execution code contains the unique identifier.
[0059] The above-mentioned language configuration files are the language configuration files generated by the method for automatically generating a multi-language configuration file provided by the above-mentioned embodiments of the present invention.
[0060] When obtaining the unique identifier corresponding to the text content from the language configuration file, the unique identifier may be searched and obtained from the language configuration file corresponding to the writing language of the template syntax in the source code file.
[0061] This embodiment can be implemented through a template syntax converter, which converts the text reading of a json configuration file into a configuration text according to a key value.
[0062] An example of converting template syntax into the current language configuration file execution code is: The front-end development code (source code file) contains: title='yy / System Information / ' / > The extracted text content is 'system information', and the corresponding unique identifier is 'setting.ROHj7CJy', so the conversion result is: title={langConfig['setting.ROHj7CJy']} / > Among them, langConfig is the json configuration file of the current language. It will automatically read the corresponding file according to the language switched by the website, and finally directly read the text content and render it to the page.
[0063] In one embodiment, the file conversion method further includes: After the code submission instruction is triggered, the source code file is traversed to find out whether there is template syntax that has not been converted. If so, the unconverted template syntax is displayed. If not, the source code is saved.
[0064] This embodiment also provides a text detection function when submitting code. You can control whether to turn on this function through a switch. The function is as follows: when there is Chinese text or other language text that should be converted but is not converted in the source code file, the code submission will be blocked and prompts will be given as to which text in which files needs to be converted, such as Figure 3 As shown in , this is a prompt display method to prevent these texts from not being correctly displayed in the corresponding language when the website is running.
[0065] In one embodiment, after finding the template syntax in the source code file, the method further includes: Determine whether the template syntax belongs to the ignored replacement range. If so, ignore the template syntax and continue to search for the next template syntax. After triggering the code submission instruction, traverse the source code file to find whether there is template syntax that has not been converted, and ignore the template syntax that belongs to the ignored replacement range.
[0066] Correspondingly, in some special scenarios, such as when other languages cannot correctly express the meaning of the Chinese expression, this embodiment also provides a special template syntax to express the ignored replacement scope.
[0067] Preferably, the following special syntax can be written in the form of comments to ignore a line of code, a code block, or an entire file to handle special scenarios.
[0068] @yy-ignore: Ignore a line of code. The text content in the next line of code using this special syntax will be ignored.
[0069] @yy-ignore-file: Ignore the entire file. This is written on the first line of the file. After use, all text in this file will be ignored.
[0070] @yy-ignore-block: Ignore code block, written before a section of code. Need to be used together with @yy-ignore-block-end to indicate the end of this section of code.
[0071] The above three special grammar writing examples that can ignore text conversion to meet special scenarios are as follows: Figure 4 shown.
[0072] An embodiment of the present invention provides a file conversion device, comprising: A configuration file parser is used to obtain the configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, and insert the text contents in different languages and the corresponding unique identifiers into each language configuration file under a preset multi-language configuration file directory in a preset format object; The template syntax converter is used to obtain the source code file, find the template syntax in the source code file, and detect whether the text content in the template syntax exists in each language configuration file, obtain the unique identifier corresponding to the text content from the language configuration file, and convert the template syntax in the source code file into the current language configuration file execution code, which contains the unique identifier.
[0073] The configuration file generator is used to generate a new unique identifier for the text content when the text content in the template syntax does not exist in each language configuration file, and insert the text content in different languages and the corresponding new unique identifier into each language configuration file in a preset format object.
[0074] In one embodiment, the configuration file generator is further used to scan the multi-language configuration file directory, and create empty language configuration files corresponding to each language type according to the pre-configured language type. If a language configuration file already exists in the multi-language configuration file directory, the language configuration file will not be created. Example
[0075] 1. Determine the multi-language configuration file directory: Specify the multi-language configuration file directory under the project directory to be developed, such as Figure 1 As shown. Finally, the configuration file parser will parse all configuration files into JSON format objects in different languages, which is convenient for extracting keys and matching texts later.
[0076] 2. Use template syntax to develop text content: During the development process, when writing text, use the template syntax "yy / text content / " provided by the device to replace the original "text content". You can use the @yy-ignore, @yy-ignore-file, and @yy-ignore-block additionally provided by the present invention to specify the "text content" that does not need to be converted.
[0077] 3. Detect and convert template syntax: Through the template syntax converter, you can detect "yy / text content / " and check whether the "text content" already exists in the language configuration file.
[0078] 4. Generate configuration files and file contents related to "text content": After step 3, if "text content" does not exist, the configuration file generator will be used to add the "text content" configuration to all language configuration files. (If the language configuration file does not exist, the configuration file generator will generate the corresponding file first) 5. Convert "yy / text content / ": The template syntax converter completes the detection and text extraction in step 3. At this time, it converts "yy / text content / " into langConfig configuration reading. The configuration file reads the key corresponding to the "text content" configuration and converts the source code file.
[0079] 6. Submit code: Check which texts that should be converted are not converted. The text specified in step 2 using @yy-ignore, @yy-ignore-file, and @yy-ignore-block will be ignored. If there are texts that need to be converted but have not been converted, an error will be reported, such as Figure 3 As shown, after the developer handles the error, he can submit the code.
[0080] At this point, with the joint efforts of the configuration file parser, template syntax converter, and configuration file generator, the language configuration files and source code files required for multi-language support are automatically generated, while improving the quality of written text codes and ensuring the accuracy of the website's language display.
[0081] The preferred embodiments of the present invention have been described in detail above, but it should be understood that after reading the above teachings of the present invention, those skilled in the art may make various changes or modifications to the present invention. These equivalent forms also fall within the scope defined by the appended claims of this application.
Claims
1. A method for automatically generating a multi-language configuration file, characterized in that: include: Obtain a configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, translate the text contents into various languages, and then insert the text contents and corresponding unique identifiers in different languages into various language configuration files under a preset multi-language configuration file directory in a preset format object; A source code file is obtained, a template syntax is found in the source code file, and a text content in the template syntax is detected whether it exists in each language configuration file. If not, a new unique identifier is generated for the text content. After the text content is translated into each language, the text content in different languages and the corresponding new unique identifier are inserted into each language configuration file in a preset format object.
2. The method for automatically generating a multi-language configuration file according to claim 1, wherein: Also includes: Scan the multi-language configuration file directory, and create empty language configuration files corresponding to each language type according to the pre-configured language type. If a language configuration file already exists in the multi-language configuration file directory, the language configuration file will not be created; When the text content and the corresponding unique identifier are inserted into each language configuration file, if no language configuration file exists, an empty language configuration file is first created in the multi-language configuration file directory before the insertion operation is performed.
3. The method for automatically generating a multi-language configuration file according to claim 1, wherein: When searching for template syntax in the source code file, all template syntax are read by regular matching.
4. The method for automatically generating a multi-language configuration file according to claim 1, wherein: Generate a new unique identifier for the text content, including: Get the module name corresponding to the specified module level in the directory path where the source code file is located as the prefix, generate a random number of a preset length as the suffix, and generate a new unique identifier; The random number is preferably generated by a random combination of 26 uppercase letters, 26 lowercase letters, and numbers 0-9.
5. The method for automatically generating a multi-language configuration file according to any one of claims 1 to 4, characterized in that: The template syntax is text content in a preset format and the text content is in a preset first language; And / or, the template syntax is text content in a preset format and the text content uses a preset first language and a second language corresponding to the first language.
6. A file conversion method, characterized in that: include: Obtain a source code file, find a template syntax in the source code file, extract text content in the template syntax, obtain a unique identifier corresponding to the text content from a language configuration file obtained by the method for automatically generating a multi-language configuration file according to any one of claims 1 to 5, convert the template syntax in the source code file into a current language configuration file execution code, wherein the current language configuration file execution code contains the unique identifier.
7. The file conversion method according to claim 6, characterized in that: Also includes: After triggering the code submission instruction, the source code file is traversed to find out whether the template syntax is not converted. If it is, the unconverted template syntax is displayed; if it is not, the source code is saved.
8. The file conversion method according to claim 6, characterized in that: After finding the template syntax in the source code file, it also includes: Determine whether the template syntax belongs to the ignored replacement range, if so, ignore the template syntax and continue to search for the next template syntax; After triggering the code submission instruction, traverse the source code file to find whether the template syntax is not converted. If it is, display the unconverted template syntax. If it is not, save the source code. After triggering the code submission instruction, the source code file is traversed to find whether the template syntax is not converted, and the template syntax belonging to the ignored replacement range is ignored.
9. The file conversion method according to claim 8, characterized in that: The ignore replacement range corresponds to a number of special syntaxes, and the special syntaxes can be written in the source code file in the form of comments; The ignoring replacement range preferably includes at least one of ignoring a line of code, ignoring a code block, and ignoring the entire file.
10. A file conversion device, characterized in that: include: A configuration file parser, used to obtain a configuration file, parse the configuration file, extract all text contents and corresponding unique identifiers, and insert the text contents in different languages and the corresponding unique identifiers into each language configuration file under a preset multi-language configuration file directory in a preset format object; A template syntax converter is used to obtain a source code file, find the template syntax in the source code file, detect whether the text content in the template syntax exists in each language configuration file, obtain the unique identifier corresponding to the text content from the language configuration file, and convert the template syntax in the source code file into the current language configuration file execution code, wherein the current language configuration file execution code contains the unique identifier. A configuration file generator is used to generate a new unique identifier for the text content when the text content in the template syntax does not exist in each language configuration file, and insert the text content in different languages and the corresponding new unique identifier into each language configuration file in a preset format object.
