Translation resource determination method and device, equipment, storage medium and program product
By using the target dictionary to identify and correct missing results in the pending translation resource file, the efficiency and accuracy problems of translators when manually identifying and modifying string resources during the internationalization process are solved, and efficient and accurate translation resource management is achieved.
Patent Information
- Application Number
- CN202411950625.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
In the software development process, especially in the development of global applications, and in the internationalization of string resources, translators need to manually identify new or modified string resources, which increases the workload and is prone to errors.
By obtaining the target dictionary, the missing results in the pending translation resource file are determined, and the missing results are corrected using the target dictionary to ensure the integrity of the translation resource.
Improves the accuracy and efficiency of translation, reduces manual intervention and errors, and ensures the integrity of translation resources.
Smart Images

Figure CN119886158A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment, storage medium and program product for determining translation resources. Background Art
[0002] In the process of software development, especially in the development of globalized applications (Apps), the internationalization of string resources is a crucial link.
[0003] To ensure that the application can correctly display text information in different language environments, developers need to translate all string resources in the application into the target language. Currently, developers provide the strings.xml file in the default language directly to translators. Translators choose to convert the strings.xml file into an Excel spreadsheet. The Excel spreadsheet has an intuitive and easy-to-use interface in which translators can translate directly. After completing the translation, the developer converts the Excel spreadsheet back to the strings.xml file to complete the internationalization of the string resources.
[0004] However, during the manual recognition process, translators need to manually identify which character strings are new or modified, which increases the workload of obtaining translation resources and makes manual modification prone to errors.
[0005] Therefore, how to efficiently and accurately determine translation resources becomes a problem that needs to be solved. Summary of the invention
[0006] In view of this, the present invention provides a method, apparatus, device, storage medium and program product for determining translation resources.
[0007] In a first aspect, the present invention provides a method for determining translation resources, the method comprising: obtaining a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier; determining a second target value corresponding to each first target identifier from at least one translation resource file to be processed according to the plurality of first target identifiers, and writing the first target identifier, the first target value, and the second target value into a first to-be-processed table to obtain a first target table; determining missing results of at least one translation resource file to be processed based on a first target path and a second target path, and writing the missing results into a second to-be-processed table to obtain a second target table; correcting the missing results in the second target table according to the first target table, the plurality of first target identifiers, and the first target value corresponding to each first target identifier to obtain a third target table; determining the target translation resource based on the first target table and the third target table.
[0008] The method for determining translation resources provided in this embodiment can clearly define and manage multiple first target identifiers and their corresponding first target values through a target dictionary, and can accurately find the corresponding second target value, that is, the translated or localized content, from the translation resource file to be processed based on the first target identifier, thereby avoiding translation errors and omissions and improving the accuracy of translation. Then, by comparing the first target path and the second target path, it can be determined whether there are missing translation contents in the translation resource file to be processed, and by using the first target table, the first target identifier and the first target value, the missing results in the second target table can be corrected to obtain a complete third target table, thereby ensuring the integrity of the translation resources and reducing manual intervention and errors through automation and standardization of translation work compared to the manual identification method performed by translators.
[0009] In a possible implementation, the step of determining a target dictionary includes: obtaining at least one translation resource file to be processed and a file identifier corresponding to the translation resource file to be processed; determining a target translation resource file from the at least one translation resource file to be processed according to the file identifier; wherein the target translation resource file includes: a plurality of first target identifiers and a first target value corresponding to each first target identifier; and writing the plurality of first target identifiers and the first target value corresponding to each first target identifier into an initial dictionary to determine the target dictionary.
[0010] The method for determining the translation resources provided by the present embodiment can realize the systematic management and tracking of translation resources by distributing a unique file identifier to each pending translation resource file, ensure the accuracy and completeness of the translation resources, and avoid confusion and omission. In addition, the file identifier is used as a key index, so that the target translation resource file can be quickly and accurately screened out from a large number of pending translation resource files. This improves work efficiency and reduces the time and cost of manual screening. In addition, multiple first target identifiers and corresponding first target values are written into the initial dictionary, and finally determined as the target dictionary, which realizes the structured storage of data. This storage mode is convenient for the retrieval, updating and maintenance of data, and provides a solid foundation for subsequent translation work.
[0011] In one possible implementation, the first target identifier, the first target value, and the second target value are written into a first to-be-processed table to obtain the first target table, including: according to the row direction of the first to-be-processed table, the first target position corresponding to the first target identifier, the second target position corresponding to the first target value, and the third target position corresponding to the second target value are determined in sequence; wherein the first target position, the second target position, and the third target position are arranged in order from left to right; the first target identifier, the first target value, and the second target value are written into the first target position corresponding to the first target identifier, the second target position corresponding to the first target value, and the third target position corresponding to the second target value, respectively.
[0012] The method for determining the translation resources provided by the present embodiment can clearly show the correlation between the first target identifier, the first target value, and the second target value by arranging the relevant information in the same row in a specific order (from left to right). This organization makes the data easy to understand and analyze. In addition, when the corresponding value of the specific first target identifier needs to be found, the row can be quickly located, and the first target value and the second target value can be found in the order from left to right. This arrangement reduces the retrieval time and improves work efficiency.
[0013] In a possible implementation, based on the first target path and the second target path, determining the missing result of at least one translation resource file to be processed, and writing the missing result into a second table to be processed to obtain the second target table, includes: determining the target translation resource file according to the first target path; determining the target translation resource file corresponding to the second target path in at least one translation resource file to be processed according to the second target path; comparing the target translation resource file and the target translation resource file to be processed to determine the missing target identifier and the missing value corresponding to the missing target identifier in the target translation resource file to be processed; writing the missing target identifier and the missing value corresponding to the missing target identifier into the second table to obtain the second target table.
[0014] The method for determining translation resources provided in this embodiment can accurately locate the target translation resource file and the corresponding translation resource file to be processed through the first target path and the second target path, avoiding the tediousness and errors of manual search and improving work efficiency. In addition, by comparing the target translation resource file and the translation resource file to be processed, the target identifier missing in the to-be-processed file and its corresponding missing value can be quickly found. Then, the missing target identifier and the corresponding missing value are written into the second to-be-processed table to obtain the second target table. This structured recording method makes the missing information clearer, easier to understand and analyze. At the same time, it also provides convenience for subsequent repair and supplement work.
[0015] In one possible implementation, the missing results in the second target table are corrected according to the first target table, multiple first target identifiers, and the first target value corresponding to each first target identifier to obtain a third target table, including: comparing the missing results in the second target table with the first target table, and detecting whether the missing result is a value update result; wherein the value update result is used to indicate that there is a value corresponding to the first target identifier in the missing result, and the value corresponding to the first target identifier is different from the value corresponding to the first identifier in the first target table; if the missing result is a value update result, the value corresponding to the first target identifier in the missing result is updated according to the value corresponding to the first identifier in the first target table; if the missing result is not an update result, the missing position corresponding to the first target identifier in the missing result is supplemented according to the first target value corresponding to the first target identifier.
[0016] The method for determining translation resources provided in this embodiment can accurately identify which missing results are caused by value updates by comparing the missing results in the second target table with the first target table. This helps to distinguish between real missing values (i.e., content that needs to be added) and existing values that may have been changed, thereby avoiding unnecessary duplication of work or data overwriting. At the same time, for missing values that are not updated results, they are supplemented according to the first target value corresponding to the first target identifier, ensuring the integrity and accuracy of the data, thereby building a comprehensive translation resource library and providing a solid foundation for subsequent work.
[0017] In one possible implementation, a target translation resource is determined based on a first target table and a third target table, including: determining updated third target values corresponding to a plurality of first target identifiers in the third target table; detecting whether a fourth target value exists in a position corresponding to the first target identifier in the first target table according to the first target identifier; if a fourth target value exists in a position corresponding to the first target identifier in the first target table, updating the fourth target value according to the third target value; if a fourth target value does not exist in a position corresponding to the first target identifier in the first target table, inserting the third target value into a position corresponding to the first target identifier in the first target table to determine the target translation resource.
[0018] The method for determining translation resources provided in this embodiment can accurately determine which data needs to be updated and which data is newly added by comparing the updated third target value in the third target table with the fourth target value in the first target table. This comparison method ensures the accuracy of data update and avoids data inconsistency problems caused by misoperation or omission. In addition, the entire process can be automated, greatly reducing the need for manual intervention. Automated processing not only improves the efficiency of data update, but also reduces the risk of human error.
[0019] In a second aspect, the present invention provides a device for determining translation resources, the device comprising: an acquisition module, used to acquire a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier; a first determination module, used to determine a second target value corresponding to each first target identifier from at least one translation resource file to be processed according to the plurality of first target identifiers, and write the first target identifier, the first target value, and the second target value into a first to-be-processed table to obtain a first target table; a second determination module, used to determine a missing result of at least one translation resource file to be processed based on a first target path and a second target path, and write the missing result into a second to-be-processed table to obtain a second target table; a correction module, used to correct the missing result in the second target table according to the first target table, the plurality of first target identifiers, and the first target value corresponding to each first target identifier to obtain a third target table; a third determination module, used to determine the target translation resource based on the first target table and the third target table.
[0020] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for determining translation resources of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0021] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for determining translation resources of the first aspect or any corresponding implementation manner thereof.
[0022] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for determining translation resources of the first aspect or any corresponding implementation manner thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 is a flow chart of a method for determining translation resources according to an embodiment of the present invention;
[0025] Figure 2 is a structural block diagram of a device for determining translation resources according to an embodiment of the present invention;
[0026] Figure 3 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0028] Based on relevant technologies, in order to ensure that the application can correctly display text information in different language environments, developers need to translate all string resources in the application into the target language. Currently, developers provide the strings.xml file in the default language directly to translators. Translators choose to convert the strings.xml file into an Excel spreadsheet. The Excel spreadsheet has an intuitive and easy-to-use interface in which translators can translate directly. After completing the translation, the developer converts the Excel spreadsheet back to the strings.xml file, thereby completing the internationalization of string resources.
[0029] However, during the manual recognition process, translators need to manually identify which character strings are new or modified, which increases the workload of obtaining translation resources and makes manual modification prone to errors.
[0030] The present invention provides a method for determining translation resources. Through a target dictionary, a plurality of first target identifiers and their corresponding first target values can be clearly defined and managed, and according to the first target identifier, the corresponding second target value, that is, the translated or localized content, can be accurately found from the translation resource file to be processed, thereby avoiding translation errors and omissions and improving the accuracy of translation. Then, according to the comparison of the first target path and the second target path, it can be determined whether there are missing translation contents in the translation resource file to be processed, and the missing results in the second target table can be corrected by using the first target table, the first target identifier and the first target value to obtain a complete third target table, thereby ensuring the integrity of the translation resources and reducing manual intervention and errors through the automation and standardization of translation work compared to the manual identification method of translators.
[0031] According to an embodiment of the present invention, an embodiment of a method for determining translation resources is provided. It should be noted that the steps shown in the flowchart of 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 can be executed in an order different from that shown here.
[0032] In this embodiment, a method for determining a translation resource is provided, which can be used in a computer device, such as a computer, a server, etc. Figure 1 is a flow chart of a method for determining translation resources according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0033] Step S101, obtaining a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier.
[0034] The target dictionary can be used to store and access key-value pairs. The target dictionary can store multiple first target identifiers and the first target value corresponding to each first target identifier. The target dictionary contains multiple key-value pairs, each of which consists of a first target identifier and a first target value. The first target identifier can be used to uniquely identify the key of each entry in the dictionary. It can be any type of identifier, such as a string, an integer, a floating point number, etc. The specific content of the first target identifier can depend on the application scenario. The first target identifier can be a user ID, a product number, the English corresponding to the translation in the Android mobile application development scenario (such as open_door), etc., which is not specifically limited here. The first target value can be a value stored in the dictionary associated with each first target identifier. It can be any type of data, such as a string, an integer, a floating point number, etc., which is not specifically limited here. For example: the key-value pair format is open_door: [open door], close_door: [close door].
[0035] Step S102, according to multiple first target identifiers, determine the second target value corresponding to each first target identifier from at least one pending translation resource file, and write the first target identifier, the first target value, and the second target value into the first pending table to obtain the first target table.
[0036] The translation resource file to be processed may contain translation resources to be processed, such as text, phrases, paragraphs, etc., and the translation resources in the translation resource file to be processed need to be translated. The second target value may represent the translation corresponding to each first target identifier found in the translation resource file to be processed. The second target value may be any type of data, such as a string, a number, a date, etc., depending on the nature of the translation resource.
[0037] Specifically, after determining multiple first target identifiers, each first target identifier can be traversed, that is, according to each first target identifier, the second target value corresponding to the first target identifier is determined from the translation resource file to be processed. For example: the first target identifier includes A and B, the first target value corresponding to A is K, the first target value corresponding to B is F, the second target value determined from the translation resource file to be processed according to A is M, and the second target value determined from the translation resource file to be processed according to B is N.
[0038] The first to-be-processed table is used to store the data under translation. It can be a spreadsheet, a database table, or any structure capable of storing and retrieving data. The first target table can represent a table with all translated resources.
[0039] Specifically, after determining the first target identifier, the first target value, and the second target value, the first target identifier, the first target value, and the second target value can be arranged in rows and columns and input into the first to-be-processed table to obtain the first target table. For example: traverse all the keys in the target dictionary, find the value corresponding to the key in other translation resources, and then insert it into the value corresponding to the key in the target dictionary. Example of the format of the key-value pair before and after insertion: before insertion: open_door: [open door]; after insertion: open_door: [open door, openDoor].
[0040] Step S103: determining the missing result of at least one to-be-processed translation resource file based on the first target path and the second target path, and writing the missing result into a second to-be-processed table to obtain a second target table.
[0041] The first target path can represent the path used to determine the complete translation resource. The second target path can represent the path of the translation resource file to be processed. Specifically, the complete translation resource can be determined according to the first target path, and then the translation resource file to be processed can be determined according to the second target path. If there are multiple translation resource files to be processed, there can be multiple second target paths, and each second target path corresponds to a translation resource file to be processed. Then, by comparing the translation resource file to be processed and the complete translation resource, the missing results in the translation resource file to be processed can be determined. Among them, the missing results are used to characterize which values corresponding to the first target identifier are missing in the translation resource file to be processed. For example: the translation resource file to be processed lacks the value of the first target identifier open_door, so this position needs to be recorded. The missing result can be that the first target identifier open_door is missing in the translation resource file to be processed X, etc. Then the missing results can be written into the second to-be-processed table to obtain the second target table.
[0042] Step S104, correcting the missing results in the second target table according to the first target table, multiple first target identifiers, and the first target value corresponding to each first target identifier to obtain a third target table.
[0043] After determining the missing results in the second target table, the missing results in the second target table are corrected according to the first target table, the multiple first target identifiers, and the first target value corresponding to each first target identifier to obtain a third target table.
[0044] As an example, traverse the missing records in the second target table. For each missing record, use the corresponding first target identifier to find a match in the first target table. If a match is found, replace the missing value in the second target table with the corresponding first target value in the first target table. Generate and save the modified third target table.
[0045] As an example, according to the first target identifier, all necessary first target values and their corresponding identifiers are extracted from the first target table. The batch update function of the database or data processing tool is used to replace the missing values in the second target table with the extracted first target values at one time. The modified third target table is generated and saved.
[0046] As an example, create a mapping table to record the first target identifier, the first target value, and their corresponding positions in the second target table (such as record ID). Traverse the mapping table and search for missing records in the second target table according to the first target identifier. If missing records are found, replace them with the corresponding first target value in the mapping table. Generate and save the revised third target table.
[0047] Step S105: determining a target translation resource based on the first target table and the third target table.
[0048] After the first target table and the third target table are determined, the first target table and the third target table may be integrated, and the resources in the integrated table may be determined as target translation resources.
[0049] The method for determining translation resources provided in this embodiment can clearly define and manage multiple first target identifiers and their corresponding first target values through a target dictionary, and can accurately find the corresponding second target value, that is, the translated or localized content, from the translation resource file to be processed based on the first target identifier, thereby avoiding translation errors and omissions and improving the accuracy of translation. Then, by comparing the first target path and the second target path, it can be determined whether there are missing translation contents in the translation resource file to be processed, and by using the first target table, the first target identifier and the first target value, the missing results in the second target table can be corrected to obtain a complete third target table, thereby ensuring the integrity of the translation resources and reducing manual intervention and errors through automation and standardization of translation work compared to the manual identification method performed by translators.
[0050] In a possible implementation, the step of determining the target dictionary includes:
[0051] Step a1, obtaining at least one translation resource file to be processed and a file identifier corresponding to the translation resource file to be processed.
[0052] Obtain the translation resource files to be processed from the system storing the translation resources, and assign or extract a unique file identifier for each file. Specifically, a script or program can be used to automatically scan a specific directory and extract the file name as the file identifier. The translation resource files and their corresponding file identifiers can also be queried from a database, which is not specifically limited here and can be implemented by those skilled in the art.
[0053] Step a2: determining a target translation resource file from at least one translation resource file to be processed according to the file identifier; wherein the target translation resource file includes: a plurality of first target identifiers and a first target value corresponding to each first target identifier.
[0054] The target translation resource file may represent a specific file selected from the pending translation resource files, and the file includes all first target identifiers. The file identifier may be used to uniquely identify each pending translation resource file, and may be a file name, an ID, etc., which are not specifically limited herein. Wherein, when there are multiple pending translation resource files, the target translation resource file may be determined from the multiple pending translation resource files according to the file identifier.
[0055] Step a3, writing a plurality of first target identifiers and a first target value corresponding to each first target identifier into an initial dictionary, and determining a target dictionary.
[0056] The initial dictionary can represent an empty dictionary structure or a dictionary structure containing initial data, which is used to store relevant information of the translation resource. A plurality of first target identifiers and a first target value corresponding to each first target identifier are extracted from the target translation resource file, and the information is written into the initial dictionary to form a target dictionary.
[0057] The method for determining the translation resources provided by the present embodiment can realize the systematic management and tracking of translation resources by distributing a unique file identifier to each pending translation resource file, ensure the accuracy and completeness of the translation resources, and avoid confusion and omission. In addition, the file identifier is used as a key index, so that the target translation resource file can be quickly and accurately screened out from a large number of pending translation resource files. This improves work efficiency and reduces the time and cost of manual screening. In addition, multiple first target identifiers and corresponding first target values are written into the initial dictionary, and finally determined as the target dictionary, which realizes the structured storage of data. This storage mode is convenient for the retrieval, updating and maintenance of data, and provides a solid foundation for subsequent translation work.
[0058] In a possible implementation, in the above step S102, the first target identifier, the first target value, and the second target value are written into the first to-be-processed table to obtain the first target table, including:
[0059] Step b1, according to the row direction of the first table to be processed, determine in sequence the first target position corresponding to the first target identifier, the second target position corresponding to the first target value, and the third target position corresponding to the second target value; wherein the first target position, the second target position, and the third target position are arranged in order from left to right.
[0060] The first target position can be a position reserved or specified for the first target identifier in the first pending table. This position can be a cell in the table, which is used to fill in or display the value of the first target identifier. The second target position can be a position reserved or specified for the first target value in the first pending table. This position can also be a cell in the table, which is immediately after the first target position (in order from left to right). The third target position can be a position reserved or specified for the second target value in the first pending table. This position can also be a cell in the table, which is located after the second target position (also in order from left to right).
[0061] According to the row direction of the first table to be processed (i.e., processing row by row from top to bottom), determine the specific positions of the first target identifier, the first target value, and the second target value of each translation resource item in the table. These positions are arranged from left to right, that is, the first target position is on the far left, followed by the second target position, and finally the third target position. For example: the first table to be processed has three columns, namely "ID" (first target identifier), "Source Text" (first target value), and "TargetText" (second target value). Then, for a row in the table, we can determine that the position of the "ID" column is the first target position, the position of the "Source Text" column is the second target position, and the position of the "Target Text" column is the third target position.
[0062] Step b2, writing the first target identifier, the first target value and the second target value into the first target position corresponding to the first target identifier, the second target position corresponding to the first target value and the third target position corresponding to the second target value respectively.
[0063] The first target identifier, the first target value and the second target value of each translation resource item are written into their corresponding target positions respectively. This process can be completed by some automated means (such as a script or program), which is not specifically limited here and can be implemented by those skilled in the art. For example: a translation resource item, whose ID is "001", the source language text is "Hello, world!", and the target language text is "Hola, mundo!". Then, in step b2, "001" is written into the first target position, "Hello, world!" is written into the second target position, and "Hola, mundo!" is written into the third target position.
[0064] The method for determining the translation resources provided by the present embodiment can clearly show the correlation between the first target identifier, the first target value, and the second target value by arranging the relevant information in the same row in a specific order (from left to right). This organization makes the data easy to understand and analyze. In addition, when the corresponding value of the specific first target identifier needs to be found, the row can be quickly located, and the first target value and the second target value can be found in the order from left to right. This arrangement reduces the retrieval time and improves work efficiency.
[0065] In a possible implementation, the above step S103 includes:
[0066] Step c1, determining a target translation resource file according to the first target path.
[0067] You can use a file management system or database query tool to automatically search and locate the target file based on the path or identifier. If the path is a URL or network location, use a web browser or download tool to access and obtain the target file. For example: the first target path is " / translations / english_to_spanish / document1,xlsx", then the target translation resource file can be an Excel file located under this path.
[0068] Step c2: determining, according to the second target path, a target to-be-processed translation resource file corresponding to the second target path in at least one to-be-processed translation resource file.
[0069] You can use a script or program to automatically search and select target files based on the path or identifier. If the path is a directory or folder, all files in the directory or folder are selected as target files. For example, if the second target path is " / translations / to_be_checked / ", the target translation resource files to be processed may be all translation files in the directory.
[0070] Step c3, comparing the target translation resource file and the target translation resource file to be processed, and determining the missing target identifier and the missing value corresponding to the missing target identifier in the target translation resource file to be processed.
[0071] The missing target identifier may represent a missing field or data item for uniquely identifying a translation resource item in the target translation resource file compared to the target translation resource file. The target translation resource file and the target translation resource file to be processed are compared to find the missing target identifier and its corresponding missing value in the target translation resource file to be processed.
[0072] Specifically, it is necessary to read the entire contents of the target translation resource file and the target pending translation resource file. This can be done by parsing the file format (such as Excel, CSV, database table, etc.) and extracting the data fields that need to be compared. Next, compare the "target identifier" field in the two files. The target identifier is a field used to uniquely identify a translation resource item, such as an ID, file name, paragraph number, etc. In the target pending translation resource file, look for target identifiers that do not exist in the target translation resource file. These missing target identifiers and their corresponding missing values (such as missing translation texts) are key information that need to be recorded.
[0073] Step c4, write the missing target identifier and the missing value corresponding to the missing target identifier into the second to-be-processed table to obtain a second target table.
[0074] The missing target identifier and the missing value determined in step c3 are written into the second to-be-processed table to obtain a second target table containing all missing information. For example, if the second to-be-processed table is an Excel file, a new column can be created to record the missing target identifier and the missing value can be recorded in an adjacent column. Then, this information is written into the second target table for subsequent processing or analysis.
[0075] The method for determining translation resources provided in this embodiment can accurately locate the target translation resource file and the corresponding translation resource file to be processed through the first target path and the second target path, avoiding the tediousness and errors of manual search and improving work efficiency. In addition, by comparing the target translation resource file and the translation resource file to be processed, the target identifier missing in the to-be-processed file and its corresponding missing value can be quickly found. Then, the missing target identifier and the corresponding missing value are written into the second to-be-processed table to obtain the second target table. This structured recording method makes the missing information clearer, easier to understand and analyze. At the same time, it also provides convenience for subsequent repair and supplement work.
[0076] In a possible implementation, the above step S104 includes:
[0077] Step d1, compare the missing results in the second target table with the first target table, and detect whether the missing results are value update results; wherein the value update result is used to indicate that there is a value corresponding to the first target identifier in the missing result, and the value corresponding to the first target identifier is different from the value corresponding to the first identifier in the first target table.
[0078] The value update result is used to indicate that there is a value corresponding to the first target identifier in the missing result, and the value corresponding to the first target identifier is different from the value corresponding to the first identifier in the first target table, that is, there is a value corresponding to the first target identifier in the first target table, and then there is a value corresponding to the first target in the missing result. It is necessary to detect whether the missing result is a value update result.
[0079] Step d2: If the missing result is a value update result, the value corresponding to the first target identifier in the missing result is updated according to the value corresponding to the first identifier in the first target table.
[0080] If the missing result is a value update result, the value corresponding to the first target identifier in the missing result can be overwritten according to the value corresponding to the first identifier in the first target table. For example, if there is a value J corresponding to the first target identifier in the first target table, and there is also a value U corresponding to the first target in the missing result, then J can overwrite U.
[0081] Step d3: If the missing result is not an updated result, the missing position corresponding to the first target identifier in the missing result is supplemented according to the first target value corresponding to the first target identifier.
[0082] If the missing result is not an updated result, it indicates that the missing result is empty, and then the first target value corresponding to the first target identifier needs to be added to the position where the missing result is empty.
[0083] The method for determining translation resources provided in this embodiment can accurately identify which missing results are caused by value updates by comparing the missing results in the second target table with the first target table. This helps to distinguish between real missing values (i.e., content that needs to be added) and existing values that may have been changed, thereby avoiding unnecessary duplication of work or data overwriting. At the same time, for missing values that are not updated results, they are supplemented according to the first target value corresponding to the first target identifier, ensuring the integrity and accuracy of the data, thereby building a comprehensive translation resource library and providing a solid foundation for subsequent work.
[0084] In a possible implementation, the above step S105 includes:
[0085] Step e1, determining updated third target values respectively corresponding to a plurality of first target identifiers in the third target table.
[0086] In the process of the above steps d1-d3, the missing results in the second target table have been supplemented and updated to obtain the third target table. Then, the updated third target values corresponding to the multiple first target identifiers in the third target table can be determined from the third target table.
[0087] Step e2: Detect, based on the first target identifier, whether there is a fourth target value in the position corresponding to the first target identifier in the first target table.
[0088] Step e3, if a fourth target value exists in the position corresponding to the first target identifier in the first target table, the fourth target value is updated according to the third target value;
[0089] Step e4: if the fourth target value does not exist at the position corresponding to the first target identifier in the first target table, insert the third target value into the position corresponding to the first target identifier in the first target table to determine the target translation resource.
[0090] There are vacancies in the first target table, that is, the second target value corresponding to the first target identifier in the first target table may be empty. Therefore, it is necessary to detect whether there is a fourth target value in the position corresponding to the first target identifier in the first target table according to the first target identifier. Among them, when the fourth target value does not exist in the position corresponding to the first target identifier in the first target table, it indicates that the position is empty, then it is necessary to find the value corresponding to the empty position from the third target table, and then fill in the value.
[0091] The method for determining translation resources provided in this embodiment can accurately determine which data needs to be updated and which data is newly added by comparing the updated third target value in the third target table with the fourth target value in the first target table. This comparison method ensures the accuracy of data update and avoids data inconsistency problems caused by misoperation or omission. In addition, the entire process can be automated, greatly reducing the need for manual intervention. Automated processing not only improves the efficiency of data update, but also reduces the risk of human error.
[0092] In the present embodiment, a device for determining translation resources is also provided, and the device is used to implement the above-mentioned embodiment and the preferred implementation mode, and the description thereof will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the device described in the following embodiments is preferably implemented with software, the implementation of hardware, or a combination of software and hardware is also possible and contemplated.
[0093] This embodiment provides a translation resource determination device, such as Figure 2 As shown, including:
[0094] The acquisition module 201 is used to acquire a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier;
[0095] A first determination module 202 is used to determine, according to the multiple first target identifiers, a second target value corresponding to each first target identifier from at least one to-be-processed translation resource file, and write the first target identifier, the first target value, and the second target value into a first to-be-processed table to obtain a first target table;
[0096] A second determination module 203 is used to determine the missing result of at least one pending translation resource file based on the first target path and the second target path, and write the missing result into a second pending table to obtain a second target table;
[0097] A correction module 204, configured to correct missing results in the second target table according to the first target table, the plurality of first target identifiers, and the first target value corresponding to each first target identifier, to obtain a third target table;
[0098] The third determination module 205 is used to determine the target translation resource based on the first target table and the third target table.
[0099] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0100] The translation resource determination device in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0101] The embodiment of the present invention also provides a computer device having the above Figure 2 The translation resource determination device shown.
[0102] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.
[0103] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0104] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0105] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0106] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0107] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0108] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0109] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0110] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for determining translation resources, characterized in that: The method comprises: Obtain a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier; According to the multiple first target identifiers, determining a second target value corresponding to each first target identifier from at least one pending translation resource file, and writing the first target identifier, the first target value, and the second target value into a first pending table to obtain a first target table; Based on the first target path and the second target path, determining the missing result of at least one to-be-processed translation resource file, and writing the missing result into a second to-be-processed table to obtain a second target table; Correct the missing results in the second target table according to the first target table, the plurality of the first target identifiers, and the first target value corresponding to each of the first target identifiers to obtain a third target table; A target translation resource is determined based on the first target table and the third target table.
2. The method for determining translation resources according to claim 1, characterized in that: The steps for determining the target dictionary include: Obtaining at least one translation resource file to be processed and a file identifier corresponding to the translation resource file to be processed; According to the file identifier, determining a target translation resource file from at least one translation resource file to be processed; wherein the target translation resource file comprises: a plurality of first target identifiers and a first target value corresponding to each first target identifier; The target dictionary is determined by writing a plurality of the first target identifiers and a first target value corresponding to each of the first target identifiers into an initial dictionary.
3. The method for determining translation resources according to claim 1, characterized in that: The step of writing the first target identifier, the first target value, and the second target value into a first to-be-processed table to obtain a first target table includes: According to the row direction of the first to-be-processed table, a first target position corresponding to the first target identifier, a second target position corresponding to the first target value, and a third target position corresponding to the second target value are sequentially determined; wherein the first target position, the second target position, and the third target position are arranged in order from left to right; The first target identifier, the first target value and the second target value are respectively written into a first target position corresponding to the first target identifier, a second target position corresponding to the first target value and a third target position corresponding to the second target value.
4. The method for determining translation resources according to claim 1, characterized in that: The method of determining the missing result of at least one to-be-processed translation resource file based on the first target path and the second target path, and writing the missing result into the second to-be-processed table to obtain the second target table, comprises: Determining a target translation resource file according to the first target path; Determine, according to the second target path, a target to-be-processed translation resource file corresponding to the second target path in at least one to-be-processed translation resource file; Compare the target translation resource file with the target translation resource file to be processed, and determine the missing target identifier and the missing value corresponding to the missing target identifier in the target translation resource file to be processed; The missing target identifier and the missing value corresponding to the missing target identifier are written into the second to-be-processed table to obtain a second target table.
5. The method for determining translation resources according to claim 1, characterized in that: The step of correcting missing results in the second target table according to the first target table, the plurality of first target identifiers, and the first target value corresponding to each of the first target identifiers to obtain a third target table includes: Compare the missing result in the second target table with the first target table to detect whether the missing result is a value update result; wherein the value update result is used to indicate that a value corresponding to the first target identifier exists in the missing result, and the value corresponding to the first target identifier is different from the value corresponding to the first identifier in the first target table; If the missing result is a value update result, updating the value corresponding to the first target identifier in the missing result according to the value corresponding to the first identifier in the first target table; If the missing result is not an updated result, the missing position corresponding to the first target identifier in the missing result is supplemented according to the first target value corresponding to the first target identifier.
6. The method for determining translation resources according to claim 4, characterized in that: The determining of the target translation resource based on the first target table and the third target table includes: Determine updated third target values respectively corresponding to the plurality of first target identifiers in the third target table; Detecting, according to the first target identifier, whether there is a fourth target value in the position corresponding to the first target identifier in the first target table; If a fourth target value exists in the position corresponding to the first target identifier in the first target table, updating the fourth target value according to the third target value; If the fourth target value does not exist in the position corresponding to the first target identifier in the first target table, the third target value is inserted into the position corresponding to the first target identifier in the first target table to determine the target translation resource.
7. A translation resource determination device, characterized in that: The device comprises: An acquisition module, used for acquiring a target dictionary; wherein the target dictionary stores a plurality of first target identifiers and a first target value corresponding to each first target identifier; A first determination module is used to determine, according to the multiple first target identifiers, a second target value corresponding to each first target identifier from at least one to-be-processed translation resource file, and write the first target identifier, the first target value, and the second target value into a first to-be-processed table to obtain a first target table; A second determination module is used to determine the missing result of at least one pending translation resource file based on the first target path and the second target path, and write the missing result into a second pending table to obtain a second target table; a correction module, configured to correct missing results in the second target table according to the first target table, a plurality of the first target identifiers, and a first target value corresponding to each of the first target identifiers, so as to obtain a third target table; The third determination module is used to determine a target translation resource based on the first target table and the third target table.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method for determining translation resources according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for determining a translation resource according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method for determining a translation resource according to any one of claims 1 to 6.