Translation copywriting verification method, electronic equipment and readable storage medium

A verification method and copywriting technology, applied in the computer field, can solve the problems of low accuracy and efficiency, and achieve the effect of improving accuracy and efficiency

Pending Publication Date: 2021-06-04
TENCENT MUSIC ENTERTAINMENT TECH SHENZHEN CO LTD
5 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

In the related technology, the accuracy and efficiency of the ve...
View more

Abstract

The invention discloses a translation copywriting verification method, electronic equipment and a computer readable storage medium, and the method comprises the steps of obtaining a reference translation copywriting of a target application project from a translation platform in a test process of the target application project, wherein the benchmark translation copywriting comprises copywriting identifiers and benchmark translations corresponding to all copywriting needing to be displayed by the target application project; obtaining a target copywriting in a copywriting library of the target application project and a corresponding target copywriting identifier, and judging whether a copywriting identifier corresponding to the target copywriting identifier exists in the reference translation copywriting or not; and if yes, determining a target reference translation corresponding to the target copywriting identifier in the reference translation copywriting, and comparing the target copywriting with the target reference translation to obtain a verification result of the target copywriting. Therefore, compared with a manual verification mode, the translation copywriting verification method provided by the invention has the advantage that the accuracy and efficiency of translation copywriting verification are improved.

Application Domain

Natural language translation

Technology Topic

CopywritingProgramming language +3

Image

  • Translation copywriting verification method, electronic equipment and readable storage medium
  • Translation copywriting verification method, electronic equipment and readable storage medium
  • Translation copywriting verification method, electronic equipment and readable storage medium

Examples

  • Experimental program(1)

Example Embodiment

[0023] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0024] In order to facilitate the understanding of the translation text verification method provided by this application, the system used for the verification method is introduced below. see figure 1 , which shows an architecture diagram of a translation text verification system provided by an embodiment of the present application, such as figure 1 As shown, a client 10, a server 20 and a translation platform 30 are included.
[0025] The client 10 may include fixed terminals such as PC (full name in Chinese: personal computer, full name in English: Personal Computer) and mobile terminals such as mobile phones. The user can input the code path of the target application project and the platform link of the translation platform 30 through the client terminal 10. The terminal 10 sends it to the server 20, so that the server 10 obtains the target copy in the copy library of the target application project based on the code path of the target application project, and obtains the benchmark translation of the target application project from the translation platform 30 based on the platform link of the translation platform 30 copy. At the same time, the client terminal 10 is also used for displaying the verification result.
[0026] The steps that the server 20 is configured to execute the translation text verification method include: during the test process of the target application project, acquiring the benchmark translation text of the target application project from the translation platform; wherein, the benchmark translation text includes the target application Copy text identifiers and benchmark translations corresponding to all texts that the project needs to display; obtain the target text and the corresponding target text identifiers in the text library of the target application project, and determine whether there is a target copy identifier in the benchmark translation text If yes, determine the target benchmark translation corresponding to the target text ID in the benchmark translation text, and obtain the verification result of the target text by comparing the target text and the target benchmark translation. It can be understood that the steps of the above translation text verification method can be encapsulated as a python script, and the server 20 implements the above translation text verification method by executing the python script.
[0027] The translation platform 30 is configured to provide a corresponding reference translation copy for the target copy in the copy library of the target application project.
[0028] The embodiment of the present application discloses a translation text verification method, which improves the accuracy and efficiency of translation text verification.
[0029] see figure 2 , a flowchart of a translation text verification method provided in the embodiment of the present application, such as figure 2 shown, including:
[0030] S101: During the testing process of the target application project, obtain the benchmark translation text of the target application project from the translation platform; wherein, the benchmark translation text includes the text identifiers and benchmark translations corresponding to all the texts to be displayed by the target application project ;
[0031] The execution body of this embodiment may be the server in the above translation text verification system, and the purpose is to perform translation verification on the target text in the text library of the target application project during the testing process of the target application project. In this step, the benchmark translation text of the target application project is obtained from the translation platform, and is preprocessed and then cached, specifically, stored in the form of the correspondence between the text ID and the benchmark translation.
[0032] As a preferred embodiment, after this step, the method further includes: caching the reference translation text in the form of a key-value pair; wherein, using the copy text identifier corresponding to the copy text as a key, and using the reference text corresponding to the copy text as a key translate as value. In a specific implementation, the reference translation text may be cached in the form of a key-value pair key-value, where the key is the ID of the text and the value is the corresponding reference translation. More preferably, the language of the copy can be used as the dimension for caching. For example, language1 includes key1-value1, key2-value2, ..., keyN1-valueN1, and language2 includes key1-value1, key2-value2, ..., keyN2-valueN2, ... , languageM includes key1-value1, key2-value2, ..., keyNM-valueNM.
[0033] S102: Acquire the target copy and the corresponding target copy identifier in the copy library of the target application project, and determine whether there is a copy identifier corresponding to the target copy identifier in the reference translation copy; if so, go to S103;
[0034] In a specific implementation, first, the target copy and the corresponding target copy in the copy library of the target application project are acquired, and cached after preprocessing. As a preferred embodiment, after this step, it further includes: caching the target copy and the corresponding target copy identifier in the form of a key-value pair; wherein, using the target copy identifier as a key, using the target copy identifier as a key Copy as value. In a specific implementation, the target copy can also be cached in the form of a key-value pair key-value, wherein the key is the ID of the target copy, and the value is the corresponding target copy. More preferably, the cache can also be based on the language of the copy. For example, applanguage1 includes appkey1-appvalue1, appkey2-appvalue2, ..., appkeyN1-appvalueN1, and applanguage2 includes appkey1-appvalue1, appkey2-appvalue2, ..., appkeyN2-appvalueN2, ..., applanguageM includes appkey1-appvalue1, appkey2-appvalue2, ..., appkeyNM-appvalueNM.
[0035]Next, for each target copy ID, traverse the reference translation copy respectively, and determine whether the target copy ID exists in the reference translation copy, that is, for each appkey, determine whether there is key=appkey, and if so, go to S103 to carry out Verification of translations.
[0036] S103: Determine a target benchmark translation corresponding to the target text identifier in the benchmark translation text, and obtain a verification result of the target text by comparing the target text and the target benchmark translation.
[0037] In this step, translation verification is performed on the target text by comparing the target text corresponding to the target text identifier in the text library with the target benchmark translation corresponding to the benchmark translation text. Specifically, it is compared whether the target copy and the target benchmark translation are consistent, and if they are inconsistent, the target copy is determined as the translation error copy, including the copy with illegal format placeholders.
[0038] As a preferred embodiment, after this step, it further includes: determining the language of the translation error copy, and adding the translation error copy to the translation error copy list corresponding to the language; using the language as a key, the corresponding A list of translation errors as a value, the translation errors are cached in the form of key-value pairs. In the specific implementation, the translation error copy can be stored and displayed in the dimension of language, that is, a corresponding translation error copy list is created for different languages, and the translation error copy is formed by using the language as the key and the corresponding translation error copy list as the value. The dictionary is cached. Of course, the translation error copy dictionary in the cache can also be persisted in the form of json and displayed when the user needs it.
[0039] The translation text verification method provided by the embodiment of the present application extracts the target text from the text library of the application project, and realizes the translation verification of the target text by comparing the target text with the reference translation text obtained from the translation platform. It can be seen that, compared with the manual verification method, the translation text verification method provided by the embodiment of the present application improves the accuracy and efficiency of translation text verification.
[0040] On the basis of the above embodiment, as a preferred implementation, it further includes: according to the rules for referencing translation texts of the target application project, defining a corresponding legal reference regular expression; determining in the source code file of the target application project Legally cited translations that conform to the legalized citation regular expression and corresponding legalized cited translations identifiers; and the legally cited translations corresponding to the legalized cited translated identifiers that do not exist in the reference translations are determined as untranslated texts.
[0041] It is understandable that there are different rules for citing translated texts for application projects in different languages. Therefore, when determining the untranslated copy, firstly, according to the rules of citing the translated copy of the target application project, define the corresponding regular expression of legal reference, so as to find the legal reference translation copy in the source code file of the target application project, and cache it. It should be noted that the caching mode of the legal reference translation text is similar to the caching mode of the reference translation text and the target text introduced in the above-mentioned embodiment, and will not be repeated here.
[0042] Secondly, for each legal reference translation text ID, traverse the reference translation text respectively to determine whether the legal reference translation text ID exists in the reference translation text, and if not, determine the corresponding legal reference translation text as untranslated copy. It can be understood that the storage and display manner of the untranslated copy is similar to the storage and display manner of the translation error copy introduced in the foregoing embodiment, and details are not described herein again.
[0043] It can be seen that this embodiment realizes the output of untranslated text.
[0044] On the basis of the above embodiment, as a preferred implementation, it further includes: defining a corresponding illegal reference regular expression according to the rules for referencing translation texts of the target application project; determining in the source code file of the target application project Illegal quote translations that match the illegal quote regular expression.
[0045] In a specific implementation, according to the rules for referencing translation texts of the target application project, a corresponding illegal referencing regular expression is defined, so as to find the illegally referencing translation texts in the source code file of the target application project, and cache them. Understandably, scrap copy can be stored and displayed in the form of a list.
[0046] It can be seen from this that this embodiment implements the output of illegally quoted translated texts.
[0047] On the basis of the above embodiment, as a preferred implementation, it further includes: if there is no copy ID corresponding to the target copy ID in the reference translation text, judging whether there is a copy ID that is the same as the target copy ID Legally quote the translated copy ID; if not, determine the target copy as an abandoned copy.
[0048] In the specific implementation, for a target copy ID, if the traversal fails in the reference translation copy, the traversal is performed in the legal reference translation copy ID, that is, it is judged whether there is a legal reference translation copy ID that is the same as the target copy ID, and if so, It means that it is an illegal quoted translation text, if not, it means that it is an abandoned text. Understandably, scrap copy can be stored and displayed in the form of a list.
[0049] It can be seen from this that this embodiment realizes the output of discarded copy.
[0050] The embodiment of the present application discloses a translation text verification method. Compared with the previous embodiments, the present embodiment further describes and optimizes the technical solution. specific:
[0051] see image 3 , a flowchart of another translation text verification method provided in the embodiment of the present application, such as image 3 shown, including:
[0052] S201: During the test process of the target application project, obtain the benchmark translation text of the target application project from the translation platform; wherein, the benchmark translation text includes the text identifiers and benchmark translations corresponding to all texts to be displayed by the target application project ;
[0053] S202: Define a corresponding legal reference regular expression according to the rules for citing translation texts of the target application project;
[0054] S203: Determine, in the source code file of the target application project, a legal citation translation and a corresponding legal citation translation identifier that conforms to the legal citation regular expression;
[0055] S204: Determine the legal reference translation text and the corresponding legal reference translation text identifier as the target text and the corresponding target text identifier;
[0056] S205: Determine whether there is a copy ID corresponding to the target copy ID in the reference translation copy; if so, go to S206;
[0057] S206: Determine the target benchmark translation corresponding to the target text identifier in the benchmark translation text, and compare whether the target text is consistent with the target benchmark translation; if not, determine the target text as a translation error copy .
[0058] In this embodiment, in order to improve the verification efficiency, the legal reference translation text can be directly determined as the target text, that is, the verification of the illegal reference translation text is skipped, and only the translation of the legal reference translation text is checked to see if the translation is wrong. Quickly identify translation errors.
[0059] An application embodiment provided by the present application is introduced below. For details, please refer to Figure 4 , read the benchmark translation text entered by the product/operation from the translation platform through a python script, and then save all the benchmark translation text in each language in the cache in the form of key-value, that is Figure 4 language1-languageN in , this step is integrated into the daily pipeline construction of project engineering DevOps.
[0060] According to the rules used when referencing the translated copy in the project, define the corresponding regular expression re1 for legal reference, then traverse each source code file in the project through the python script, and extract the copy that conforms to the regular matching rule re1 in the form of ID List stored in cache. At the same time, all the texts in each language are stored in the cache in the form of key-value, that is, Figure 4 applanguage1-applanguageN in .
[0061] Take language1-languageN as the matching set, and loop through the IDs in the List. If no key with the same ID is found after the traversal, the text corresponding to the ID is an untranslated text, and it is added to the corresponding language untranslated The list of texts is then saved in the local file file1 in the form of json.
[0062] According to the rules used for citing translation texts in the project, define the corresponding regular matching expression re2 for illegal references, and then traverse each source code file in the project project through the python script, and extract the text that conforms to the regular matching rule re2 in the form of json Saved in the local file file2.
[0063] Loop through language1-languageN and applanguage1-applanguageN. If key=appkey, compare whether the corresponding value and appvalue are the same. If they are not the same, it means that the copy and the benchmark translation are inconsistent, and the format placeholder is illegal in this step. It can also be detected and saved in the local file file3 in the form of json.
[0064] A translation text verification device provided by an embodiment of the present application is introduced below. The translation text verification device described below and the translation text verification method described above can be referred to each other.
[0065] see Figure 5 , the structure diagram of a translation text verification device provided by the embodiment of the present application, such as Figure 5 shown, including:
[0066] The acquiring module 501 is configured to acquire, during the testing process of the target application project, the benchmark translation text of the target application project from the translation platform; wherein the benchmark translation text includes the text corresponding to all the texts that need to be displayed by the target application project logo and benchmark translation;
[0067] The first judgment module 502 is configured to obtain the target copy and the corresponding target copy ID in the copy library of the target application project, and judge whether there is a copy ID corresponding to the target copy ID in the reference translation copy; , then start the workflow of the comparison module 503;
[0068] The comparison module 503 is configured to determine a target benchmark translation corresponding to the target text identifier in the benchmark translation text, and obtain a verification result of the target text by comparing the target text and the target benchmark translation.
[0069] The translation text verification device provided by the embodiment of the present application extracts the target text from the text library of the application project, and realizes the translation verification of the target text by comparing the target text with the reference translation text obtained from the translation platform. It can be seen that, compared with the manual verification method, the translation text verification device provided by the embodiment of the present application improves the accuracy and efficiency of translation text verification.
[0070] On the basis of the above embodiment, as a preferred implementation, it also includes:
[0071] The first definition module is used to define the corresponding legal reference regular expression according to the rule of citing the translation text according to the target application project;
[0072]a first determining module, configured to determine, in the source code file of the target application project, a legal citation translation that conforms to the legal quoting regular expression and a corresponding legal citation translation identifier;
[0073] The second determination module is configured to determine the legal reference translation text corresponding to the legal reference translation text identifier that does not exist in the reference translation text as an untranslated text.
[0074] On the basis of the above embodiment, as a preferred implementation, it also includes:
[0075] The second judging module is used to judge whether there is a legal reference translation copy identifier that is the same as the target copy identifier when there is no copy identifier corresponding to the target copy identifier in the reference translation copy; if not, start the The third determines the workflow of the module;
[0076] The third determination module is configured to determine the target copy as an abandoned copy.
[0077] On the basis of the above embodiment, as a preferred implementation, it also includes:
[0078] The second definition module is used to define the corresponding illegal reference regular expression according to the rule of citing the translation text according to the target application project;
[0079] The fourth determining module is configured to determine, in the source code file of the target application project, an illegally quoted translation copy that conforms to the illegally quoted regular expression.
[0080] On the basis of the above embodiment, as a preferred implementation manner, the first judgment module 502 includes:
[0081] A definition unit, used for quoting the rules of translation text according to the target application project, and defining a corresponding legal quoting regular expression;
[0082] a first determining unit, configured to determine, in the source code file of the target application project, a legal citation translation that conforms to the legal quoting regular expression and a corresponding legal citation translation identifier;
[0083] a second determining unit, configured to determine the legal citation translation and the corresponding legal citing translation identifier as the target copy and the corresponding target copy identifier;
[0084] The judgment unit is used for judging whether there is a copy ID corresponding to the target copy ID in the reference translation copy; if so, start the work flow of the comparison module 503 .
[0085] On the basis of the above embodiment, as a preferred implementation, it also includes:
[0086] a first caching module, configured to cache the reference translation text in the form of a key-value pair; wherein the reference text corresponding to the copy text is used as a key, and the reference translation corresponding to the copy text is used as a value;
[0087] The second caching module is configured to cache the target copy and the corresponding target copy identifier in the form of a key-value pair; wherein, the target copy identifier is used as a key, and the target copy is used as a value.
[0088] On the basis of the above embodiment, as a preferred implementation manner, the comparison module 503 includes:
[0089] A comparison unit, used to compare whether the target copy is consistent with the target benchmark translation; if not, start the workflow of the third determination unit;
[0090] a third determining unit, configured to determine the target copy as a translation error copy;
[0091] The adding unit is used to determine the language of the translation error copy, and add the translation error copy to the translation error copy list corresponding to the language;
[0092] The caching unit is configured to use the language as a key and the corresponding translation error copy list as a value, and cache the translation error copy in the form of a key-value pair.
[0093] Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
[0094] The present application also provides an electronic device, see Image 6 , a structural diagram of an electronic device 60 provided by an embodiment of the present application, such as Image 6 As shown, a processor 61 and a memory 62 may be included.
[0095] The processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 61 may adopt at least one hardware form among DSP (Digital Signal Processing, digital signal processing), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array, programmable logic array) accomplish. The processor 61 may also include a main processor and a co-processor. The main processor is a processor used to process data in the wake-up state, and is also called a CPU (Central Processing Unit, central processing unit); A low-power processor for processing data in a standby state. In some embodiments, the processor 61 may be integrated with a GPU (Graphics Processing Unit, image processor), and the GPU is used for rendering and drawing the content that needs to be displayed on the display screen. In some embodiments, the processor 61 may further include an AI (Artificial Intelligence, artificial intelligence) processor, where the AI ​​processor is used to process computing operations related to machine learning.
[0096] Memory 62 may include one or more computer-readable storage media, which may be non-transitory. Memory 62 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash storage devices. In this embodiment, the memory 62 is used to store at least the following computer program 621, wherein, after the computer program is loaded and executed by the processor 61, the translation text verification method disclosed in any of the foregoing embodiments and executed by the electronic device side can be implemented related steps in . In addition, the resources stored in the memory 62 may also include an operating system 622, data 623, etc., and the storage mode may be short-term storage or permanent storage. The operating system 622 may include Windows, Unix, Linux, and the like.
[0097] In some embodiments, the electronic device 60 may further include a display screen 63 , an input/output interface 64 , a communication interface 65 , a sensor 66 , a power supply 67 and a communication bus 68 .
[0098] certainly, Image 6 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiments of the present application. In practical applications, the electronic device may include more Image 6 more or less components shown, or some combination of components.
[0099] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the translation text verification method executed by the electronic device in any of the foregoing embodiments are implemented. .
[0100] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant part can be referred to the description of the method. It should be pointed out that for those of ordinary skill in the art, without departing from the principles of the present application, several improvements and modifications can also be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.
[0101] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is no such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Classification and recommendation of technical efficacy words

Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products