Multi-language file generation method and device in multi-person collaborative project development and medium

Through the server, multilingual documents and developer data are obtained and processed, and multilingual files suitable for collaborative development of multiple people are generated, solving the problems of low efficiency and poor flexibility of multilingual development in the existing technology, and achieving efficient multilingual file generation and conversion.

CN119621660APending Publication Date: 2025-03-14GUIYANG YUWAN SCI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411688051.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

Existing multi-language development technology is difficult to achieve multi-person collaborative development, and the multi-language file generation efficiency is low, especially when facing special languages, the flexibility of whole sentence replacement is poor.

Method used

The document ID and developer identification of shared multilingual documents are obtained through the server, converted into JSON format files, and combined with the multilingual data supplemented by the developer, multilingual files are generated, and processed based on language rules to generate project multilingual files suitable for different languages.

Benefits of technology

It realizes efficient generation of multi-language files in multi-person collaborative project development, quickly obtains multi-language content, improves the efficiency of multi-language file conversion, and takes time to control within 1 second, suitable for multi-person collaborative development scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621660A_ABST
    Figure CN119621660A_ABST
Patent Text Reader

Abstract

The invention provides a multi-language file generation method and device in multi-person collaborative project development and a medium, the method is applied to a server, and the method comprises the following steps: obtaining a document ID of a shared multi-language document corresponding to a current project and a developer identifier of a current developer; converting the shared multi-language document into a first file in a JSON format based on the document ID; obtaining multi-language data supplemented by the current developer in a project multi-language library based on the developer identifier, and converting the multi-language data into a second file in a JSON format; splicing the first file and the second file to obtain a multi-language file; and obtaining a multi-language rule, and processing the multi-language file corresponding to the developer identifier to obtain a project multi-language file corresponding to the developer identifier in the current project. According to the multi-language file generation method and device, the multi-language file generation in multi-person collaborative project development is achieved, the online document is used as a public part for bearing multiple languages, multi-language content can be rapidly obtained, efficient multi-language file conversion is achieved, and the multi-language file generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a method, device and medium for generating multi-language files in multi-person collaborative project development. Background Art

[0002] In software development, for multi-region situations (especially for overseas applications), it is necessary to configure front-end display interfaces in multiple languages. Existing multi-language development generally involves developing project files, using translation to create multi-language files, and then using plug-ins to replace them. However, this method is difficult to achieve multi-person collaborative development for project development because different developers have different naming habits. In addition, most of the existing multi-language file generation solutions are based on translation to build a language library, use the language library to find the corresponding key name, use plug-ins to replace, and finally generate multi-language files. When searching for a large number of multi-languages, the efficiency is low. And when it comes to some special languages, usually only the entire sentence can be replaced, which is less flexible. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide a method, device and medium for generating multilingual files in multi-person collaborative project development, so as to realize the generation of multilingual files in multi-person collaborative project development, and use online documents as the common part that carries multiple languages, so as to quickly obtain multilingual content, realize efficient multilingual file conversion, and improve the generation efficiency of multilingual files.

[0004] In order to achieve the above purpose, the embodiments of the present application are implemented in the following manner:

[0005] In a first aspect, an embodiment of the present application provides a method for generating multilingual files in multi-person collaborative project development, which is applied to a server and includes: obtaining a document ID of a shared multilingual document corresponding to the current project and a developer identifier of the current developer, wherein the shared multilingual document represents a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages; based on the document ID, converting the shared multilingual document into a first file in JSON format; based on the developer identifier, obtaining the multilingual data supplemented by the current developer in the project multilingual library, and converting it into a second file in JSON format; concatenating the first file and the second file to obtain a multilingual file corresponding to the developer identifier; obtaining a multilingual rule, and based on the multilingual rule, processing the multilingual file corresponding to the developer identifier to obtain a project multilingual file corresponding to the developer identifier in the current project.

[0006] In combination with the first aspect, in a first possible implementation method of the first aspect, based on the document ID, a shared multilingual document is converted into a first file in JSON format, including: based on the document ID, accessing the shared multilingual document corresponding to the current project; extracting and parsing the language text content of the shared multilingual document through a cloud function deployed in the server, converting it into a two-dimensional array, and storing it as a first file in JSON format.

[0007] In combination with the first aspect, in a second possible implementation method of the first aspect, based on the developer identifier, the multilingual data supplemented by the current developer in the project multilingual library is obtained and converted into a second file in JSON format, including: based on the developer identifier, the language text content in the multilingual data supplemented by the current developer in the project multilingual library is obtained through PHP and parsed, converted into a two-dimensional array, and stored as a second file in JSON format.

[0008] In combination with the first aspect, in a third possible implementation method of the first aspect, each language corresponds to a language identifier, a multilingual rule is obtained, and based on the multilingual rule, the multilingual file corresponding to the developer identifier is processed to obtain the project multilingual file corresponding to the developer identifier in the current project, including: obtaining the language rule corresponding to each language identifier; for each language file in the multilingual files corresponding to the developer identifier: based on the language rule corresponding to the language identifier, the corresponding language file is processed to obtain the project language file of each language, constituting the project multilingual file corresponding to the developer identifier in the current project.

[0009] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, based on the language rules corresponding to the language identifier, the corresponding language file is processed, including: according to each rule in the language rules corresponding to the language identifier, each language text in the corresponding language file is processed, and the processing includes several types of splitting, reversing, and variable replacement.

[0010] In combination with the first aspect, in a fifth possible implementation of the first aspect, each language text content in the shared multilingual document and each language text content in the multilingual data in the project multilingual library includes a key name. After obtaining the project multilingual file corresponding to the developer identifier in the current project, the method further includes: based on the key name corresponding to each language text content in the project multilingual file, using the i18n plug-in to automatically replace the project file with the corresponding language, so as to display the content of the corresponding language on the front end.

[0011] In combination with the fifth possible implementation method of the first aspect, in the sixth possible implementation method of the first aspect, the key name corresponding to each language text content is generated by: using AI to generate a unique key name based on the basic language part of each language text content, where the basic language is any specified language; or, obtaining a unique key name corresponding to each language text content entered by the current developer.

[0012] In a second aspect, an embodiment of the present application provides a device for generating multilingual files in multi-person collaborative project development, which is applied to a server and includes: a data acquisition unit, which is used to obtain the document ID of a shared multilingual document corresponding to the current project and the developer identifier of the current developer, wherein the shared multilingual document represents a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages; a multilingual document conversion unit, which is used to convert the shared multilingual document into a first file in JSON format based on the document ID; a multilingual data conversion unit, which is used to obtain the multilingual data supplemented by the current developer in the project multilingual library based on the developer identifier, and convert it into a second file in JSON format; a multilingual file generation unit, which is used to splice the first file and the second file to obtain the multilingual file corresponding to the developer identifier; a multilingual file processing unit, which is used to obtain multilingual rules, and based on the multilingual rules, process the multilingual file corresponding to the developer identifier to obtain the project multilingual file corresponding to the developer identifier in the current project.

[0013] In a third aspect, an embodiment of the present application provides a storage medium, which is arranged in a server and includes a stored program, wherein when the program is running, the server where the storage medium is located is controlled to execute the method for generating multi-language files in multi-person collaborative project development as described in the first aspect or any one of the possible implementation methods of the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a server comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the method for generating multi-language files in multi-person collaborative project development as described in the first aspect or any one of the possible implementation methods of the first aspect are implemented.

[0015] Beneficial effects: This solution obtains the document ID of the shared multilingual document corresponding to the current project (a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages) and the developer ID of the current developer through the server; based on the document ID, the shared multilingual document is converted into a first file in JSON format; based on the developer ID, the multilingual data supplemented by the current developer in the project multilingual library is obtained and converted into a second file in JSON format; the first file and the second file are concatenated to obtain the multilingual file corresponding to the developer ID; the multilingual rules are obtained, and based on the multilingual rules, the multilingual file corresponding to the developer ID is processed to obtain the project multilingual file corresponding to the developer ID in the current project. This solution can realize the generation of multilingual files in multilingual collaborative project development. By using online documents as the public part that carries multiple languages, multilingual content can be quickly obtained, efficient multilingual file conversion can be achieved, and the generation efficiency of multilingual files can be effectively improved. The part supplemented by the developer (usually a small amount, compared with the traditional solution where all multi-languages ​​are queried through the language library, the multi-language supplementary content used by the developer in the current project is extremely small) can be quickly converted, and can be processed synchronously with the shared multi-language documents to improve conversion efficiency. After the overall solution is running, the time required to generate multi-language files can be controlled within 1 second. This solution can be more suitable for actual development scenarios (usually requiring multiple people to collaborate and develop together), realize multi-language project development with multiple people, and does not require unified naming habits among developers, which is very friendly to developers.

[0016] 2. This solution uses the cloud function deployed in the server to extract and parse the content of the shared multilingual document, convert it into a two-dimensional array, extract the language text content of the shared multilingual document through the cloud function deployed in the server and parse it, and store it as a first file in JSON format. At the same time, based on the developer ID, the server can obtain the language text content in the multilingual data supplemented by the current developer in the project multilingual library through PHP and parse it, convert it into a two-dimensional array, and store it as a second file in JSON format. By splicing the first file and the second file, you can get the multilingual file corresponding to the developer ID. This greatly reduces the time spent on generating multilingual files, realizes the rapid conversion of multilingual files, and improves the efficiency of generating multilingual files for the project.

[0017] 3. By obtaining the language rules corresponding to each language identifier, for each language file in the multilingual file corresponding to the developer identifier: according to each rule in the language rules corresponding to the language identifier, each language text in the corresponding language file is processed, including splitting, reversing, and variable replacement (different languages ​​have different characteristics and different rules are configured. For example, Middle Eastern languages ​​are displayed from right to left and need to be split and reversed, while for displaying real-time data, variable replacement can be used to complete it). Based on this, the project language file of each language can be obtained to constitute the project multilingual file corresponding to the developer identifier in the current project. Each language text content in the shared multilingual document and each language text content in the multilingual data in the project multilingual library contain a key name. After obtaining the project multilingual file corresponding to the developer identifier in the current project, the i18n plug-in can be used to automatically replace the project file with the corresponding language based on the key name corresponding to each language text content in the project multilingual file to display the content of the corresponding language on the front end, thereby realizing the multilingualization of the project. Such a solution is simple and efficient, developer-friendly, and can be applied to multi-person collaborative project development scenarios. The key name can be generated by using AI to generate a unique key name based on the basic language part of each language text content, or by the developer entering a unique key name corresponding to each language text content. The naming habits of different developers do not interfere with each other.

[0018] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A flowchart of a method for generating multi-language files in multi-person collaborative project development provided in an embodiment of the present application.

[0021] Figure 2 A schematic diagram of sharing multi-language documents.

[0022] Figure 3 A schematic diagram for developers to select multilingual content that needs to be added to the current project from the total language library.

[0023] Figure 4 A diagram for developers to add multilingual data to the project's multilingual library.

[0024] Figure 5 A schematic diagram of the contents of a first file converted for sharing a multi-language document.

[0025] Figure 6 A schematic diagram of the contents of a multilingual file corresponding to a developer identifier obtained by concatenating a first file and a second file.

[0026] Figure 7 A schematic diagram of multi-language processing rules.

[0027] Figure 8 This is a schematic diagram showing the time consumption of multi-language operations.

[0028] Fig. 9 This is a schematic diagram of the generated multi-language files for the project.

[0029] Fig.10 A structural block diagram of a device for generating multi-language files in multi-person collaborative project development.

[0030] Icons: 10 - device for generating multi-language documents; 11 - data acquisition unit; 12 - multi-language document conversion unit; 13 - multi-language data conversion unit; 14 - multi-language document generating unit; 15 - multi-language document processing unit. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0032] See also Figure 1 , Figure 1 The flowchart of the method for generating multi-language files in multi-person collaborative project development is shown in FIG. 1. In this embodiment, the method for generating multi-language files in multi-person collaborative project development is applied to a server and includes steps S10, S20, S30, S40, and S50.

[0033] When a developer needs to generate a multilingual file, the developer may provide the document ID of the shared multilingual document corresponding to the current project (including the online access address of the shared multilingual document) and the developer login status (including the developer identification, such as the developer's user name). Based on this, the server may execute step S10.

[0034] Step S10: Obtain the document ID of the shared multilingual document corresponding to the current project and the developer ID of the current developer, wherein the shared multilingual document refers to a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages.

[0035] In this embodiment, the server can obtain the document ID of the shared multilingual document corresponding to the current project (for example, with a project ID) and the developer identifier of the current developer, where the shared multilingual document refers to an online document shared by multiple people containing multiple language versions created during the project development process to meet the needs of different regions and languages.

[0036] Shared multilingual documents can contain commonly used multilingual content (i.e. language text content, commonly used multilingual content, which can generally be used across projects, that is, content that is generally used by each project, such as theme name, commonly used option name, network connection failure, please refresh, return, etc.) and the common parts in the current project (the common parts are generally used by the current project, such as activity name, module name, activity rules, etc., such as Figure 2 As shown (since the total content is large and in many languages, only a small part is taken for display, otherwise the text is too small to be clear). In addition, in some other possible implementations, the commonly used multilingual content and the public part in the current project can also be stored in two online documents, and the server obtains the corresponding multilingual content based on the corresponding document ID, without limitation.

[0037] For the content that each developer is responsible for in the current project, there are usually some less commonly used multilingual content (i.e. language text content), which needs to be supplemented by the developer himself (selected from previous historical records, searched and added from the total language library, or added after translation), and added as multilingual data to the project multilingual library (the project multilingual library here corresponds to the current project, and different projects have different project multilingual libraries, which can be distinguished by project ID), such as Figure 3 and Figure 4 shown.

[0038] The server may execute step S20 and step S30, and step S20 and step S30 may be executed simultaneously, regardless of order.

[0039] Step S20: Based on the document ID, convert the shared multilingual document into a first file in JSON format.

[0040] In this embodiment, the server can access the shared multilingual document corresponding to the current project based on the document ID, and then extract the language text content of the shared multilingual document through the cloud function deployed in the server, parse it, convert it into a two-dimensional array, and store it as the first file in JSON format. In order to improve the conversion efficiency, the shared multilingual document is designed in the form of a two-dimensional table. The server can directly extract the corresponding content and parse it into a two-dimensional array, and store it as the first file in JSON format. The content of the first file is as follows: Figure 5 shown.

[0041] Step S30: Based on the developer identifier, the multi-language data supplemented by the current developer in the project multi-language library is obtained and converted into a second file in JSON format.

[0042] In this embodiment, the server can obtain the language text content in the multilingual data added by the current developer in the project multilingual library through PHP based on the developer ID, parse it, convert it into a two-dimensional array, and store it as a second file in JSON format. In order to improve conversion efficiency, the multilingual data also exists in the form of a two-dimensional table.

[0043] After obtaining the first file and the second file in JSON format, the server may execute step S40.

[0044] Step S40: concatenate the first file and the second file to obtain a multi-language file corresponding to the developer identifier.

[0045] In this embodiment, the server can concatenate the first file and the second file (for example, add the content of the second file after the content of the first file. Since they are in the same format, they can be directly aligned and added) to obtain a multilingual file corresponding to the developer identifier. The file content is as follows: Figure 6 shown.

[0046] At this time, the multi-language file has not been processed by language rules (that is, it is equivalent to overall replacement, without considering display modes, such as reverse display, real-time variable display, etc.). For some languages, there are different display characteristics (for example, Middle Eastern languages ​​are displayed from right to left), so language processing can be further performed, and based on this, the server can run step S50.

[0047] Step S50: obtaining a multi-language rule, and based on the multi-language rule, processing the multi-language file corresponding to the developer identifier to obtain a project multi-language file corresponding to the developer identifier in the current project.

[0048] In this embodiment, the server may obtain a language rule corresponding to each language identifier, and the language rule may be based on the developer's habits.

[0049] For each language file in the multi-language files corresponding to the developer identifier: the server can process the corresponding language file based on the language rule corresponding to the language identifier (specifically, each language text in the corresponding language file can be processed according to each rule in the language rule corresponding to the language identifier, and the processing includes splitting, reversing, and variable replacement), and obtain the project language file of each language to constitute the project multi-language file corresponding to the developer identifier in the current project.

[0050] For example, take the language rules formulated by a developer as an example:

[0051] Find %s and %d and record their serial numbers: (can also be {%s:k}{%d:k}, etc.)

[0052] If "Yuwan %s welcomes %s you" exists, it will be converted to "Yuwan {k1} welcomes {k2} you"

[0053] For the additional parameters: %s1 and %d2, etc.: the numbers specify the sequence number, so the reverse order

[0054] If "Yuwan %s1 welcomes %s2 you" exists, it will be converted to "Yuwan {k1} welcomes {k2} you" (this situation is similar to the first one);

[0055] If "Yuwan%d2 welcomes%s1 you" exists, it will be converted to "Yuwan{k2} welcomes{k1} you"

[0056] Note: This can be rewritten according to subsequent changes, and this is just an example. In addition, it is not allowed to have a situation where one %d and %s has a number and the other does not, such as Yuwan %s welcomes %s1 you, because this will not allow the serial number to be assigned normally.

[0057] It should be noted that this is only the language processing rules designed by the developer for the content of the current project that he is responsible for, so that when the front-end display of the language with a special display mode is performed, corresponding processing can be performed, such as splitting, reversing, variable replacement (such as paying X gold coins, gaining X experience points), etc. The schematic diagram of the language processing rules is as follows Figure 7 shown.

[0058] After being processed by the language processing rules, the multi-language file corresponding to the developer ID in the current project can be obtained. According to the multi-language operation requirements of each developer, the time consumption of the entire process can be basically controlled within 1 second. Figure 8 As shown, the generated project multi-language files are as follows Fig. 9 The generated multi-language project files can be returned by the server to the developer's terminal, and then packaged and uploaded to the corresponding server (such as a test server) through the terminal.

[0059] Of course, the server can also integrate the latest project multi-language files of all current developers after any developer updates, and obtain the entire project multi-language file corresponding to the current project, which is not limited here.

[0060] When it is necessary to update multilingual content, for shared multilingual documents, you can directly update them in the shared multilingual document, and complete the process with one click of the multilingual operation, without any additional work; for the parts added by the developer, you can add them to the project multilingual library, and complete the process with one click of the multilingual operation. This method has extremely low maintenance costs and is very convenient.

[0061] Of course, in order to enable the generated multi-language project files to be used when displayed on the front end, it is necessary to add a key name for each language text content (different developers do not need to coordinate and unify how to give key names, which is very convenient). AI can be used to generate a unique key name based on the basic language part (such as simplified Chinese) in each language text content, where the basic language is any specified language. Alternatively, it is also possible to obtain a unique key name corresponding to each language text content entered by the current developer. That is, the key name can be automatically generated by AI (such as Figure 2 As shown, the table header "key" is the key name, and the column contains the key name), or it can be specified by the developer himself.

[0062] Accordingly, after obtaining the project multilingual file corresponding to the developer ID in the current project, when displaying on the front end, based on the key name corresponding to each language text content in the project multilingual file, the i18n plug-in can be used to automatically replace the project file with the corresponding language to display the content of the corresponding language on the front end.

[0063] like Fig.10 As shown, based on the same inventive concept, the embodiment of the present application also provides a device 10 for generating multi-language files in multi-person collaborative project development, which is applied to a server and includes:

[0064] The data acquisition unit 11 is used to obtain the document ID of the shared multilingual document corresponding to the current project and the developer identification of the current developer, wherein the shared multilingual document refers to a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages.

[0065] The multi-language document conversion unit 12 is used to convert the shared multi-language document into a first file in JSON format based on the document ID.

[0066] The multi-language data conversion unit 13 is used to obtain the multi-language data supplemented by the current developer in the project multi-language library based on the developer identifier, and convert it into a second file in JSON format.

[0067] The multi-language file generating unit 14 is used to concatenate the first file and the second file to obtain a multi-language file corresponding to the developer identifier.

[0068] The multi-language file processing unit 15 is used to obtain a multi-language rule, and based on the multi-language rule, process the multi-language file corresponding to the developer identifier to obtain a project multi-language file corresponding to the developer identifier in the current project.

[0069] In this embodiment, the multilingual document conversion unit 12 is specifically used to: access the shared multilingual document corresponding to the current project based on the document ID; extract and parse the language text content of the shared multilingual document through the cloud function deployed in the server, convert it into a two-dimensional array, and store it as a first file in JSON format.

[0070] In this embodiment, the multilingual data conversion unit 13 is specifically used to: based on the developer identifier, obtain the language text content in the multilingual data supplemented by the current developer in the project multilingual library through PHP and parse it, convert it into a two-dimensional array, and store it as a second file in JSON format.

[0071] In this embodiment, the multi-language file processing unit 15 is specifically used to: obtain the language rules corresponding to each language identifier; for each language file in the multi-language files corresponding to the developer identifier: based on the language rules corresponding to the language identifier, process the corresponding language file to obtain the project language file of each language, and constitute the project multi-language file corresponding to the developer identifier in the current project.

[0072] In this embodiment, the multi-language file processing unit 15 is specifically used to process each language text in the corresponding language file according to each rule in the language rule corresponding to the language identifier, and the processing includes splitting, reversing, and variable replacement.

[0073] In this embodiment, each language text content in the shared multilingual document and each language text content in the multilingual data in the project multilingual library includes a key name. The multilingual file generation device 10 also includes a key name replacement unit, which is used to automatically replace the project file with the corresponding language based on the key name corresponding to each language text content in the project multilingual file after the multilingual file processing unit 15 obtains the project multilingual file corresponding to the developer identifier in the current project, using the i18n plug-in to display the content of the corresponding language on the front end.

[0074] The present embodiment provides a storage medium, which is arranged in a server and includes a stored program. When the program is run, the server where the storage medium is located is controlled to execute the method for generating multi-language files in multi-person collaborative project development of the present embodiment.

[0075] In addition, an embodiment of the present application further provides a server, including a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, and when the program instructions are loaded and executed by the processor, the steps of the method for generating multi-language files in multi-person collaborative project development in this embodiment are implemented.

[0076] In summary, the embodiments of the present application provide a method, device and medium for generating multilingual files in multi-person collaborative project development, which obtains the document ID of a shared multilingual document corresponding to the current project (a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages) and the developer ID of the current developer through a server; based on the document ID, the shared multilingual document is converted into a first file in JSON format; based on the developer ID, the multilingual data supplemented by the current developer in the project multilingual library is obtained and converted into a second file in JSON format; the first file and the second file are concatenated to obtain a multilingual file corresponding to the developer ID; multilingual rules are obtained, and based on the multilingual rules, the multilingual file corresponding to the developer ID is processed to obtain a project multilingual file corresponding to the developer ID in the current project. This solution can realize the generation of multilingual files in multi-person collaborative project development, and by using online documents as the common part that carries multiple languages, multilingual content can be quickly obtained, efficient multilingual file conversion can be achieved, and the generation efficiency of multilingual files can be effectively improved. The part supplemented by the developer (usually a small amount, compared with the traditional solution where all multi-languages ​​are queried through the language library, the multi-language supplementary content used by the developer in the current project is extremely small) can be quickly converted, and can be processed synchronously with the shared multi-language documents to improve conversion efficiency. After the overall solution is running, the time required to generate multi-language files can be controlled within 1 second. This solution can be more suitable for actual development scenarios (usually requiring multiple people to collaborate and develop together), realize multi-language project development with multiple people, and does not require unified naming habits among developers, which is very friendly to developers.

[0077] The content of the shared multilingual document is extracted and parsed through the cloud function deployed in the server, converted into a two-dimensional array, and the language text content of the shared multilingual document is extracted and parsed through the cloud function deployed in the server, and stored as a first file in JSON format. At the same time, based on the developer ID, the server can obtain the language text content in the multilingual data supplemented by the current developer in the project multilingual library through PHP and parse it, convert it into a two-dimensional array, and store it as a second file in JSON format. By splicing the first file and the second file, you can get the multilingual file corresponding to the developer ID. This greatly shortens the time spent on generating multilingual files, realizes the rapid conversion of multilingual files, and improves the efficiency of generating multilingual files for the project.

[0078] By obtaining the language rules corresponding to each language identifier, for each language file in the multilingual file corresponding to the developer identifier: according to each rule in the language rules corresponding to the language identifier, each language text in the corresponding language file is processed, including splitting, reversing, and variable replacement (different languages ​​have different characteristics and different rules are configured. For example, Middle Eastern languages ​​are displayed from right to left and need to be split and reversed, while for displaying real-time data, variable replacement can be used to complete it). Based on this, the project language file of each language can be obtained to constitute the project multilingual file corresponding to the developer identifier in the current project. Each language text content in the shared multilingual document and each language text content in the multilingual data of the project multilingual library contain a key name. After obtaining the project multilingual file corresponding to the developer identifier in the current project, the i18n plug-in can be used to automatically replace the project file with the corresponding language based on the key name corresponding to each language text content in the project multilingual file to display the content of the corresponding language on the front end, thereby realizing the multilingualization of the project. Such a solution is simple and efficient, developer-friendly, and can be applied to multi-person collaborative project development scenarios. The key name can be generated by using AI to generate a unique key name based on the basic language part of each language text content, or by the developer entering a unique key name corresponding to each language text content. The naming habits of different developers do not interfere with each other.

[0079] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0080] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for generating multi-language files in multi-person collaborative project development, characterized in that: Applicable to servers, including: Get the document ID of the shared multilingual document corresponding to the current project and the developer ID of the current developer. The shared multilingual document refers to an online document shared by multiple people in multiple languages ​​that is created during the project development process to meet the needs of different regions and languages. Based on the document ID, convert the shared multilingual document into a first file in JSON format; Based on the developer ID, obtain the multi-language data added by the current developer in the project multi-language library and convert it into a second file in JSON format; Concatenate the first file and the second file to obtain a multi-language file corresponding to the developer identifier; A multi-language rule is obtained, and based on the multi-language rule, the multi-language file corresponding to the developer identifier is processed to obtain a project multi-language file corresponding to the developer identifier in the current project.

2. The method for generating multi-language files in multi-person collaborative project development according to claim 1, characterized in that: Based on the document ID, the shared multilingual document is converted into a first file in JSON format, including: Based on the document ID, access the shared multilingual document corresponding to the current project; The language text content of the shared multilingual document is extracted and parsed through the cloud function deployed in the server, converted into a two-dimensional array, and stored as a first file in JSON format.

3. The method for generating multi-language files in multi-person collaborative project development according to claim 1, characterized in that: Based on the developer ID, obtain the multi-language data added by the current developer in the project multi-language library and convert it into a second file in JSON format, including: Based on the developer ID, the language text content in the multilingual data supplemented by the current developer in the project multilingual library is obtained and parsed through PHP, converted into a two-dimensional array, and stored in a second file in JSON format.

4. The method for generating multi-language files in multi-person collaborative project development according to claim 1, characterized in that: Each language corresponds to a language identifier. The multi-language rules are obtained, and based on the multi-language rules, the multi-language files corresponding to the developer identifier are processed to obtain the project multi-language files corresponding to the developer identifier in the current project, including: Get the language rules corresponding to each language identifier; For each language file in the multi-language files corresponding to the developer ID: based on the language rule corresponding to the language ID, the corresponding language file is processed to obtain a project language file of each language, which constitutes the project multi-language file corresponding to the developer ID in the current project.

5. The method for generating multi-language files in multi-person collaborative project development according to claim 4, characterized in that: Based on the language rules corresponding to the language identifier, the corresponding language file is processed, including: According to each rule in the language rule corresponding to the language identifier, each language text in the corresponding language file is processed, and the processing includes splitting, reversing, and variable replacement.

6. The method for generating multi-language files in multi-person collaborative project development according to claim 1, characterized in that: Each language text content in the shared multilingual document and each language text content in the multilingual data in the project multilingual library includes a key name. After obtaining the project multilingual file corresponding to the developer identifier in the current project, the method further includes: Based on the key name corresponding to each language text content in the project's multilingual files, the i18n plug-in is used to automatically replace the project files with the corresponding language to display the content of the corresponding language on the front end.

7. The method for generating multi-language files in multi-person collaborative project development according to claim 6, characterized in that: The key name corresponding to each language text content is generated as follows: Using AI to generate a unique key name based on the base language part of each language text content, where the base language is any specified language; Alternatively, obtain the unique key name corresponding to each language text content entered by the current developer.

8. A device for generating multi-language files in multi-person collaborative project development, characterized in that: Applicable to servers, including: A data acquisition unit, used to acquire a document ID of a shared multilingual document corresponding to the current project and a developer ID of the current developer, wherein the shared multilingual document refers to a multi-person shared online document containing multiple language versions created during the project development process to meet the needs of different regions and languages; A multilingual document conversion unit, configured to convert the shared multilingual document into a first file in JSON format based on the document ID; A multi-language data conversion unit, used to obtain the multi-language data supplemented by the current developer in the project multi-language library based on the developer identifier, and convert it into a second file in JSON format; A multi-language file generating unit, used for concatenating the first file and the second file to obtain a multi-language file corresponding to the developer identifier; The multi-language file processing unit is used to obtain the multi-language rules, and based on the multi-language rules, process the multi-language files corresponding to the developer identifier to obtain the project multi-language files corresponding to the developer identifier in the current project.

9. A storage medium, characterized in that: The storage medium is set in the server, including a stored program, wherein when the program is running, the server where the storage medium is located is controlled to execute the method for generating multi-language files in multi-person collaborative project development as described in any one of claims 1 to 7.

10. A server comprising a memory and a processor, wherein the memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions, characterized in that: When the program instructions are loaded and executed by the processor, the steps of the method for generating multi-language files in multi-person collaborative project development described in any one of claims 1 to 7 are implemented.