Method and apparatus for translating application programs
The method and apparatus address the issue of incorrect time information formatting in translated applications by detecting and translating time information based on language-specific attributes, ensuring accurate presentation.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- DOUYIN VISION CO LTD
- Filing Date
- 2022-09-19
- Publication Date
- 2026-04-28
AI Technical Summary
Existing methods for translating application programs fail to accurately account for the varying presentation rules of time information across different languages, leading to incorrect formatting of time information in translated applications.
A method and apparatus that detect time information in an application program, obtain attribute information such as target language, time units, and data digits, determine a presentation format using a pre-configured algorithm, and translate the time information accordingly based on this format.
Ensures accurate translation of time information by aligning it with the presentation rules of the target language, reducing errors in the formatting of time information in translated applications.
Smart Images

Figure 0007853408000005 
Figure 0007853408000006 
Figure 0007853408000007
Abstract
Description
Technical Field
[0001] This application claims priority based on a Chinese application with an application number of 202111130160.4 and a filing date of September 26, 2021, and the disclosure content of this Chinese application is hereby incorporated into this application in its entirety.
[0002] This disclosure relates to the field of information processing technology, and particularly to a method and apparatus for translating application programs.
Background Art
[0003] With the increasing development of internationalization, the phenomenon that the same application program (APP) provides services to users in various languages is becoming more and more common. In order for the application program to provide better services to users, it is often necessary to translate the content in the application program into various languages.
[0004] Time information is information that generally exists in application programs. When it is necessary to translate an application program into an application program in the target translation language, the time information in the application program also needs to be presented using the presentation rules of the target translation language. In the related art, when translating an application program, the time information in the application program is translated as text, and the presentation format of the translated time information is set based on the developer's own understanding of the presentation rules of the time information in the target translation language.
Summary of the Invention
Problems to be Solved by the Invention
[0005] Embodiments of this disclosure provide a method and apparatus for translating application programs. The technical solutions according to the embodiments of this disclosure are as follows.
Means for Solving the Problems
[0006] According to a first aspect, embodiments of the present disclosure provide a method for translating an application program, the method being: Detecting time information in the application program to be translated, The method of obtaining attribute information of the aforementioned time information, wherein the attribute information includes at least one of the following: the target language for translation of the aforementioned time information, the time units included in the aforementioned time information, and the number of data digits for each time unit of the aforementioned time information. Obtaining the presentation format based on the aforementioned attribute information, This includes translating the time information based on the aforementioned presentation format.
[0007] As an optional embodiment of the embodiments of this disclosure, determining the presentation format based on the attribute information is: Obtaining a format identifier based on the aforementioned attribute information, This includes determining the presentation format based on the format identifier and a profile that includes the correspondence between the format identifier and the presentation format.
[0008] As an optional embodiment of the embodiments of this disclosure, obtaining the format identifier based on the attribute information is: The process involves calculating the attribute information based on a pre-configured algorithm and obtaining a target calculated value. This includes obtaining the format identifier based on the target calculated value.
[0009] As an optional embodiment of the embodiments of this disclosure, the pre-configured algorithm is either the message digest algorithm MD5 or a hash algorithm.
[0010] As an optional embodiment of the embodiments of this disclosure, detecting time information in an application program to be translated is: This includes performing regular matching on a string in the application program to be translated, and determining the string that matches the target regular expression in the application program to be translated as the time information in the application program to be translated.
[0011] As an optional embodiment of the embodiments of this disclosure, before regular matching of the string in the application program to be translated, the method The process further includes obtaining the target regular expression based on the current language of the application program to be translated.
[0012] As an optional embodiment of the embodiments of this disclosure, translating the time information based on the presentation format is: Based on the aforementioned presentation format, the method includes setting at least one of the following: the time units included in the translated time information, the order in which each time unit of the translated time information is arranged, the number of digits in each time unit of the translated time information, and whether or not multiple time units are used for each time unit of the translated time information.
[0013] According to a second aspect, an embodiment of the present disclosure provides an application program translation device, which is capable of translating an application program. A detection unit for detecting time information in the application program to be translated, An acquisition unit for acquiring attribute information of the aforementioned time information, wherein the attribute information includes at least one of the following: the translation target language of the time information, the time units included in the time information, and the number of data digits for each time unit of the time information; A processing unit for determining the presentation format based on the attribute information, Includes a translation unit for translating the time information based on the presentation format.
[0014] In an optional embodiment of the embodiments of this disclosure, the processing unit is specifically used to obtain a format identifier based on the attribute information and to determine the presentation format based on the format identifier and profile. Here, the profile includes the correspondence between the format identifier and the presented format.
[0015] In an optional embodiment of the embodiments of the present disclosure, the processing unit is used to calculate on the attribute information based on a specific pre-configured algorithm, to obtain a target calculated value, and to obtain the format identifier based on the target calculated value.
[0016] As an optional embodiment of the embodiments of this disclosure, the pre-configured algorithm is either the message digest algorithm MD5 or a hash algorithm.
[0017] In an optional embodiment of the embodiments of the present disclosure, the detection unit is specifically used to perform regular matching on strings in the application program to be translated and to determine the strings that match the target regular representation in the application program to be translated as time information in the application program to be translated.
[0018] In an optional embodiment of the embodiments of the present disclosure, the detection unit is further used to obtain the target regular representation based on the current language of the application program to be translated, before regular matching of the string in the application program to be translated.
[0019] As a selectable embodiment of the embodiments of the present disclosure, the translation unit is specifically used to set at least one of the time unit included in the translated time information, the order of arrangement of each time unit of the translated time information, the number of digits of each time unit of the translated time information, and whether each time unit of the translated time information uses a plurality, based on the presentation format.
[0020] According to a third aspect, an embodiment of the present disclosure provides an electronic device, which includes a memory and a processor. The memory is used to store a computer program, and when the processor calls the computer program, it is used to implement the translation method of the application program described in any one of the above embodiments on the electronic device.
[0021] According to a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a computing device, the computing device is caused to implement the translation method of the application program described in any one of the above embodiments.
[0022] According to a fifth aspect, an embodiment of the present disclosure provides a computer program product. When the computer program product operates on a computer, the computer is caused to implement the translation method of the application program described in any one of the above embodiments.
Advantages of the Invention
[0023] The translation method of the application program according to the embodiments of the present disclosure detects the time information in the application program to be translated, obtains the attribute information of the time information, determines the presentation format of the time information based on the attribute information, and translates the time information based on the presentation format when translating the application program.
Brief Description of the Drawings
[0024] The drawings herein are incorporated into the specification and constitute part of this specification, illustrating embodiments conforming to the disclosure and are used together with the specification to interpret the principles of this disclosure.
[0025] To more clearly illustrate the examples or related technologies of this disclosure, the drawings necessary for use in the examples or related technology descriptions are briefly introduced below, and obviously, those skilled in the art can obtain other drawings based on these drawings without any creative effort.
[0026] [Figure 1] This is one step flowchart of a method for translating an application program according to an embodiment of the present disclosure.
[0027] [Figure 2] This is one step flowchart of a method for translating an application program according to an embodiment of the present disclosure.
[0028] [Figure 3] This is a schematic diagram of the structure of an application program translation device according to an embodiment of the present disclosure.
[0029] [Figure 4] This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present disclosure. [Modes for carrying out the invention]
[0030] To provide a clearer understanding of the features and benefits of this disclosure, the embodiments of this disclosure are further described below. It should be noted that, where there is no conflict, the embodiments and features of this disclosure can be combined with each other.
[0031] While the following description includes many specific details to help you fully understand this disclosure, this disclosure may be implemented in ways other than those described herein, and obviously the examples in this specification are only a selection of, not all, examples of this disclosure.
[0032] In the embodiments of this disclosure, terms such as “exemplary” or “for example” are used to indicate examples, illustrations, or explanations. Any embodiment or design described as “exemplary” or “for example” in the embodiments of this disclosure should not be construed as being more preferable or superior to other embodiments or designs. More precisely, the use of terms such as “exemplary” or “for example” is intended to illustrate the relevant concepts in a concrete manner. In the descriptions of embodiments of this disclosure, unless otherwise specified, “multiple” means two or more.
[0033] In the description and claims of the embodiments of this disclosure, the term "at least one of..." means one or more of the listed items. For example, "at least one of A, B, and C" means 1) including only A, 2) including only B, 3) including only C, 4) including A and B, 5) including A and C, 6) including B and C, and 7) including A, B, and C.
[0034] The execution unit of the application program translation method according to an embodiment of the present invention may be an application program translation device. The application program translation device may specifically be a notebook computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or it may be any other type of device, and is not limited to the embodiments of the present invention.
[0035] In related technologies, there are differences in presentation rules regarding the time units that must be included in time information in different language environments, the order between time units, and whether or not a plural format should be used. Artificially determining the presentation format of time information after translation can lead to incorrect presentation formats due to confusion and misremembering of the time information presentation rules in different language environments.
[0036] In view of this, the embodiments of the present disclosure provide a method and apparatus for translating an application program to solve the problem that the format of time information presented in the translated application program may be incorrect.
[0037] Based on the above, the embodiments of this disclosure provide a method for translating an application program, which, referring to Figure 1, includes the following steps:
[0038] S11: Detect time information in the application program to be translated.
[0039] Specifically, the time information in the embodiments of the present invention may include at least one of time and date. For example, the time information may include 11:41:01, or for example, the time information may include September 9, 2021, or for example, the time information may include September 9, 2021, 11:41:57.
[0040] S12: Obtain attribute information of the aforementioned time information.
[0041] Here, the attribute information includes at least one of the following: the target language for translation of the time information, the time unit included in the time information, and the number of data digits for each time unit of the time information.
[0042] In embodiments of the present invention, if an application program needs to be translated into a certain language, this language is the target language for translation of the time information. For example, if an application program needs to be translated from a Chinese application program to an English application program, the target language for translation of the time information is English. The time units included in the time information may include one or more of the following: centuries, years, quarters, months, days, days of the week, hours, fifteen-minute units, minutes, seconds, etc. The number of data digits for a time unit is the number of data digits that represent the value of one time unit. For example, for the time unit "year," if it is identified in the format "18" or "21," the number of data digits is 2, but if it is identified in the format "2018" or "2021," the number of data digits is 4. Also, for example, for the time unit "month," if it is identified in the format "1" or "5," the number of data digits is 1, but if it is identified in the format "01" or "05," the number of data digits is 2.
[0043] S13: Determine the presentation format based on the attribute information mentioned above.
[0044] In other words, the presentation format corresponding to the time information is obtained based on the attribute information of the time information.
[0045] It should be explained that if the application program to be translated contains multiple time-related pieces of information, there may be differences in the attribute information of each piece of time-related information. Therefore, it is necessary to obtain the presentation format corresponding to each piece of time-related information based on the attribute information of each piece of time-related information.
[0046] As an optional embodiment of the present invention, determining the presentation format based on the attribute information includes the following steps 1 and 2.
[0047] Step 1: Obtain a format identifier based on the attribute information mentioned above.
[0048] An implementation method for selectively obtaining a format identifier based on the attribute information may include the following steps a and b.
[0049] Step a: Calculate the attribute information based on a pre-configured algorithm and obtain the target calculated value.
[0050] In other words, the attribute information is used as input to a pre-configured algorithm, and the output of the pre-configured algorithm is obtained as the target calculated value.
[0051] Step b: Obtain the format identifier based on the target calculated value.
[0052] It should be explained that in the embodiments of the present invention, the inputs and outputs of the pre-configured algorithms correspond one-to-one, and a unique input to the pre-configured algorithm can be used to calculate a unique output to the pre-configured algorithm, thereby ensuring that different format identifiers can be obtained based on different attribute information.
[0053] Selectively obtaining the format identifier based on the target calculated value may include directly using the target calculated value as the format identifier.
[0054] Selectively obtaining the format identifier based on the target calculated value may further include processing the target calculated value in a pre-defined processing manner to obtain the format identifier. For example, the pre-defined processing manner may intercept the first n digits of the target calculated value, where n is a positive integer.
[0055] Step 2: Determine the proposed format based on the format identifier and profile.
[0056] Here, the profile includes the correspondence between the format identifier and the presented format.
[0057] Selectively, prior to step 2 above, the application program translation method in an embodiment of the present invention further includes generating the profile and pre-setting the profile in the execution body of the application program translation method according to an embodiment of the present invention. Here, the method for generating the profile may include generating format identifiers corresponding to various time information based on attribute information of various time information, obtaining presentation formats corresponding to various time information, establishing a correspondence between the format identifiers of various time information and the presentation formats, and generating the profile.
[0058] For example, the profiles in the embodiments of this disclosure may be as shown in Table 1 below. [Table 1]
[0059] S14: Translate the time information based on the presented format.
[0060] For example, if the time information is 2021 / 09 / 09 based on the profile shown in Table 1 above, and the format identifier obtained based on the attribute information of the time information is identifier 5, then the presented format "MMMM DD" can be obtained based on identifier 5 and the profile shown in Table 1, and the time information can be translated to September 09 based on the presented format "MMMM DD".
[0061] The application program translation method according to the embodiments of this disclosure first detects time information in the application program to be translated, obtains attribute information of the time information, determines the presentation format of the time information based on the attribute information, and translates the time information based on the presentation format. Since the application program translation method according to the embodiments of the present invention can obtain the presentation format of time information based on the attribute information of the time information in the application program to be translated, the embodiments of the present invention can translate the time information in the application program using a specified format when translating time information in an application program, thereby reducing errors that may occur due to the artificial determination of the presentation format of time information. Thus, the embodiments of the present invention can solve the problem of incorrect presentation format of time information in the translated application program.
[0062] As an extension and subdivision of the above embodiment, an embodiment of the present invention provides a method for translating another application program, which, referring to Figure 2, includes the following steps.
[0063] S201: Obtain the target regular expression based on the current language of the application program to be translated.
[0064] Specifically, since each language environment has its own unique presentation rules for both time and date, it is possible to generate a target regular representation based on the presentation rules for time and date in the current language.
[0065] For example, the standard way to express a date in Chinese, based on the rules for presenting time information in Chinese, is:
number
number
number
[0066] Therefore, if the application program to be translated is a Chinese application program, the above regular expression can be determined as the target regular expression.
[0067] S202: Regular matching is performed on the string in the application program to be translated, and the string that matches the target regular expression in the application program to be translated is determined to be the time information in the application program to be translated.
[0068] By performing regular matching on the strings in the application program to be translated and determining the strings that match the target regular expression in the application program to be translated as the time information in the application program to be translated, the time information in the application program to be translated can be detected quickly, and misidentification or omission of the time information in the application program to be translated can be reduced.
[0069] S203: Obtain attribute information of the aforementioned time information.
[0070] Here, the attribute information includes at least one of the following: the target language for translation of the time information, the time unit included in the time information, and the number of data digits for each time unit of the time information.
[0071] Specifically, attribute information of time information can be obtained by identifying and analyzing the time information. For example, if the detected time information is "2021 / 09 / 09", the three time units included in the time information, "year", "month", and "day", can be obtained, and the number of data digits for "year" is 4, the number of data digits for "month" is 2, and the number of data digits for "day" is 2.
[0072] S204: Based on a pre-configured algorithm, calculate the target value on the attribute information and obtain the target calculated value.
[0073] In other words, attribute information is used as input to a pre-configured algorithm, and the output of the pre-configured algorithm is obtained as the target calculated value.
[0074] Selectively, the pre-configured algorithm may be a Message-Digest Algorithm (MD5).
[0075] Selectively, the pre-configured algorithm may be a hash algorithm.
[0076] In addition to the embodiments described above, the pre-configured algorithm may be any other algorithm, and is not limited to the present disclosure, but is based on a unique target calculated value obtained based on unique attribute information.
[0077] S205: Obtain the format identifier based on the target calculated value.
[0078] In some embodiments, the target calculated value may be used directly as the format identifier.
[0079] In some embodiments, the target calculated value may be processed based on a pre-configured processing method to obtain the format identifier.
[0080] S206: Obtain the proposed format based on the format identifier and profile.
[0081] Here, the profile includes the correspondence between the format identifier and the presented format.
[0082] S207: Translate the time information based on the presented format.
[0083] Selectively translating the time information based on the presentation format is This includes setting at least one of the following based on the presentation format: the time units included in the translated time information, the order in which each time unit of the translated time information is arranged, the number of digits in each time unit of the translated time information, and whether each time unit of the translated time information uses multiple units.
[0084] The time units that need to be included in time information differ in different language environments. By setting the time units to be included in the translated time information in the presentation format, it is possible to reduce the omission or surplus of certain time units in the translated time information and further ensure the accuracy of the translated time information. For example, when translating the time information "Friday, May 28, 2021, 15:00", if the target language for translation is English, the English presentation rules must adopt a 12-hour system and clearly indicate AM / PM. Therefore, by setting the presentation format to include the time unit "AM / PM" in the translated time information, the time information can be further translated to "Friday, May 28, 2021, 3:00 PM".
[0085] The order of time units in time information differs in different language environments. By setting the order of time units in the translated time information using the presentation format, the accuracy of the translated time information can be guaranteed. For example, when translating the time information "May 28, 2021," if the target language is English, the order of "year, month, day" in English is month, day, year. Therefore, the presentation format can be set to month, day, year as the order of time units in the translated time information, and the time information can be further translated to "May 28, 2021."
[0086] The definition of whether each time unit in time information needs to be plural differs in different language environments. By setting whether each time unit in the translated time information uses plurals in the aforementioned presentation format, the accuracy of the translated time information can be guaranteed. For example, in English, "Next 11 hours" is plural in English. In Russian, 11, 21, or 101 are all considered singular as long as the last digit is 1, so "через 11 ч" is singular in Russian for "11 hours from now." In Japanese, there is no distinction between singular and plural, so in Japanese, "11 hours from now" is used to express "11 hours from now."
[0087] The application program translation method according to the embodiments of this disclosure, when translating an application program, first detects time information in the application program to be translated, obtains attribute information of the time information, determines the presentation format of the time information based on the attribute information, and translates the time information based on the presentation format. Since the application program translation method according to the embodiments of the present invention can obtain the presentation format of time information based on the attribute information of the time information in the application program to be translated, the embodiments of the present invention can translate the time information in the application program using a specified format when translating time information in an application program, thereby reducing errors that may occur due to the artificial determination of the presentation format of time information. Thus, the embodiments of the present invention can solve the problem of incorrect presentation format of time information in the translated application program.
[0088] Based on the same inventive concept, the embodiments of this disclosure further provide an application program translation device as a means of realizing the above method. The embodiments of this device correspond to the embodiments of the aforementioned method, and for readability, the embodiments of this device omit the detailed contents of the embodiments of the aforementioned method. However, it should be made clear that the application program translation device in these embodiments can implement all the contents of the embodiments of the aforementioned method.
[0089] The embodiments of this disclosure provide an application program translation device. Figure 3 is a schematic diagram of the structure of this application program translation device, and as shown in Figure 3, this application program translation device 300 is A detection unit 31 for detecting time information in the application program to be translated, An acquisition unit 32 for acquiring attribute information of the time information, wherein the attribute information includes at least one of the following: the translation target language of the time information, the time unit included in the time information, and the number of data digits for each time unit of the time information. A processing unit 33 for obtaining the presentation format based on the attribute information, The system includes a translation unit 34 for translating the time information based on the presentation format.
[0090] In an optional embodiment of the embodiments of this disclosure, the processing unit 33 is specifically used to obtain a format identifier based on the attribute information and to determine the presentation format based on the format identifier and profile. Here, the profile includes the correspondence between the format identifier and the presented format.
[0091] In an optional embodiment of the embodiments of the present disclosure, the processing unit 33 is used to calculate on the attribute information based on a pre-configured algorithm, to obtain a target calculated value, and to obtain the format identifier based on the target calculated value.
[0092] As an optional embodiment of the embodiments of this disclosure, the pre-configured algorithm is either the message digest algorithm MD5 or a hash algorithm.
[0093] In an optional embodiment of the embodiments of this disclosure, the detection unit 31 is specifically used to perform regular matching on strings in the application program to be translated and to determine the strings that match the target regular expression in the application program to be translated as time information in the application program to be translated.
[0094] In an optional embodiment of the embodiments of the present disclosure, the detection unit 31 is further used to obtain the target regular representation based on the current language of the application program to be translated, before regular matching of the string in the application program to be translated.
[0095] In an optional embodiment of the embodiments of the present disclosure, the translation unit 34 is used to specifically set at least one of the following based on the presentation format: the time units to be included in the translated time information, the order in which the time units in the translated time information are arranged, the number of digits in each time unit in the translated time information, and whether each time unit in the translated time information uses multiple units.
[0096] The application program translation device according to the embodiment of the present invention can realize the application program translation method according to the above embodiment, and its implementation principle and technical effects are similar, so it will not be explained further here.
[0097] Based on the same inventive concept, embodiments of the present disclosure further provide electronic devices. Figure 4 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. As shown in Figure 4, the electronic device according to this embodiment includes a memory 41 and a processor 42. The memory 41 is used to store computer programs, and the processor 42 is used to enable the electronic device to implement the application program translation method according to the above embodiment when a computer program is called and executed.
[0098] Specifically, memory 41 may be used to store software programs and various data. Memory 41 may mainly include a program storage area and a data storage area. Here, the program storage area can store the operating system, application programs necessary for at least one function (e.g., audio playback function, image playback function, etc.), and so on, while the data storage area can store data created through the use of the mobile phone (e.g., audio data, phone book, etc.). Memory 41 may also include high-speed random-access memory, and may also include non-volatile memory, such as at least one magnetic disk memory device, flash memory device, or other volatile solid-state memory device.
[0099] The processor 42 is the control center of the electronic device, connected to all parts of the entire electronic device by various interfaces and lines, and monitors the entire electronic device by operating or executing software programs and / or modules stored in memory 41 and retrieving data stored in memory 41, thereby performing various functions of the electronic device and processing data. The processor 42 may include one or more processing units.
[0100] It should be understood that the electronic device according to the embodiment of the present invention may further include components such as a radio frequency unit, a network module, an audio output unit, a receiving unit, a sensor, a display unit, a user receiving unit, an interface unit, and a power supply. As those skilled in the art will understand, the structure of the electronic device described above is not a limitation on the electronic device, and the electronic device may include more or fewer components, combinations of some components, or different arrangements of components. In the embodiment of the present invention, the electronic device includes, but is not limited to, mobile phones, tablet PCs, notebook computers, palmtop computers, in-vehicle terminals, wearable devices, and pedometers.
[0101] Embodiments of the present disclosure further provide a computer-readable storage medium in which a computer program is stored, and when the computer program is executed by a computing device, the computing device implements the translation method of the application program according to the above embodiment.
[0102] Embodiments of this disclosure further provide a computer program product that, when the computer program product is running on a computer, causes the computer to implement the translation method of the application program according to the above embodiment.
[0103] Those skilled in the art should understand that embodiments of this disclosure may be provided as methods, systems, or computer program products. Therefore, this disclosure may take the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware aspects. Furthermore, this disclosure may take the form of computer program products implemented on one or more computer-available storage media containing computer-available program code.
[0104] The processor may be a Central Processing Unit (CPU), a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware assembly, etc. The general-purpose processor may be a microprocessor, or this processor may be any general-purpose processor, etc.
[0105] Memory may include non-permanent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
[0106] Computer-readable media include permanent and non-permanent storage media, and removable and non-removable storage media. Storage media can implement information storage by any method or technique, and the information may be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only optical discs (CD-ROM), digital versatile optical discs (DVDs) or other optical storage, magnetic cartridges, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that may be used to store information accessible by computing devices. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carriers.
[0107] Finally, it should be noted that the above embodiments are used solely to illustrate the technical ideas of the present disclosure and are not limiting thereto. Although the present disclosure has been described in detail with reference to the above embodiments, it should be understood by those skilled in the art that the technical ideas described in the above embodiments can still be modified, or some or all of their technical features can be replaced equally, and such modifications or replacements will not cause the essence of the applicable technical ideas to deviate from the scope of the technical ideas of the embodiments of the present disclosure.
Claims
1. A translation method for translating an application program executed by a computer into an application program in a target language, Detecting time information in the application program to be translated, The method of obtaining attribute information of the time information, wherein the attribute information includes the translation target language of the time information, the time units included in the time information, and the number of data digits for each time unit of the time information. The process involves calculating the attribute information based on a pre-configured algorithm to obtain a target calculated value, The method involves obtaining a format identifier by intercepting the first n digits of the target calculated value using a pre-configured processing method, wherein n is a positive integer. The method of determining the presentation format based on the format identifier and profile, wherein the profile includes the correspondence between the format identifier and the presentation format. A translation method comprising translating the time information based on the aforementioned presentation format.
2. The method according to claim 1, wherein the pre-configured algorithm is a message digest algorithm MD5 or a hash algorithm.
3. Detecting time information in the application program to be translated is The method according to claim 1, comprising performing regular matching on a string in the application program to be translated, and determining a string that matches a target regular expression in the application program to be translated as time information in the application program to be translated.
4. Before performing regular matching on the string in the application program to be translated, the method: The method of claim 3, further comprising obtaining the target regular expression based on the current language of the application program to be translated.
5. Translating the time information based on the aforementioned presentation format is, The method according to any one of claims 1 to 4, comprising setting, based on the presentation format, at least one of the following: the time units included in the translated time information, the order in which the time units in the translated time information are arranged, the number of digits in each time unit of the translated time information, and whether or not multiple time units are used for each time unit of the translated time information.
6. A translation device for application programs, A detection unit configured to detect time information in an application program to be translated, An acquisition unit configured to acquire attribute information of the aforementioned time information, wherein the attribute information includes the translation target language of the time information, the time units included in the time information, and the number of data digits for each time unit of the time information. A processing unit is configured to obtain a target calculated value by calculating on the attribute information based on a pre-configured algorithm, and to obtain a format identifier by intercepting the first n digits of the target calculated value in a pre-configured processing manner, where n is a positive integer, and to determine the presentation format based on the format identifier and profile, where the profile includes the correspondence between the format identifier and the presentation format. A translation device for an application program, comprising: a translation unit configured to translate the time information based on the presentation format;
7. Electronic device comprising memory and a processor, wherein the memory is used to store a computer program, and the processor is configured to cause the electronic device to implement the translation method of an application program described in any one of claims 1 to 4 when the computer program is called.
8. A computer-readable storage medium wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a computing device, the computing device implements the translation method of the application program described in any one of claims 1 to 4.
9. A computer program that, when the computer program is running on a computer, causes the computer to implement the translation method of an application program described in any one of claims 1 to 4.
Citation Information
Patent Citations
EDI information conversion device, EDI conversion method and its program
JP2006268136A
System and method for linguist-based human / machine interface components
JP2015197922A