Method, device, computer equipment and storage medium for modifying multilingual resources

By comparing and replacing language resources, it solves the problem of technical personnel having difficulty detecting omissions in modifications to foreign language resources, enabling rapid and accurate modification of multi-language resources, and reducing the risk of omissions in modifications.

CN117709362BActive Publication Date: 2024-10-01CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311562139.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-22
Publication Date
2024-10-01
Estimated Expiration
2043-11-22

AI Technical Summary

Technical Problem

It is difficult for technicians to detect the omission of modifications to foreign language resources when modifying software language resources, especially when they do not master the language.

Method used

By comparing the original and target language resources, the modified location and content are determined, and the first language resource is used for replacement, which is then translated into the second language resource to ensure the consistency and completeness of the modified content.

Benefits of technology

It realizes the rapid discovery of omissions during the modification process of multi-language resources, reduces the risk of omissions in modifications, and improves the efficiency and accuracy of modifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117709362B_ABST
    Figure CN117709362B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for modifying a multilingual resource. The method comprises determining a position identifier of a modification location and a modified target content based on a comparison between an original first language resource and a target first language resource; obtaining an original second language resource, wherein the original second language resource corresponds to a second language; searching for target modification data in the original second language resource based on the position identifier, and replacing the target modification data in a first language based on the target content to obtain a transitional second language resource; translating the target content in the first language in the transitional second language resource into a second language to obtain a target second language resource. The method is used to improve the problem in the prior art that modification and omission of foreign language resources are difficult to detect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for modifying multilingual resources. Background Art

[0002] The car system software can provide universal user services for users in different regions. Users can set the language to match the language of the region where the user is located. Therefore, language internationalization of the car software is essential.

[0003] As the software is updated, existing language content may need to be modified. Technical personnel usually modify the language resources they are familiar with, and then translators who master other languages ​​will simultaneously modify the content in other languages. For example, when the technical personnel have modified the content stored in the Chinese language resource file, the translators will then modify the English resources, Russian resources, etc.

[0004] However, since technical personnel do not master foreign languages ​​such as English and Russian, it is difficult for them to detect if there are modifications or omissions in foreign language resources. Summary of the invention

[0005] Based on this, a method, apparatus, computer device and storage medium for modifying a multilingual resource are provided to improve the problem in the prior art that modification and omission of foreign language resources are difficult to detect.

[0006] In one aspect, a method for modifying a multilingual resource is provided, the method comprising:

[0007] Determining a location identifier of the modified location and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language;

[0008] Acquire an original second language resource, wherein the original second language resource corresponds to a second language;

[0009] According to the position identifier, searching for the target modified data in the original second language resource, and replacing the target modified data in the first language according to the target content to obtain a transitional second language resource;

[0010] In the transitional second language resource, the target content in the first language is translated into the second language to obtain the target second language resource.

[0011] In one embodiment, the step of determining the location identifier of the modified location and the modified target content based on the comparison between the original first language resource and the target first language resource includes:

[0012] Comparing the content corresponding to each position of the original first language resource and the target first language resource in sequence;

[0013] If the content corresponding to the position in the original first language resource is empty, obtaining a new language resource according to the position identifier of the position in the target first language resource and the modified target content;

[0014] If the content corresponding to the position in the original first language resource is not empty, comparing whether the content corresponding to the position is the same; if not, obtaining an updated language resource according to the position identifier of the position in the target first language resource and the modified target content;

[0015] The replacing the target modification data according to the first language based on the target content includes:

[0016] According to the newly added language resources and the updated language resources, the content corresponding to the same position identifier in the original second language resource is replaced in the first language.

[0017] In one embodiment, translating the target content in the first language into the second language in the transitional second language resource includes:

[0018] According to the expression rules of the first language, identifying the content in the first language in the transitional second language resource, and extracting an association table between the position identifier of the modified location and the target content;

[0019] translating the target content in the association table into a second language;

[0020] The translated target content is used to replace the content in the first language in the transitional second language resource according to the position identifier to obtain the target second language resource.

[0021] In one embodiment, after obtaining the target second language resource, the method further includes:

[0022] The quantity verification of the location identifiers includes:

[0023] Obtaining a first number of the position identifiers in the target first language resource;

[0024] Obtaining a second number of the position identifiers in the target second language resource;

[0025] Compare the first quantity and the second quantity to see whether they are consistent, and if not, execute a quantity inconsistency reminder.

[0026] In one embodiment, the number verification of the location identifiers further includes:

[0027] When the first number and the second number are consistent, performing a value check of the location identifier includes:

[0028] The value of each position identifier in the target first language resource is obtained, and it is determined whether the value exists in the target second language resource. If not, a value missing reminder is performed.

[0029] In one embodiment, performing the value verification of the location identifier further includes:

[0030] If the value of each of the position identifiers in the target first language resource exists in the target second language resource, performing content verification includes:

[0031] According to the expression rule of the first language, it is identified whether the target second language resource has content in the first language, and if so, a prompt is executed if the content verification fails.

[0032] In one embodiment, after obtaining the target second language resource, the method further includes:

[0033] Get the current language set when the multilingual resource is used by the application;

[0034] Obtaining background return data when the multilingual resource is used by the application, wherein the background return data includes the content requested by the application;

[0035] When the current language is not the first language, the background return data is checked according to the expression rule of the first language, and if the background return data contains content in the first language, a background return data mismatch prompt is executed.

[0036] In another aspect, a device for modifying a multilingual resource is provided, the device comprising:

[0037] a comparison module, the comparison module determining a location identifier of a modification and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language;

[0038] A replacement module, wherein the replacement module obtains an original second language resource, wherein the original second language resource corresponds to the second language; searches for target modification data in the original second language resource according to the position identifier, and replaces the target modification data according to the first language according to the target content to obtain a transitional second language resource;

[0039] The translation module translates the target content in the first language in the transitional second language resource into the second language to obtain the target second language resource.

[0040] In yet another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the computer program.

[0041] A computer-readable storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described are implemented.

[0042] The above-mentioned method, apparatus, computer device and storage medium for modifying multilingual resources determine the position identifier of the modification and the target content of the modification by comparing the first language resource before and after the modification. For the second language resource using the second language, the target content of the first language is directly replaced at the same position to obtain a transitional second language resource, and then the first language part of the transitional second language resource is translated. Even if omissions occur in the translation, the omissions can be directly determined based on the difference in languages. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 is a flowchart of a method for modifying a multilingual resource in one embodiment;

[0044] Figure 2 A schematic diagram of a table of language resources in one embodiment;

[0045] Figure 3 A schematic diagram of modifying a language resource in one embodiment;

[0046] Figure 4 is a structural block diagram of a device for modifying multilingual resources in one embodiment;

[0047] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The vehicle system will send different prompt messages to users in different scenarios. For users in different regions, the same semantic content will be sent in different languages ​​according to specific settings. For example, when the system is abnormal, the prompt "System abnormality" will be given to users who set it to Chinese, and the prompt "Abnormal system" will be given to users who set it to English.

[0050] The language resource file stores the content corresponding to the system code value, for example: 10001 = "Vehicle information does not exist"; 100002 = "xxxxx"; each language has its own language resource file, such as Chinese language resource file, English language resource file, Japanese language resource file and other language resource files. Generally, the content in the language resource file is text content.

[0051] When a certain content needs to be modified, all language resource files need to be modified synchronously. For example, in the Chinese language resource file, when the code value 0004 = "the vehicle is not bound" is adjusted to 0004 = "the vehicle is bound repeatedly", the language resource files of other languages ​​also need to adjust the content corresponding to the code value 0004. If a language resource file of a certain language is omitted, for example, the content of the code value 0004 in the Russian language resource file is not modified and is still the Russian "vehicle is bound repeatedly", it is difficult for technicians to find it because they do not master Russian.

[0052] The present application provides a method for modifying a multilingual resource, which performs synchronous modification on language resources of at least two languages ​​to avoid modification omissions.

[0053] Exemplarily, the method is as follows Figure 1 As shown, the following steps are included:

[0054] Step 101: Determine the location identifier of the modified location and the modified target content based on the comparison between the original first language resource and the target first language resource.

[0055] The first language resource is a basic language resource modified by a technician, and is usually written by the technician in a language that the technician has mastered. For example, the first language resource is a Chinese language resource, which is written into a Chinese resource file: messages_zh_CN.properties.

[0056] The original Chinese language resources are modified to obtain the target Chinese language resources, such as Figure 2 As shown, the language resources are exemplarily presented in the form of a table. In the original Chinese language resource, the code value 0004 = "the vehicle is not bound", and in the target Chinese language resource, the code value 0004 has been modified = "the vehicle is bound repeatedly". By comparing the Chinese language resources before and after the modification, the position identifier can be determined, that is, the code value 0004 is the modification position, and the modified target content is "the vehicle is bound repeatedly".

[0057] It is understandable that Chinese is a language that the technical personnel have mastered, and when making modifications, Chinese will still be used for modification.

[0058] The above process can be automatically implemented by software, specifically:

[0059] When the program obtains the Chinese content to be translated in the project through the tool class, the data is stored in a map data structure, wherein the map data structure has a named variable projectMap; the key = the code value of the Chinese content, and the value represents the Chinese content.

[0060] Through the ClassPathResource class in the Spring component, the relative path of the Chinese language resource file (messages_zh_CN.properties) is passed into the class: i18n / messages_zh_CN.properties to create a ClassPathResource object.

[0061] Through the PropertiesLoaderUtils.loadProperties(resource) function, where resource = ClassPathResource object, the Chinese language resource file object is obtained, and the content is taken out line by line. The content (0004 = the vehicle is not bound) is divided into two parts, 0004 is the code value, and the content after the equal sign is the vehicle is not bound. It is stored in the map data structure, named variable resourceChineseMap, where key = code value, value = Chinese content.

[0062] Compare projectMap and resourceChineseMap. There may be new content in projectMap that needs to be added to the Chinese language resource file (messages_zh_CN.properties) or projectMap may have modified the content in the Chinese language resource file and needs to be updated.

[0063] In one implementation, the code value and the value value are obtained from the projectMap in sequence and named as projectValue, and the corresponding content is obtained from the resourceChineseMap through the code value and named as resourceValue.

[0064] If resourceValue is empty, it means that the corresponding code value and projectValue in projectMap need to be added to messages_zh_CN.properties; and stored in the Map data structure and define the variable = addResourceChineseMap.

[0065] If resourceValue is not empty, determine whether resourceValue and projectValue are equal. If they are not equal, it means that the content of the Chinese language resource file (messages_zh_CN.properties) has been modified in the current project.

[0066] Step 102: Acquire original second language resources.

[0067] The second language resource is a language resource in a language other than the first language, such as English, Russian, Japanese, etc. In the original second language resource, the content corresponding to the code value 0004 still expresses the semantics of "the vehicle is not bound".

[0068] Step 103: searching the original second language resource for target modified data according to the position identifier, and replacing the target modified data in the first language according to the target content to obtain a transitional second language resource.

[0069] Through the aforementioned comparison process, it is determined that the content corresponding to the code value 0004 is the data planned to be modified. The corresponding foreign language content needs to be modified to a foreign language with the semantics of "vehicle repeated binding". However, if it is directly modified to the corresponding translation content, omissions may occur. First, there may be more than one location that needs to be modified at the same time. Code values ​​0004, 0006, 0011, etc. may all need to be modified. If omissions occur, it is difficult for technical personnel to detect; second, there is more than one language that needs to be modified, and there may be as many as hundreds of languages. If the language resources of a certain language are modified or omitted, it is also difficult for technical personnel to detect.

[0070] This application directly replaces the places that need to be modified with the first language familiar to the technician, that is, directly replace all the places that need to be modified in the foreign language resources with the target content in Chinese, such as Figure 3 In the process shown, if a certain part is missed during the replacement, it will still be the foreign language "the vehicle is not bound" instead of the Chinese "the vehicle is bound repeatedly". In this way, even if the technician does not have foreign language skills, he or she can easily detect the omission because the two languages ​​have differences in glyphs and other aspects.

[0071] Step 104: translate the target content in the first language in the transitional second language resource into the second language to obtain a target second language resource.

[0072] After obtaining the transitional second language resource with two languages, the Chinese content in the transitional second language resource can be translated to obtain the target second language resource with modified content and completely in the corresponding foreign language.

[0073] In one implementation, the content to be translated in each language resource is automatically extracted, and the transitional language resources are updated after translation. Specifically, by checking whether there is a first language in each language resource file and using expression rules for detecting the first language, the first language content in each language resource file is extracted and then translated.

[0074] In particular, even if different languages ​​express the same semantics, the same code value may be described in different ways, which may involve modifying specific expressions in specific languages. For example, the prompt "system abnormality" in Chinese language resources may be expressed as "the system has gone awry and is being restored. Please try again later" in English language resources. This modification process is also first replaced by the technical staff in the first language, and then translated from Chinese to English. Therefore, the resource files of each language need to be extracted and translated separately.

[0075] For example, according to the location path where each language resource file is stored in the project, for example, English language resource file: i18n / messages_en_US.properties;

[0076] Use the system class ClassPathResource and the language resource file path to create a ClassPathResource object.

[0077] Use the loadProperties function in the PropertiesLoaderUtils class and pass in the ClassPathResource object to get the contents of the language resource file.

[0078] Take out the contents of the resource file one by one, and compare the contents line by line to see if they match the Chinese regular expression. If they do, extract the contents and put them in the List container data structure.

[0079] Generate a new Excel file through data flow using the content in the List data structure. The file is named en_US.excel. The newly generated file can be viewed on your local computer.

[0080] The above process is repeated to extract the contents to be translated from other language resource files in turn.

[0081] The generated Excel file to be translated is translated, and the translated target content is replaced with the Chinese content in the transitional second language resource according to the position mark.

[0082] In the above process, the technician always works in the first language. When modifying the second language resource in the second language, the technician still replaces the content marked at the same position with the first language. If an omission occurs, the missing position will still remain in the second language, and the technician can easily find the omission. Secondly, in the translation process, if a missing translation occurs, the data that should have been translated into the second language will still be in the first language, and it is also easy to find the translation omission. The combined replacement process and translation process enable the simultaneous modification of multilingual resources using the method of the present application, which can quickly discover problems with the content to be translated and reduce the risk of modification omissions.

[0083] On the other hand, by adopting the method provided in the above embodiment, the difficulty of language resource file verification can be reduced after the language service is started in the later stage. The language resource file verification can be divided into the following three parts:

[0084] 1. Check whether the numbers in the language resource files are consistent.

[0085] Check whether the number of codes in each language resource file is consistent, and preliminarily ensure whether there are any missing codes in the language resource files to prevent incorrect prompts or errors online. Including: obtaining the first number of the position identifiers in the target first language resource; obtaining the second number of the position identifiers in the target second language resource; comparing the first number and the second number to see if they are consistent, if not, executing a reminder of inconsistent numbers.

[0086] For example:

[0087] 1.1. Through the ClassPathResource class in the Spring component, pass in the relative path of the Chinese language resource file (messages_zh_CN.properties): i18n / messages_zh_CN.properties to create a ClassPathResource object.

[0088] 1.2. Through the PropertiesLoaderUtils.loadProperties(resource) function, where resource = ClassPathResource object, obtain the Chinese language resource file object, and take out the content from it line by line and put it into the Map data structure, naming the variable ChineseMap. The key in ChineseMap is the code value in the Chinese language resource file, and the value in the map is the value corresponding to the code.

[0089] 1.3. Take out the contents of other language resource files and put them into the map of the corresponding language in the above way.

[0090] 1.4. Use the size method in the Map data structure to get the number of ChineseMap, and use the same method to get the number of other language maps to determine whether it is consistent with the number of ChineseMap. If not, prompt the technician to check which language resource file has inconsistent content quantity with the Chinese language resource file.

[0091] 2. Check the value of the location identifier.

[0092] Check whether the code values ​​in the language resource file are consistent to further ensure the accuracy of the language resource file. When the service is started, the system automatically checks whether the code values ​​in each language resource file are all consistent, whether the number is equal, and whether the code values ​​are all consistent. For example, there are 10001, 10002, and 10003 in the Chinese language resource file. However, there are 10002, 10003, and 10004 in Russian. Although the number is consistent, the code values ​​are different. This implementation method obtains whether all the code values ​​in the Chinese language resource file exist in other language resource files. If not, it means that the code values ​​in other language Chinese resources are missing.

[0093] Specific:

[0094] 2.1. Obtain the Chinese language resource file in the same way as 1.1 and 1.2. Store it in the variable ChineseMap (map data structure).

[0095] 2.2. Get the contents of other language resource files and store them in the map in sequence.

[0096] 2.3. Check whether the code value in ChineseMap and the code value in other language resource files map exist. If not, the technician will be prompted to check which language resource file has the missing code value.

[0097] 3. Content verification.

[0098] When the number and code values ​​in each language resource file are the same, but it cannot be guaranteed that the content corresponding to the code value is completely consistent, content verification is performed to avoid the problem that the same text prompt appears incorrectly in different countries online, giving users wrong guidance. This embodiment obtains resource files other than the Chinese language resource file (Russian language resource files, English language resource files and other language resource files) to determine whether the content corresponding to the code value contains Chinese. If it contains Chinese description, the content has not been translated and needs to be translated in time.

[0099] Specific:

[0100] 3.1. Obtain other files except the Chinese language resource file in the same way as 1.1 and 1.2, and store them in the map data structure respectively. The key is the code value, and the value represents the content corresponding to the code value. Name a variable languageMap.

[0101] 3.2. Take out the contents corresponding to the code values ​​from languageMap one by one and name the variable content;

[0102] 3.3. Use the compile method in the system function Pattern class, where the Chinese rule [\u4e00-\u9fa5] is passed into the method to construct a pattern object;

[0103] 3.4. Use the matcher method in the pattern object and pass in content. The returned result has two values: contains and does not contain.

[0104] 3.5. If the result in 3.4 is not included, it means there is no problem. If it is included, it means that there is Chinese in the language resource file and it needs to be translated into the corresponding national language content. It will also prompt the technicians which code and content in which language resource file has not been translated.

[0105] When users use software applications in a production environment, such as in the United States, the backend system should return English. If it returns Chinese, users may not understand it. Users may not give feedback to technicians in a timely manner. This may last for days or even months until the technicians discover it themselves, which seriously affects the user experience. Therefore, it is necessary to dynamically check the data returned by the backend system. If the check is inconsistent, an alarm will be issued so that the technicians can make timely adjustments.

[0106] In the present application, the current language set when the multilingual resource is used by the application is obtained; and the background return data when the multilingual resource is used by the application is obtained, and the background return data includes the content requested by the application; when the current language is not the first language, the background return data is checked according to the expression rules of the first language, and if the background return data contains content in the first language, a background return data mismatch prompt is executed.

[0107] Exemplary:

[0108] 1. Define the data structure returned by the background system to the app, web or other terminals:

[0109] 2. When the app calls the backend system interface, the language used in the current region is passed to the backend system through the header in the http protocol, and the language is set to the ThreadLocal object of the current thread.

[0110] 3. Obtain the data request results of the background system app through the function method provided by the system.

[0111] 4. Get the language used by the current request interface user from the ThreadLocal object.

[0112] 5. The compile method in the system function Pattern class passes in the regular expression for detecting Chinese characters and constructs a pattern object.

[0113] 6. If the current language name in step 4 is Chinese, call the matcher method in the pattern object and return true, which means there is no problem with the prompt.

[0114] 7. If the current language name in step 4 is not Chinese, call the matcher method in the pattern object and return true, indicating that the prompt content does not match. You can proceed with the following two steps:

[0115] 7.1. Save to database: Save the content to be translated and the corresponding country language to the "pending adaptation database table". Then, the content of the "pending adaptation database table" is obtained in real time through the system background page and displayed on the page. The content that needs to be translated can be checked and processed in time every day.

[0116] 7.2. Push the content to be translated and the corresponding language, and the technical staff can receive prompt information in time and process it.

[0117] It should be understood that although Figure 1The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0118] In one embodiment, Figure 4 As shown, a device for modifying a multilingual resource is provided, comprising: a comparison module 201, a replacement module 202 and a translation module 203, wherein:

[0119] A comparison module 201, wherein the comparison module 201 determines a location identifier of a modification and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language;

[0120] A replacement module 202, wherein the replacement module 202 obtains an original second language resource, wherein the original second language resource corresponds to the second language; searches for target modification data in the original second language resource according to the position identifier, and replaces the target modification data according to the first language according to the target content to obtain a transitional second language resource;

[0121] The translation module 203 translates the target content in the first language in the transitional second language resource into the second language to obtain a target second language resource.

[0122] The above-mentioned multilingual resource modification device determines the position identifier of the modification location and the target content of the modification by comparing the first language resource before and after the modification. For the second language resource using the second language, the target content of the first language is directly replaced at the same position to obtain a transitional second language resource, and then the first language part of the transitional second language resource is translated. Even if omissions occur in the translation, the omissions can be directly determined based on the difference in languages.

[0123] In one embodiment, the comparison module 201 compares the content corresponding to each position of the original first language resource and the target first language resource in sequence; if the content corresponding to the position in the original first language resource is empty, a new language resource is obtained according to the position identifier of the position in the target first language resource and the modified target content; if the content corresponding to the position in the original first language resource is not empty, whether the content corresponding to the position is the same is compared; if not, an updated language resource is obtained according to the position identifier of the position in the target first language resource and the modified target content; the replacing the target modified data according to the target content in accordance with the first language includes: replacing the content corresponding to the same position identifier in the original second language resource according to the first language according to the new language resource and the updated language resource.

[0124] In this way, it is possible to determine which locations in the first language resource have newly added content and which locations are original but modified.

[0125] In one embodiment, the translation module 203 identifies the content in the first language in the transitional second language resource according to the expression rule of the first language, and extracts an association table of the position identifier of the modified location and the target content; translates the target content in the association table in the second language; and replaces the content in the first language in the transitional second language resource with the translated target content according to the position identifier to obtain the target second language resource.

[0126] In one embodiment, the device further comprises a verification module, which is used for verifying the quantity of the location identifiers, verifying the value of the location identifiers, and verifying the content.

[0127] Specifically, quantity verification includes:

[0128] Obtaining a first number of the position identifiers in the target first language resource;

[0129] Obtaining a second number of the position identifiers in the target second language resource;

[0130] Compare the first quantity and the second quantity to see whether they are consistent, and if not, execute a quantity inconsistency reminder.

[0131] After the quantity check is passed, the value check of the position identifier is performed, including:

[0132] The value of each position identifier in the target first language resource is obtained, and it is determined whether the value exists in the target second language resource. If not, a value missing reminder is performed.

[0133] After the value verification passes, the content verification is performed, including:

[0134] According to the expression rule of the first language, it is identified whether the target second language resource has content in the first language, and if so, a prompt is executed if the content verification fails.

[0135] By adopting the above verification process, it is possible to detect whether each language resource file is correct when the service is started.

[0136] In a production environment, the modification device can also determine whether there are errors in the language resources through the background return data.

[0137] The verification module is also used to obtain the current language set when the multilingual resource is used by the application; obtain the background return data when the multilingual resource is used by the application, and the background return data includes the content requested by the application; when the current language is not the first language, verify the background return data according to the expression rules of the first language, and if there is content in the first language in the background return data, execute a background return data mismatch prompt.

[0138] For the specific definition of the multilingual resource modification device, please refer to the definition of the multilingual resource modification method mentioned above, which will not be repeated here. Each module in the above-mentioned multilingual resource modification device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0139] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for modifying a multilingual resource is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0140] Those skilled in the art will understand that Figure 5The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0141] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0142] Determining a location identifier of the modified location and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language;

[0143] Acquire an original second language resource, wherein the original second language resource corresponds to a second language;

[0144] According to the position identifier, searching for the target modified data in the original second language resource, and replacing the target modified data in the first language according to the target content to obtain a transitional second language resource;

[0145] In the transitional second language resource, the target content in the first language is translated into the second language to obtain the target second language resource.

[0146] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0147] Comparing the content corresponding to each position of the original first language resource and the target first language resource in sequence;

[0148] If the content corresponding to the position in the original first language resource is empty, obtaining a new language resource according to the position identifier of the position in the target first language resource and the modified target content;

[0149] If the content corresponding to the position in the original first language resource is not empty, comparing whether the content corresponding to the position is the same; if not, obtaining an updated language resource according to the position identifier of the position in the target first language resource and the modified target content;

[0150] The replacing the target modification data according to the first language based on the target content includes:

[0151] According to the newly added language resources and the updated language resources, the content corresponding to the same position identifier in the original second language resource is replaced in the first language.

[0152] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0153] According to the expression rules of the first language, identifying the content in the first language in the transitional second language resource, and extracting an association table between the position identifier of the modified location and the target content;

[0154] translating the target content in the association table into a second language;

[0155] The translated target content is used to replace the content in the first language in the transitional second language resource according to the position identifier to obtain the target second language resource.

[0156] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0157] Obtaining a first number of the position identifiers in the target first language resource;

[0158] Obtaining a second number of the position identifiers in the target second language resource;

[0159] Compare the first quantity and the second quantity to see whether they are consistent, and if not, execute a quantity inconsistency reminder.

[0160] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0161] The value of each position identifier in the target first language resource is obtained, and it is determined whether the value exists in the target second language resource. If not, a value missing reminder is performed.

[0162] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0163] If the value of each of the position identifiers in the target first language resource exists in the target second language resource, performing content verification includes:

[0164] According to the expression rule of the first language, it is identified whether the target second language resource has content in the first language, and if so, a prompt is executed if the content verification fails.

[0165] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

[0166] Get the current language set when the multilingual resource is used by the application;

[0167] Obtaining background return data when the multilingual resource is used by the application, wherein the background return data includes the content requested by the application;

[0168] When the current language is not the first language, the background return data is checked according to the expression rule of the first language, and if the background return data contains content in the first language, a background return data mismatch prompt is executed.

[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0170] Determining a location identifier of the modified location and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language;

[0171] Acquire an original second language resource, wherein the original second language resource corresponds to a second language;

[0172] According to the position identifier, searching for the target modified data in the original second language resource, and replacing the target modified data in the first language according to the target content to obtain a transitional second language resource;

[0173] In the transitional second language resource, the target content in the first language is translated into the second language to obtain the target second language resource.

[0174] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0175] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0176] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for modifying a multilingual resource, characterized in that: include: Determining a location identifier of the modified location and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language; Acquire an original second language resource, wherein the original second language resource corresponds to a second language; According to the position identifier, the target modified data is searched in the original second language resource, and the target modified data is replaced in the first language according to the target content to obtain a transitional second language resource with two languages, so as to find the position to be replaced based on the glyph differences between the two languages ​​in the transitional second language resource; Translating the target content in the first language into the second language in the transitional second language resource to obtain a target second language resource, and finding the location of the translation omission based on the data in the first language existing in the target second language resource; The step of translating the target content in the first language into the second language in the transitional second language resource includes: According to the expression rules of the first language, identifying the content in the first language in the transitional second language resource, and extracting an association table between the position identifier of the modified location and the target content; translating the target content in the association table into a second language; The translated target content is used to replace the content in the first language in the transitional second language resource according to the position identifier to obtain the target second language resource.

2. The method for modifying a multilingual resource according to claim 1, characterized in that: The step of determining the location identifier of the modified location and the modified target content based on the comparison between the original first language resource and the target first language resource includes: Comparing the content corresponding to each position of the original first language resource and the target first language resource in sequence; If the content corresponding to the position in the original first language resource is empty, obtaining a new language resource according to the position identifier of the position in the target first language resource and the modified target content; If the content corresponding to the position in the original first language resource is not empty, comparing whether the content corresponding to the position is the same; if not, obtaining an updated language resource according to the position identifier of the position in the target first language resource and the modified target content; The replacing the target modification data according to the first language based on the target content includes: According to the newly added language resources and the updated language resources, the content corresponding to the same position identifier in the original second language resource is replaced in the first language.

3. The method for modifying a multilingual resource according to claim 1, characterized in that: After obtaining the target second language resource, the method further includes: The quantity verification of the location identifiers includes: Obtaining a first number of the position identifiers in the target first language resource; Obtaining a second number of the position identifiers in the target second language resource; Compare the first quantity and the second quantity to see whether they are consistent, and if not, execute a quantity inconsistency reminder.

4. The method for modifying a multilingual resource according to claim 3, characterized in that: The quantity verification of the position identifiers further includes: When the first number and the second number are consistent, performing a value check of the location identifier includes: The value of each position identifier in the target first language resource is obtained, and it is determined whether the value exists in the target second language resource. If not, a value missing reminder is performed.

5. The method for modifying a multilingual resource according to claim 4, characterized in that: The performing of the value verification of the location identifier also includes: If the value of each of the position identifiers in the target first language resource exists in the target second language resource, performing content verification includes: According to the expression rule of the first language, it is identified whether the target second language resource has content in the first language, and if so, a prompt is executed if the content verification fails.

6. The method for modifying a multilingual resource according to claim 1, characterized in that: After obtaining the target second language resource, the method further includes: Get the current language set when the multilingual resource is used by the application; Obtaining background return data when the multilingual resource is used by the application, wherein the background return data includes the content requested by the application; When the current language is not the first language, the background return data is checked according to the expression rule of the first language, and if the background return data contains content in the first language, a background return data mismatch prompt is executed.

7. A device for modifying multilingual resources, characterized in that: The device comprises: a comparison module, the comparison module determining a location identifier of a modification and a modified target content based on a comparison between an original first language resource and a target first language resource, wherein the original first language resource corresponds to a first language, and the target first language resource is obtained by modifying the original first language resource in the first language; a replacement module, wherein the replacement module obtains an original second language resource, wherein the original second language resource corresponds to the second language; searches for target modification data in the original second language resource according to the position identifier, and replaces the target modification data according to the first language according to the target content, thereby obtaining a transitional second language resource with two languages, so as to find a position to be replaced based on the glyph differences between the two languages ​​in the transitional second language resource; A translation module, which translates the target content in the first language in the transitional second language resource into the second language to obtain a target second language resource, and finds the position of the translation omission based on the data in the first language existing in the target second language resource; The step of translating the target content in the first language into the second language in the transitional second language resource includes: According to the expression rules of the first language, identifying the content in the first language in the transitional second language resource, and extracting an association table between the position identifier of the modified location and the target content; translating the target content in the association table into a second language; The translated target content is used to replace the content in the first language in the transitional second language resource according to the position identifier to obtain the target second language resource.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.