Development method and device of project, storage medium and processor

By acquiring and deleting redundant internationalized resource strings and modifying the reference paths of project files, the problems of inefficiency and high cost caused by redundant strings in project development are solved, thereby improving project development efficiency and managing resource strings efficiently.

CN115981607BActive Publication Date: 2026-07-21HILLSTONE NETWORKS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HILLSTONE NETWORKS CO LTD
Filing Date
2022-12-27
Publication Date
2026-07-21

Smart Images

  • Figure CN115981607B_ABST
    Figure CN115981607B_ABST
Patent Text Reader

Abstract

The application discloses a project development method and device, a storage medium and a processor. The method comprises the following steps: acquiring a first file and a target file, wherein the first file is at least one file used for developing a target project, the target project is a project to be developed, the first file comprises at least a first string, the first string is at least one translated string, and the target file is used for storing a same target string in the first string; deleting the target string from the first file to obtain a second file; determining a third file in the target project, the third file referring to the first file; modifying a reference path of the third file to enable the third file to refer to the target file and the second file; and developing the target project based on the third file. Through the application, the problem that the string redundancy in the project to be developed in the related art leads to poor development effect of the project is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and more specifically, to a method and apparatus for developing a project, a storage medium, and a processor. Background Technology

[0002] In today's booming internet era, as more and more products need to be sold in overseas markets, there are also certain requirements for the internationalization capabilities of products in the web field.

[0003] For more specialized software products, dedicated English translators typically check and calibrate internationalization documents to ensure the syntax is more compatible with overseas usage habits. However, in a large project, the number of internationalization resource strings can reach thousands or even tens of thousands. After completing a version, the development process for refining internationalization usually involves:

[0004] (1) Multiple developers compiled their own newly added internationalization resource files;

[0005] (2) The manager shall uniformly distribute the materials to full-time English translators for checking and correcting English grammar or vocabulary;

[0006] (3) After the full-time English translator has completed the revisions, the translations are handed over to the administrator, who then distributes them to the developers for internationalization modifications.

[0007] Furthermore, with each product iteration, the number of internationalized resource strings increases and becomes more difficult to manage, making replacement a headache. Also, due to multi-person development, the person in charge of one module may not be familiar with other modules, resulting in many duplicate internationalized resource strings across different project modules, increasing the project's size.

[0008] In related technologies, batch string replacement methods only support one-time export and one-time replacement of internationalized resource strings in a project. When the product is updated and iterated, it cannot identify incremental internationalized resource strings. In addition, related technologies only handle the string IDs (Identity Documents) that need to be internationalized in the project, without identifying the actual content corresponding to the string IDs. When different IDs correspond to the same internationalized content, the string IDs become redundant, resulting in problems such as low project development efficiency, high cost, poor maintainability, and large file size.

[0009] There is currently no effective solution to the problem of redundant strings in projects under development in related technologies, which leads to poor project development results. Summary of the Invention

[0010] The main objective of this application is to provide a project development method, apparatus, storage medium, and processor to solve the problem that redundant strings exist in the projects to be developed in related technologies, resulting in poor project development performance.

[0011] To achieve the above objectives, according to one aspect of this application, a method for developing a project is provided. The method includes: obtaining a first file and a target file, wherein the first file is at least one file used for developing a target project, the target project is a project to be developed, the first file includes at least one first string, the first string being at least one translated string, and the target file is used to store target strings identical to the first string; deleting the target string from the first file to obtain a second file; determining a third file in the target project that references the first file; modifying the reference path of the third file to make the third file reference both the target file and the second file, and developing the target project based on the third file.

[0012] Further, obtaining the first file and the target file includes: obtaining the first string and the original file in the target project, wherein the first string is a string obtained by translating the second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; obtaining the first file based on the first string and the original file in the target project; identifying the same strings in the first file; and summarizing the same strings in the first file to obtain the target file.

[0013] Further, obtaining the first string includes: obtaining a fourth file used in developing the first project; obtaining a fifth file used in developing the target project; comparing the fourth file and the fifth file to obtain the second string; and translating the second string to obtain the first string.

[0014] Further, obtaining the first file based on the first string and the original file in the target project includes: obtaining the ID information of the first string; based on the ID information of the first string, traversing the original files in the target project to determine the third string in the original file corresponding to the first string; and replacing the third string in the original file with the first string to obtain the first file.

[0015] Furthermore, after modifying the reference path of the third file so that the third file references the target file and the second file, the method further includes: obtaining a first test case file for testing the third file; executing the first test case file to verify the correctness of the third file and obtaining a first verification result; if the first verification result indicates that the third file is correct, then developing the target project based on the third file; if the first verification result indicates that the third file is incorrect, then not developing the target project.

[0016] Further, executing the first test case file to verify the correctness of the third file and obtaining a first verification result includes: executing the first test case file and determining whether the target string exists in the third file; if the target string exists in the third file, the third file is correct; if the target string does not exist in the third file, the third file is incorrect.

[0017] Further, after executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result, the method further includes: determining whether a sixth file containing the target string exists in the files used to develop the target project; if a sixth file containing the target string exists in the files used to develop the target project, deleting the target string from the sixth file to obtain a seventh file; determining an eighth file in the target project that references the sixth file, and modifying the reference path of the eighth file so that the eighth file references the target file and the seventh file; obtaining a second test case file for testing the eighth file; executing the second test case file, verifying the correctness of the eighth file, and obtaining a second verification result; if the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, then developing the target project based on the third file and the eighth file; if the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, then not developing the target project.

[0018] To achieve the above objectives, according to another aspect of this application, a project development apparatus is provided. The apparatus includes: a first acquisition module for acquiring a first file and a target file, wherein the first file is at least one file for developing a target project, the target project is a project to be developed, the first file includes at least one first string, the first string being at least one translated string, and the target file is used to store the same target string in the first string; a first deletion module for deleting the target string from the first file to obtain a second file; a first determination module for determining a third file in the target project that references the first file; and a first processing module for modifying the reference path of the third file to make the third file reference the target file and the second file, and developing the target project based on the third file.

[0019] Further, the first acquisition module includes: a first acquisition unit, configured to acquire the first string and the original file in the target project, wherein the first string is a string obtained by translating the second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; a first determination unit, configured to obtain the first file based on the first string and the original file in the target project; a second determination unit, configured to determine the same strings in the first file; and a first summarization unit, configured to summarize the same strings in the first file to obtain the target file.

[0020] Further, the first acquisition unit includes: a first acquisition submodule, used to acquire a fourth file used in developing the first project; a second acquisition submodule, used to acquire a fifth file used in developing the target project; a first comparison submodule, used to compare the fourth file and the fifth file to obtain the second string; and a first translation submodule, used to translate the second string to obtain the first string.

[0021] Further, the first determining unit includes: a third obtaining submodule, used to obtain the ID information of the first string; a first traversal submodule, used to traverse the original files in the target project based on the ID information of the first string, and determine the third string in the original file corresponding to the first string; and a first replacement submodule, used to replace the third string in the original file with the first string to obtain the first file.

[0022] Furthermore, the apparatus further includes: a second acquisition module, configured to acquire a first test case file for testing the third file after modifying the reference path of the third file so that the third file references the target file and the second file; a first verification module, configured to execute the first test case file to verify the correctness of the third file and obtain a first verification result; a second processing module, configured to develop the target project based on the third file if the first verification result indicates that the third file is correct; and a third processing module, configured not to develop the target project if the first verification result indicates that the third file is incorrect.

[0023] Further, the first verification module includes: a first judgment unit, configured to execute the first test case file and determine whether the target string exists in the third file; a third determination unit, configured to indicate that the third file is correct if the target string exists in the third file; and a fourth determination unit, configured to indicate that the third file is incorrect if the target string does not exist in the third file.

[0024] Furthermore, the apparatus further includes: a first judgment module, configured to, after executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result, determine whether a sixth file containing the target string exists in the files used to develop the target project; a fourth processing module, configured to, if a sixth file containing the target string exists in the files used to develop the target project, delete the target string from the sixth file to obtain a seventh file; a second determination module, configured to, determine an eighth file in the target project that references the sixth file, and modify the reference path of the eighth file so that the eighth file references the target file and the seventh file; a third acquisition module, configured to, acquire a second test case file for testing the eighth file; a second verification module, configured to, execute the second test case file, verify the correctness of the eighth file, and obtain a second verification result; a fifth processing module, configured to, if the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, develop the target project based on the third file and the eighth file; and a sixth processing module, configured to, if the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, not develop the target project.

[0025] To achieve the above objectives, according to another aspect of this application, a computer-readable storage medium is provided, the storage medium storing a program, wherein the program executes the development method of the project described in any of the above claims.

[0026] To achieve the above objectives, according to another aspect of this application, a processor is provided for running a program, wherein the program, when running, executes the development method of the project described in any of the above-described embodiments.

[0027] This application employs the following steps: obtaining a first file and a target file, wherein the first file is at least one file used for developing a target project, the target project is the project to be developed, the first file includes at least one first string, which is at least one translated string, and the target file is used to store the same target strings in the first string; deleting the target strings from the first file to obtain a second file; determining a third file in the target project that references the first file; modifying the reference path of the third file so that the third file references the target file and the second file, and developing the target project based on the third file, thus solving the problem in related technologies where redundant strings exist in the project to be developed, leading to poor project development results. By deleting the same target strings from the first file to obtain the second file, and by modifying the reference path of the third file in the target project that references the first file so that the third file references the target file and the second file, and then developing the target project based on the third file, redundant strings are removed from the project to be developed, thereby improving the project development effect. Attached Figure Description

[0028] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0029] Figure 1 This is a flowchart of a project development method provided according to an embodiment of this application;

[0030] Figure 2 This is a flowchart of an optional project development method provided according to an embodiment of this application;

[0031] Figure 3 This is a flowchart of batch extraction in an embodiment of this application;

[0032] Figure 4 This is a flowchart of batch import in the embodiments of this application;

[0033] Figure 5 This is a schematic diagram of the batch extraction part in the embodiments of this application;

[0034] Figure 6 This is a schematic diagram of the batch import section in an embodiment of this application;

[0035] Figure 7 This is a schematic diagram of the original document in the embodiments of this application;

[0036] Figure 8 This is a schematic diagram illustrating the batch extraction process in an embodiment of this application;

[0037] Figure 9 This is a translated schematic diagram from an embodiment of this application;

[0038] Figure 10 This is a schematic diagram illustrating the reference to public documents in the embodiments of this application;

[0039] Figure 11 This is a schematic diagram of a development apparatus for a project provided according to an embodiment of this application. Detailed Implementation

[0040] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0041] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0042] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0043] Example 1

[0044] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of the project development method provided according to the embodiments of this application, such as... Figure 1 As shown, the method includes the following steps:

[0045] Step S101: Obtain a first file and a target file, wherein the first file is at least one file used to develop the target project, the target project is the project to be developed, the first file includes at least a first string, the first string is at least one translated string, and the target file is used to store the same target string in the first string.

[0046] For example, after translating the strings in an internationalization file, and replacing the strings in the internationalization file with the translated strings, we obtain a translated and replaced internationalization file (the first file mentioned above) and a common file (the target file mentioned above) used to store the same strings in the replaced file. Furthermore, when developing a project using a project file, the project file can reference the aforementioned internationalization file to develop the project.

[0047] Step S102: Delete the target string from the first file to obtain the second file.

[0048] For example, removing the same string from an internationalized file after translation and string replacement.

[0049] Step S103: Determine the third file in the target project that references the first file.

[0050] For example, when developing a project, determine the project file (the third file mentioned above) that references the translated and replaced internationalized files.

[0051] Step S104: Modify the reference path of the third file so that the third file references the target file and the second file, and develop the target project based on the third file.

[0052] For example, modify the reference path of the project file (the third file mentioned above) that references the translated and replaced internationalized file, so that the third file references both the common file containing the same string and the internationalized file after deleting the same string. Then, develop the project based on the project file with the modified reference path.

[0053] Through the above steps S101 to S104, the second file is obtained by deleting the same target string from the first file, and the reference path of the third file in the target project that references the first file is modified so that the third file references the target file and the second file. The target project is then developed based on the third file, thereby removing redundant strings in the project to be developed and improving the development effect of the project.

[0054] To obtain the first file quickly and accurately, the project development method provided in this application embodiment can also obtain the first file through the following steps: obtaining the ID information of the first string; based on the ID information of the first string, traversing the original files in the target project to determine the third string in the original file corresponding to the first string; replacing the third string in the original file with the first string to obtain the first file.

[0055] For example, upon receiving a translated Excel file, the project files are iterated through once, and the content of the resource string in the project is replaced with the correct content from the Excel file based on the resource string ID.

[0056] Using the above method, the file containing the replaced string can be obtained quickly and accurately.

[0057] To quickly and accurately obtain the first string, the project development method provided in this application embodiment can also obtain the first string through the following steps: obtaining the fourth file used to develop the first project; obtaining the fifth file used to develop the target project; comparing the fourth file and the fifth file to obtain the second string; and translating the second string to obtain the first string.

[0058] For example, the program requests the code from the SVN repository (an open-source version control system), traverses the current directory, filters out all internationalized files, and summarizes them; the program requests the code from the local project, traverses the project directory, filters out all internationalized files, and summarizes them; it compares the internationalized resource data in SVN and the local repository, collects the internationalized resource data added in the current project version; and writes the collected new data to a local xls file.

[0059] The above method can quickly and accurately extract newly added strings.

[0060] To obtain the target file quickly and accurately, the project development method provided in this application embodiment can also obtain the target file through the following steps: obtaining a first string and the original file in the target project, wherein the first string is a string obtained by translating a second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; obtaining a first file based on the first string and the original file in the target project; identifying the same strings in the first file; and summarizing the same strings in the first file to obtain the target file.

[0061] For example, upon receiving a translated Excel file, the project file is traversed once, and the content of the resource string in the project is replaced with the correct content in the Excel file based on the resource string ID. During the replacement process, all replaced resource string data is recorded. After the replacement is completed, a copy of the duplicate resource data is retrieved. The duplicate resource data is then written into a common resource file (the target file mentioned above).

[0062] Using the above method, we can quickly and accurately obtain the file containing the replaced string and the common file containing the same string.

[0063] To develop projects quickly and accurately, the project development method provided in this application embodiment can also be implemented through the following steps: obtaining a first test case file for testing a third file; executing the first test case file to verify the correctness of the third file and obtaining a first verification result; if the first verification result indicates that the third file is correct, then developing the target project based on the third file; if the first verification result indicates that the third file is incorrect, then not developing the target project.

[0064] For example, in other resource files within the project, we delete resource data that appears in common resource files. Simultaneously, addressing the issue of references to deleted resource data, we change the references in the project files to references to common resource files. We write each project file modification into a modification file list. Based on the modification project file list, we generate multiple test case files sequentially. These test case files test whether the resource reference strings in each project file are correct and whether the content of the resource strings is correct. After completing the test case files, we execute them sequentially to ensure the correctness of the internationalization modifications. If the verification is correct, it means the replacement is correct, and subsequent development in the project will use this file. If the verification fails, we temporarily suspend project development and investigate the cause. Once the cause is found, project development will resume.

[0065] The above methods can improve the accuracy of documents.

[0066] To quickly and accurately verify the correctness of the third file, the development method of the project provided in this application embodiment can also verify the correctness of the third file through the following steps: execute the first test case file and determine whether the target string exists in the third file; if the target string exists in the third file, it means that the third file is correct; if the target string does not exist in the third file, it means that the third file is incorrect.

[0067] For example, based on the list of modified project files, multiple test case files are generated sequentially. The test case files test whether the resource strings referenced by the project files are correct and whether the content of the resource strings is correct. After the test case files are completed, they are executed sequentially to check whether the same string exists in the file as stored in the common file. If it exists, it means that the file is correct; if it does not exist, it means that the file is incorrect.

[0068] The above method can quickly and accurately verify the accuracy of documents, thereby ensuring the correctness of internationalization modifications.

[0069] To quickly and accurately develop the target project, the project development method provided in this application embodiment can also be implemented through the following steps: determining whether a sixth file containing the target string exists in the files used to develop the target project; if a sixth file containing the target string exists in the files used to develop the target project, deleting the target string from the sixth file to obtain a seventh file; determining an eighth file in the target project that references the sixth file, and modifying the reference path of the eighth file so that the eighth file references both the target file and the seventh file; obtaining a second test case file for testing the eighth file; executing the second test case file to verify the correctness of the eighth file and obtaining a second verification result; if the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, then the target project is developed based on the third file and the eighth file; if the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, then the target project is not developed.

[0070] For example, determine if there are other internationalization files containing the target string in other internationalization files used for project development. If so, delete the target string from the internationalization file and modify the reference path of the project file that references the internationalization file so that it references both the common file and the internationalization file after deleting the target string. Then continue to verify the correctness of the project file. If all project files after modifying the reference path are correct, they can be used to develop the project. If one or more files in the project file after modifying the reference path are incorrect, the project development will be temporarily suspended, and the cause will be investigated. Once the cause is found, the project development will resume.

[0071] The above solutions can improve project development efficiency.

[0072] For example, once a project version is completed, developers can use this method to extract all newly added internationalization resource strings in the current version, save them to an Excel document, and submit the Excel document to the documentation group. Subsequently, upon receiving a new Excel document from the documentation group, the new Excel document will be written back to the corresponding source file.

[0073] During the write-back process, check if there is any content in the project that is exactly the same as the current resource. If so, extract the resource to a public resource file, modify the corresponding reference in the project to the public resource file, and delete any other redundant resource strings.

[0074] Since modifying project file references updates project files, which may impact project quality, this embodiment adds an accuracy verification method after batch replacement and redundancy removal: First, a complete project edit is performed to ensure the accuracy of the modified project files; second, unit tests are added to guarantee accuracy. A unit test is added for each modified referenced file, and the unit test performs a simulated rendering of that file. After rendering, it is confirmed that the rendered content contains the replaced internationalized language.

[0075] The above solution reduces the tediousness of replacing internationalization files after version development is complete. From the developer's perspective, the internationalization replacement of the entire project can be completed without the involvement of every developer, greatly improving development efficiency.

[0076] From a long-term project development perspective, this solution not only replaces internationalization resource strings in batches but also removes redundant resource strings and extracts common ones, reducing the project size. For subsequent developers, if they encounter the same internationalization resource strings, they can also use the extracted common resource files, improving development efficiency.

[0077] In terms of project quality, this solution adds methods to verify accuracy after batch replacement to ensure that the project quality is not affected and to avoid vulnerabilities in some pages. With the support of unit testing, the quality of batch operation project files is guaranteed, and the risk of vulnerabilities caused by modifying files is reduced.

[0078] For example, Figure 2 This is a flowchart of an optional project development method provided according to an embodiment of this application, such as... Figure 2 As shown, the optional project development method is mainly divided into two parts: batch extraction and batch import. The batch extraction part is further divided into two sections: adding new data and exporting data. The batch import part is divided into two sections: removing redundancy and verifying accuracy.

[0079] For example, Figure 3 This is a flowchart of batch extraction in an embodiment of this application, such as... Figure 3 As shown, the batch extraction section includes the following two parts:

[0080] (1) "New Extraction Section": Traverse each folder of the project, find the corresponding internationalization file, compare it with the internationalization file of the previous version, and mark it as a new resource string if the internationalization resource string does not exist in the previous version.

[0081] (2) "Data Export Section": After all local project folders have been searched, generate a complete Excel file from all internationalized resource strings marked as new.

[0082] For example, Figure 4 This is a flowchart of batch import in an embodiment of this application, such as... Figure 4 As shown, the "Batch Import Section" involves finding the ID of the resource string in the project file corresponding to the resource string in the translated Excel file and replacing it. During the replacement process, two other parts intervene:

[0083] 1. "Remove Redundancy": When duplicate content is found corresponding to a resource ID, record the duplicate resource ID and content. Locate all project files that reference that resource ID and record them as well. After replacement, based on the recorded files, extract the duplicate resource strings to a common file, delete the resource string definitions in other individual files, and modify the project files that reference the resource strings.

[0084] 2. "Accuracy Verification Section": When entering this section, the resource strings in the project have already been translated. Our task is to ensure the correctness of the references used in the current project. The process is as follows:

[0085] (1) Based on the recorded duplicate files, we find the project files that reference the content of the duplicate files in turn. The test file content contains the referenced file that simulates rendering the modified file. We determine whether the content contains the modified resource string. If it does, we pass; otherwise, we fail.

[0086] (2) Compile the project completely. If the compilation is successful, it means that the project can run normally.

[0087] (3) Execute the test files generated in the above steps. If each one passes, it means that the replacement is correct.

[0088] For example, Figure 5 This is a schematic diagram of the batch extraction part in an embodiment of this application, such as... Figure 5 As shown, it includes the following steps:

[0089] (1) The program requests the code from the SVN repository, traverses the current directory, filters out all internationalized files, and summarizes them;

[0090] (2) The program requests the code of the local project, traverses the project directory, filters out all internationalization files, and summarizes them;

[0091] (3) Compare the internationalization resource data in SVN and the local data, and collect the internationalization resource data added in the current project version;

[0092] (4) Write the collected new data into a local xls file.

[0093] For example, Figure 6 This is a schematic diagram of the batch import section in an embodiment of this application, as shown below. Figure 6 As shown, it includes the following steps:

[0094] (1) Upon receiving the translated Excel file, perform a traversal of the project file and replace the content of the resource string in the project with the correct content in the Excel file based on the ID of the resource string;

[0095] (2) During the replacement process, record all replaced resource string data. After the replacement is completed, retrieve a duplicate resource data.

[0096] (3) Write duplicate resource data into a common resource file;

[0097] (4) In other resource files in the project, delete the resource data that appears in the public resource file; at the same time, in response to the problem of the deleted resource data being referenced, we will change the reference in the project file to a reference to the public resource file.

[0098] (5) Write the modifications to each project file into a list of modified files;

[0099] (6) Based on the list of modified project files, generate multiple test case files in sequence. The test case files test whether the resource strings referenced by the project files are correct and whether the content of the resource strings is correct.

[0100] (7) After completing the test case files, execute the test case files in sequence to ensure the correctness of the internationalization modifications.

[0101] For example, taking a simple project A as an example, suppose project A contains module 1, module 2, and module 3. Each module has a lot of content, and each module has a corresponding internationalization file, the content of which is as follows: Figure 7 As shown, Figure 7 This is a schematic diagram of the original document in the embodiments of this application.

[0102] As we can see, each internationalized resource string has a unique ID. Each module references the corresponding resource string for display. We export these resource strings using the "batch export module" of this solution. The exported Excel file contains the following: Figure 8 As shown, Figure 8 This is a schematic diagram illustrating the batch extraction process in an embodiment of this application.

[0103] After the document group translates it, they will provide a new Excel file, such as... Figure 9 As shown, Figure 9 This is a translated schematic diagram from an embodiment of this application.

[0104] After obtaining the new files, we used the "batch import modules" function to replace the new internationalization files in the project. However, during the replacement process, when we reached the "remove redundant modules" step, we found that the resource strings for module1_ok, module2_ok, and module3_ok were actually the same. Simply replacing them would result in a lot of redundant internationalization content in the project. Therefore, we extracted these resource strings to a common file, checked if a common-locale file existed (created if not), wrote the internationalization resource string into this file, modified the project file references to point to the common-locale file, and deleted these redundant resource strings from each internationalization file. Similarly, we performed the same operation on module1_cancel, module2_cancel, and module3_cancel. Finally, the locale files in the project looked like this: Figure 10 As shown, Figure 10 This is a schematic diagram of a public document referenced in an embodiment of this application.

[0105] Finally, because the project's references to internationalization files were modified—for example, under module 1, the original reference to module1_ok was automatically changed to a reference to module_ok under common-locale—...

[0106] To ensure the project was error-free, we added an "accuracy verification module," the process of which is as follows:

[0107] (1) Add a unit test file to each module. The content is: first render the current module, add a test method, and determine whether the rendered content contains the internationalized resource string that was just modified. If so, it will pass.

[0108] (2) Run the compilation command for the entire project to check for any errors. Then run all the unit test files we added. If they all pass, it means that the quality of this replacement process can be guaranteed.

[0109] This solution effectively standardized the internationalization documentation for Project A and eliminated redundant resource strings. While Project A is relatively simple and the manual operation may not seem complex, this automated approach will create greater value in more complex projects.

[0110] Therefore, the embodiments of this application can efficiently and conveniently export all newly added internationalized resource strings in the front-end project development, translate them, and then globally replace them in the project. This greatly reduces the development resources required in the project and saves the overall project cost to a certain extent.

[0111] Meanwhile, from the perspective of maintaining internationalized resource strings in the project, this solution can remove redundancy in internationalized resource strings in the project and form a relatively common internationalized resource string file. This makes it easier for developers to quickly locate and use the same internationalized characters when they encounter them, without having to rewrite them in their own modules. This improves development efficiency, enhances the maintainability of internationalized resource strings in the project, and contributes to compressing and reducing the overall size of the project.

[0112] Finally, for all the above operations, an accuracy verification process was added, which improved efficiency while ensuring project quality.

[0113] In summary, the project development method provided in this application, by obtaining a first file and a target file, wherein the first file is at least one file used for developing the target project, the target project is the project to be developed, the first file includes at least a first string, which is at least one translated string, and the target file is used to store the same target strings in the first string; deleting the target strings from the first file to obtain a second file; determining a third file in the target project that references the first file; modifying the reference path of the third file so that the third file references the target file and the second file, and developing the target project based on the third file, solves the problem in related technologies where redundant strings exist in the project to be developed, resulting in poor project development performance. By deleting the same target strings from the first file to obtain the second file, and by modifying the reference path of the third file in the target project that references the first file so that the third file references the target file and the second file, and then developing the target project based on the third file, redundant strings are removed from the project to be developed, thereby improving the project development performance.

[0114] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0115] Example 2

[0116] This application also provides a project development apparatus. It should be noted that the project development apparatus of this application can be used to execute the project development method provided in this application. The project development apparatus provided in this application is described below.

[0117] Figure 11 This is a schematic diagram of a development apparatus for a project according to an embodiment of this application. For example... Figure 11 As shown, the device includes: a first acquisition module 1101, a first deletion module 1102, a first determination module 1103, and a first processing module 1104.

[0118] Specifically, the first acquisition module 1101 is used to acquire a first file and a target file, wherein the first file is at least one file used to develop a target project, the target project is a project to be developed, the first file includes at least a first string, the first string is at least one translated string, and the target file is used to store the same target string in the first string;

[0119] The first deletion module 1102 is used to delete the target string from the first file to obtain the second file;

[0120] The first determining module 1103 is used to determine the third file in the target project that references the first file;

[0121] The first processing module 1104 is used to modify the reference path of the third file so that the third file references the target file and the second file, and to develop the target project based on the third file.

[0122] In summary, the project development apparatus provided in this application embodiment acquires a first file and a target file through a first acquisition module 1101. The first file is at least one file used to develop the target project, and the target project is the project to be developed. The first file includes at least a first string, which is at least one translated string. The target file stores the same target strings in the first string. A first deletion module 1102 deletes the target strings from the first file to obtain a second file. A first determination module 1103 determines a third file in the target project that references the first file. A first processing module 1104 modifies the reference path of the third file so that it references the target file and the second file, and develops the target project based on the third file. This solves the problem in related technologies where redundant strings exist in the project to be developed, leading to poor project development results. By deleting the same target strings from the first file to obtain the second file, and by modifying the reference path of the third file in the target project that references the first file so that it references the target file and the second file, and then developing the target project based on the third file, redundant strings are removed from the project to be developed, thereby improving the project development effect.

[0123] Optionally, in the project development apparatus provided in this application embodiment, the first acquisition module includes: a first acquisition unit, used to acquire a first string and an original file in the target project, wherein the first string is a string obtained by translating a second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; a first determination unit, used to obtain a first file based on the first string and the original file in the target project; a second determination unit, used to determine identical strings in the first file; and a first summarization unit, used to summarize the identical strings in the first file to obtain a target file.

[0124] Optionally, in the project development apparatus provided in the embodiments of this application, the first acquisition unit includes: a first acquisition submodule, used to acquire a fourth file used for developing a first project; a second acquisition submodule, used to acquire a fifth file used for developing a target project; a first comparison submodule, used to compare the fourth file and the fifth file to obtain a second string; and a first translation submodule, used to translate the second string to obtain a first string.

[0125] Optionally, in the project development apparatus provided in the embodiments of this application, the first determining unit includes: a third obtaining submodule, used to obtain the ID information of the first string; a first traversal submodule, used to traverse the original files in the target project based on the ID information of the first string, and determine the third string in the original file corresponding to the first string; and a first replacement submodule, used to replace the third string in the original file with the first string to obtain the first file.

[0126] Optionally, in the project development apparatus provided in the embodiments of this application, the apparatus further includes: a third acquisition module, configured to acquire a first test case file for testing the third file after modifying the reference path of the third file so that the third file references the target file and the second file; a first verification module, configured to execute the first test case file to verify the correctness of the third file and obtain a first verification result; a second processing module, configured to develop the target project based on the third file if the first verification result indicates that the third file is correct; and a third processing module, configured not to develop the target project if the first verification result indicates that the third file is incorrect.

[0127] Optionally, in the development apparatus for the project provided in the embodiments of this application, the first verification module includes: a first judgment unit, used to execute a first test case file and determine whether a target string exists in the third file; a third determination unit, used to indicate that the third file is correct if the target string exists in the third file; and a fourth determination unit, used to indicate that the third file is incorrect if the target string does not exist in the third file.

[0128] Optionally, in the project development apparatus provided in the embodiments of this application, the apparatus further includes: a first judgment module, used to determine whether a sixth file containing a target string exists in the files used to develop the target project after executing a first test case file, verifying the correctness of a third file, and obtaining a first verification result; a fourth processing module, used to delete the target string from the sixth file and obtain a seventh file if a sixth file containing a target string exists in the files used to develop the target project; a second determination module, used to determine an eighth file in the target project that references the sixth file, and to modify the reference path of the eighth file so that the eighth file references the target file and the seventh file; a third acquisition module, used to acquire a second test case file for testing the eighth file; a second verification module, used to execute the second test case file, verify the correctness of the eighth file, and obtain a second verification result; a fifth processing module, used to develop the target project based on the third file and the eighth file if the first verification result indicates that the third file is correct and the second verification result indicates that the eighth file is correct; and a sixth processing module, used to not develop the target project if the first verification result indicates that the third file is incorrect and / or the second verification result indicates that the eighth file is incorrect.

[0129] The development device for the project includes a processor and a memory. The first acquisition module 1101, the first deletion module 1102, the first determination module 1103, and the first processing module 1104 are all stored in the memory as program units. The processor executes the program units stored in the memory to achieve the corresponding functions.

[0130] A processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the development efficiency of a project.

[0131] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0132] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a development method for the project.

[0133] This invention provides a processor for running a program, wherein the program executes the development method of the project during runtime.

[0134] This invention provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: obtaining a first file and a target file, wherein the first file is at least one file used for developing a target project, the target project is a project to be developed, the first file includes at least a first string, the first string being at least one translated string, and the target file is used to store the same target string in the first string; deleting the target string from the first file to obtain a second file; determining a third file in the target project that references the first file; modifying the reference path of the third file so that the third file references the target file and the second file, and developing the target project based on the third file.

[0135] When the processor executes the program, it also performs the following steps: obtaining the first file and the target file includes: obtaining the first string and the original file in the target project, wherein the first string is a string obtained by translating the second string, the second string is a string added to the target project compared to the first project, and the first project is a project of a historical version of the target project; obtaining the first file based on the first string and the original file in the target project; identifying the same strings in the first file; and summarizing the same strings in the first file to obtain the target file.

[0136] When the processor executes the program, it also performs the following steps: obtaining the first string includes: obtaining a fourth file used to develop the first project; obtaining a fifth file used to develop the target project; comparing the fourth file and the fifth file to obtain the second string; and translating the second string to obtain the first string.

[0137] When the processor executes the program, it also performs the following steps: obtaining the first file based on the first string and the original file in the target project includes: obtaining the ID information of the first string; based on the ID information of the first string, traversing the original files in the target project to determine the third string in the original file that corresponds to the first string; replacing the third string in the original file with the first string to obtain the first file.

[0138] When the processor executes the program, it also performs the following steps: after modifying the reference path of the third file so that the third file references the target file and the third file, the method further includes: obtaining a first test case file for testing the third file; executing the first test case file to verify the correctness of the third file and obtaining a first verification result; if the first verification result indicates that the third file is correct, then developing the target project based on the third file; if the first verification result indicates that the third file is incorrect, then not developing the target project.

[0139] When the processor executes the program, it also performs the following steps: executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result includes: executing the first test case file, determining whether the target string exists in the third file; if the target string exists in the third file, it indicates that the third file is correct; if the target string does not exist in the third file, it indicates that the third file is incorrect.

[0140] When the processor executes the program, it also performs the following steps: After executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result, the method further includes: determining whether a sixth file containing the target string exists in the files used to develop the target project; if a sixth file containing the target string exists in the files used to develop the target project, then the target string is deleted from the sixth file to obtain a seventh file; determining an eighth file in the target project that references the sixth file, and modifying the reference path of the eighth file so that the eighth file references the target file and the seventh file; obtaining a second test case file for testing the eighth file; executing the second test case file, verifying the correctness of the eighth file, and obtaining a second verification result; if the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, then the target project is developed based on the third file and the eighth file; if the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, then the target project is not developed.

[0141] The devices mentioned in this article can be servers, PCs, tablets, mobile phones, etc.

[0142] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: obtaining a first file and a target file, wherein the first file is at least one file for developing a target project, the target project is a project to be developed, the first file includes at least a first string, the first string being at least one translated string, and the target file is used to store the same target string in the first string; deleting the target string from the first file to obtain a second file; determining a third file in the target project that references the first file; modifying the reference path of the third file so that the third file references the target file and the second file, and developing the target project based on the third file.

[0143] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: obtaining a first file and a target file includes: obtaining a first string and an original file in the target project, wherein the first string is a string obtained by translating a second string, the second string is a string added to the target project compared to the first project, and the first project is a project of a historical version of the target project; obtaining the first file based on the first string and the original file in the target project; identifying identical strings in the first file; and summarizing the identical strings in the first file to obtain the target file.

[0144] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: obtaining the first string includes: obtaining a fourth file used in developing the first project; obtaining a fifth file used in developing the target project; comparing the fourth file and the fifth file to obtain the second string; and translating the second string to obtain the first string.

[0145] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: obtaining the first file based on the first string and the original file in the target project includes: obtaining the ID information of the first string; based on the ID information of the first string, traversing the original files in the target project to determine the third string in the original file corresponding to the first string; replacing the third string in the original file with the first string to obtain the first file.

[0146] When executed on a data processing device, it is also suitable to execute an initialization program with the following method steps: after modifying the reference path of the third file so that the third file references the target file and the second file, the method further includes: obtaining a first test case file for testing the third file; executing the first test case file to verify the correctness of the third file and obtaining a first verification result; if the first verification result indicates that the third file is correct, then developing the target project based on the third file; if the first verification result indicates that the third file is incorrect, then not developing the target project.

[0147] When executed on a data processing device, it is also suitable to execute an initialization program with the following steps: executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result, including: executing the first test case file, determining whether the target string exists in the third file; if the target string exists in the third file, it indicates that the third file is correct; if the target string does not exist in the third file, it indicates that the third file is incorrect.

[0148] When executed on a data processing device, the method is also adapted to execute an initialization program with the following steps: after executing the first test case file, verifying the correctness of the third file, and obtaining a first verification result, the method further includes: determining whether a sixth file containing the target string exists in the files used to develop the target project; if a sixth file containing the target string exists in the files used to develop the target project, deleting the target string from the sixth file to obtain a seventh file; determining an eighth file in the target project that references the sixth file, and modifying the reference path of the eighth file so that the eighth file references the target file and the seventh file; obtaining a second test case file for testing the eighth file; executing the second test case file, verifying the correctness of the eighth file, and obtaining a second verification result; if the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, then developing the target project based on the third file and the eighth file; if the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, then not developing the target project.

[0149] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0150] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0151] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0152] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0153] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0154] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0155] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0156] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0157] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0158] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A project development method, characterized in that, include: Obtain a first file and a target file, wherein the first file is at least one file used to develop a target project, the target project is a project to be developed, the first file includes at least a first string, the first string is at least one translated string, and the target file is used to store the same target string in the first string; The process of obtaining the first file and the target file includes: obtaining the first string and the original file in the target project, wherein the first string is a string obtained by translating the second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; obtaining the first file based on the first string and the original file in the target project; identifying the same strings in the first file; and summarizing the same strings in the first file to obtain the target file. The process of obtaining the first file based on the first string and the original file in the target project includes: obtaining the ID information of the first string; based on the ID information of the first string, traversing the original files in the target project to determine the third string in the original file that corresponds to the first string; and replacing the third string in the original file with the first string to obtain the first file. Delete the target string from the first file to obtain the second file; Identify the third file in the target project that references the first file; By modifying the reference path of the third file, the third file references the target file and the second file, and the target project is developed based on the third file.

2. The method according to claim 1, characterized in that, Obtaining the first string includes: Obtain the fourth file used in developing the first project; Obtain the fifth document used in developing the target project; By comparing the fourth file and the fifth file, the second string is obtained; The second string is translated to obtain the first string.

3. The method according to claim 1, characterized in that, After modifying the reference path of the third file to reference both the target file and the second file, the method further includes: Obtain the first test case file for testing the third file; Execute the first test case file to verify the correctness of the third file and obtain the first verification result; If the first verification result indicates that the third file is correct, then the target project is developed based on the third file; If the first verification result indicates that the third file is incorrect, then the target project will not be developed.

4. The method according to claim 3, characterized in that, Executing the first test case file verifies the correctness of the third file, and obtaining the first verification result includes: Execute the first test case file and determine whether the target string exists in the third file; If the target string exists in the third file, then the third file is correct; If the target string is not present in the third file, then the third file is incorrect.

5. The method according to claim 3, characterized in that, After executing the first test case file, verifying the correctness of the third file, and obtaining the first verification result, the method further includes: Determine whether a sixth file containing the target string exists in the files used to develop the target project; If a sixth file containing the target string exists in the files used to develop the target project, then the target string is deleted from the sixth file to obtain the seventh file; Identify the eighth file in the target project that references the sixth file, and modify the reference path of the eighth file so that the eighth file references both the target file and the seventh file; Obtain the second test case file for testing the eighth file; Execute the second test case file to verify the correctness of the eighth file and obtain the second verification result; If the first verification result indicates that the third file is correct, and the second verification result indicates that the eighth file is correct, then the target project is developed based on the third file and the eighth file; If the first verification result indicates that the third file is incorrect, and / or the second verification result indicates that the eighth file is incorrect, then the target project will not be developed.

6. A project development apparatus, characterized in that, include: A first acquisition module is used to acquire a first file and a target file, wherein the first file is at least one file used to develop a target project, the target project is a project to be developed, the first file includes at least a first string, the first string is at least one translated string, and the target file is used to store the same target string in the first string; The first acquisition module includes: a first acquisition unit, configured to acquire the first string and the original file in the target project, wherein the first string is a string obtained by translating the second string, the second string is a string added to the target project compared to the first project, and the first project is a historical version of the target project; a first determination unit, configured to obtain the first file based on the first string and the original file in the target project; a second determination unit, configured to determine the identical strings in the first file; and a first summarization unit, configured to summarize the identical strings in the first file to obtain the target file. The first determining unit includes: a third obtaining submodule, used to obtain the ID information of the first string; a first traversal submodule, used to traverse the original files in the target project based on the ID information of the first string, and determine the third string in the original file corresponding to the first string; and a first replacement submodule, used to replace the third string in the original file with the first string to obtain the first file. The first deletion module is used to delete the target string from the first file to obtain the second file; The first determining module is used to determine the third file in the target project that references the first file; The first processing module is used to modify the reference path of the third file so that the third file references the target file and the second file, and to develop the target project based on the third file.

7. A computer-readable storage medium, characterized in that, The storage medium stores a program, wherein the program executes the development method of the project according to any one of claims 1 to 5.

8. A processor for a project development method, characterized in that, The processor is used to run a program, wherein the program executes the development method of the project according to any one of claims 1 to 5 when it runs.