WO2022257554A1 - 一种软件翻译方法和装置 - Google Patents
一种软件翻译方法和装置 Download PDFInfo
- Publication number
- WO2022257554A1 WO2022257554A1 PCT/CN2022/082870 CN2022082870W WO2022257554A1 WO 2022257554 A1 WO2022257554 A1 WO 2022257554A1 CN 2022082870 W CN2022082870 W CN 2022082870W WO 2022257554 A1 WO2022257554 A1 WO 2022257554A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- code logic
- interface
- software
- text
- translation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
- G06F9/454—Multi-language systems; Localisation; Internationalisation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/40—Processing or translation of natural language
- G06F40/58—Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/448—Execution paradigms, e.g. implementations of programming paradigms
- G06F9/4488—Object-oriented
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/52—Binary to binary
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
Definitions
- the present disclosure relates to the field of computer technology, in particular to a software translation method and a software translation device.
- the internationalization and translation of computer software is mainly achieved by replacing the original language resource pack and/or loading language resource packs of different languages.
- the original language resource pack when the original language resource pack is replaced, the loaded language resource pack in different languages can be translated and provided by the software user or a third party.
- software users or third-party personnel need to analyze and understand the format of the original language resource pack, and for private, non-public or encrypted language resource packs, software users or third-party personnel
- the translation of encrypted language resource packs cannot be realized, and the translation replacement method of this voice resource pack has certain limitations.
- the embodiments of the present disclosure are proposed to provide a software translation method and a corresponding software translation device that overcome the above problems or at least partially solve the above problems.
- the embodiment of the present disclosure discloses a software translation method, the method comprising:
- a corresponding software interface is displayed according to the target text information through the second interface text setting code logic.
- setting code logic with a translation function in the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- said rewriting said first interface text setting code logic by using said code logic with translation function includes:
- the rewritten code logic includes the first interface text setting of the code logic with translation function code logic.
- said setting code logic through the second interface text to display a corresponding software interface according to the target text information, including:
- the interface function set in the second interface text is called back to display the target software interface text corresponding to the target text information.
- using the code logic with translation function to rewrite the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- the determining the code logic position of the first interface text setting code logic in the code segment of the memory includes:
- the interface text setting information includes interface function information set by the first interface text
- the target file of the target software program is statically scanned and analyzed for function symbols, and the code logic position of the code segment of the first interface text setting code logic in the memory is determined.
- the translating the original text information in the software interface through the code logic with translation function to obtain the target text information includes:
- the code logic position of the code segment in the internal memory is set according to the first interface text to determine the code logic position to be modified
- the embodiment of the present disclosure also discloses a software translation device, the device includes:
- the software program running module is configured to execute and run the target software program, and determine the target file in the target software program, wherein the target file includes the first interface text setting code logic;
- the original text information translation module is configured to execute the code logic with translation function set in the first interface text setting code logic, and translate the original text information in the software interface through the code logic with translation function to obtain target text information;
- the interface text display module is configured to execute the code logic of setting the second interface text to display the corresponding software interface according to the target text information.
- the original text information translation module includes: a code logic rewriting sub-module configured to implement the code logic of rewriting the first interface text setting code logic using the code logic with translation function.
- the code logic rewriting submodule includes:
- an interface function acquisition unit configured to execute the interface function in the logic of acquiring the first interface text setting code
- the interface function pointing unit is configured to perform an interception operation on the interface function used for setting the first interface text, and point the interface function used for setting the interface text to the rewritten code logic; the rewritten code
- the logic includes first interface text setting code logic of code logic with translation function.
- the interface text display module includes:
- the interface text display submodule is configured to call back the interface function set by the second interface text to display the target software interface text corresponding to the target text information after executing the interception operation on the interface function set by the first interface text.
- the code logic rewriting submodule includes:
- the code logic position determination unit is configured to determine the code logic position of the first interface text setting code logic in the code segment in the memory
- the code logic rewriting unit is configured to execute at the code logic position, and use the code logic with translation function to rewrite the first interface text setting code logic.
- the code logic location determination unit includes:
- the interface text setting information acquisition subunit is configured to perform acquisition of interface text setting information for the target software program; the interface text setting information includes interface function information of the first interface text setting;
- the code logic position determination subunit is configured to perform static scanning analysis of function symbols on the target file of the target software program according to the interface function information, and determine the code segment of the first interface text setting code logic in the memory logical location.
- the code logic location determination unit includes:
- the code logic location determination subunit is configured to determine the code logic location to be modified according to the code logic location of the code segment in the memory according to the code logic location of the code logic set in the first interface text when running the target software program and loading the preset dynamic link library
- the code logic rewriting subunit is configured to modify the first interface text setting code logic at the code logic position that needs to be modified, and replace it with the code logic with translation function.
- the embodiment of the present disclosure also discloses an electronic device, including: a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and the computer program is implemented when the processor runs The steps of any one of the software translation methods.
- the embodiment of the present disclosure also discloses a computer-readable storage medium.
- a computer program is stored on the computer-readable storage medium.
- the computer program is run by a processor, any one of the steps of the software translation method is implemented.
- the target software program can be run, and the code logic with translation function is set in the first interface text setting code logic of the target software program, and the original text information in the software interface is processed by the code logic with translation function.
- Translate and then set the code logic through the second interface text to display the corresponding software interface according to the target text information, so as to realize the translation and display of the software interface text when running the software program.
- the international translation of computer software can be realized based on the inserted code logic with translation function, reducing the use threshold caused by language barriers , so that the use of computer software can efficiently adapt to the language environment and habits of computer software users, and improve the computer software users' experience in using the software.
- FIG. 1 is a flow chart of the steps of an embodiment of a software translation method of the present disclosure
- FIG. 2 is a flow chart of the steps of another software translation method embodiment of the present disclosure.
- Fig. 3 is a schematic diagram of code logic for rewriting a software program in an embodiment of the present disclosure
- FIG. 4 is a flow chart of the steps of another software translation method embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of an application scenario of a software translation method in an embodiment of the present disclosure
- FIG. 6 is a schematic diagram of an application scenario of another software translation method in an embodiment of the present disclosure.
- Fig. 7 is a structural block diagram of an embodiment of a software translation device of the present disclosure.
- Fig. 8 is a structural block diagram of a computer-readable storage medium according to an embodiment of the present disclosure.
- the language used and displayed on the computer software interface may specifically come from a separate language resource package, which may contain one or more languages.
- the language resource package can be loaded and displayed on the software interface in the corresponding language according to the specific logic rules of the software, providing users with guidance on how to use the software.
- the language resource packs used to provide different languages can come from computer software authors. It can also come from the software user or a third-party person, that is, the international translation of computer software can be realized by directly loading the language resource package and/or replacing the language resource package by translation.
- the first method that is, directly loading language resource packs is the mainstream method for most computer software multilingual implementation at present.
- Computer software authors can provide language resource packs with different languages.
- the software When the software is released and running, it can Automatically load language resource packs with different languages, so that the operation interface of the software can support multi-language selection, and realize the international translation of computer software.
- the above-mentioned first method requires the author of the computer software to be proficient in multiple languages, requires relatively large resources and manpower input, and the cost of software production and maintenance is relatively high, while the second method is very difficult for software users or third-party personnel.
- it is necessary to analyze and understand the format of the original language resource package. It cannot handle private, non-public or encrypted language resource packages, nor can it handle updated language resource packages downloaded from the Internet in a timely manner.
- the usage scenarios of this method have limitations, not only It is necessary to analyze and understand the interface or business logic of different software, and it may also be necessary to deal with the verification mechanism of the integrity of the language resource package in the software.
- the translation and replacement of the language resource package requires relatively large investment in additional human resources, and subsequent maintenance It also needs to invest more resources, and lacks flexibility and versatility.
- the use threshold caused by the barrier problem enables the use of computer software to efficiently adapt to the language environment and habits of computer software users, and improves the experience of computer software users in using the software.
- FIG. 1 shows a flow chart of the steps of an embodiment of a software translation method of the present disclosure, focusing on the process of using the software translation method, which may specifically include the following steps:
- Step 101 run the target software program, and determine the target file in the target software program
- the embodiments of the present disclosure do not use the method of processing the language resources of software programs, but process the program codes of the software, and the processed program codes can come from A computer software program for which an interface translation is required.
- publishing and running computer software can usually be implemented in the form of a binary program, and part of the content of the binary program can include a code segment and a data segment.
- the code segment and initialization/ The uninitialized data segment can be loaded into the memory, so that when the computer software is running, the computer or virtual machine can read the executable content of the code segment loaded into the memory to run the program.
- the code segment contains binary data that can be understood and executed by the computer.
- the binary data contained in the code segment can be used to determine the functions of the program and the performance of the program.
- the code logic of the interface text that is, the code logic of setting the first interface text.
- Step 102 setting code logic with translation function in the first interface text setting code logic, and translating the original text information in the software interface through the code logic with translation function to obtain target text information;
- the computer software program whose interface needs to be translated can be run, so as to run the executable content of the code segment in the computer software program that needs to be translated; in order to make
- the target software program can have a translation function when running, and can pre-process the code logic in the running target software program before running the code logic that needs to be displayed on the interface, so that the processing can be performed based on the running of the software program
- the final code logic realizes the translation function.
- the translation function of the software program can also be realized through the executable content contained in the code segment of the software program, so pre-processing the code logic in the running target software program can be expressed as , the first interface text setting code logic for setting the interface text is processed, specifically, code logic with a translation function may be set in the first interface text setting code logic.
- the software program needs to display the translated interface text on the UI interface, so the processing of the code logic of the software program can occur in the language display link of the software UI, and the language display link of the software UI can be based on the language display link used in running the software program.
- the first interface text setting code logic implementation based on the interface text setting, at this time, setting the code logic with translation function in the first interface text setting code logic can refer to using the code logic with translation function to rewrite the software program for The first interface text setting code logic of the interface text setting, and the code logic with translation function is placed before the code logic used for interface text setting in the software program, so that when running the first interface text setting code logic for language display, it can First, through the set code logic with translation function, the original text information of the interface text is translated into the corresponding text language to obtain the target text information.
- Step 103 display the corresponding software interface according to the target text information through the second interface text setting code logic.
- the target software program after the code logic rewriting can be run to translate the interface text.
- the second interface text setting code logic before rewriting displays the translated interface text, that is, the target text information, and realizes the translation and display of the software program interface text.
- the function of the program running and its performance can be achieved by calling the API of the operating system or the virtual machine.
- the program can call the API set by the UI component text, that is, the text set in the UI component
- a piece of code logic with translation function is inserted, so that in the language display environment of the software UI, the original text information of the target software program can be obtained through the inserted code logic of the translation function.
- the translated language is obtained, and then displayed in the UI of the software.
- the machine translation used in the code logic can realize the real-time translation of the original language of the software UI, and guarantee the accuracy of the translation to a certain extent based on some manual proofreading links.
- the code logic with the translation function processes the original text information in the UI language display link, so the original text information obtained by the code logic with the translation function can be strings in different languages in the form of text.
- the original text information that is, the string
- the acquired strings can usually be phrases and sentences with practical significance, which can be directly processed by machine translation, without the need to extract and analyze the language contained in the string text, that is, the code with translation function
- the logic will not modify the software language resource package. At this time, there is no need to consider the integrity verification mechanism of the language resource package in the software program.
- the target software program can be run, and the code logic with translation function is set in the first interface text setting code logic of the target software program, and the original text information in the software interface is processed by the code logic with translation function.
- Translate and then set the code logic through the second interface text to display the corresponding software interface according to the target text information, so as to realize the translation and display of the software interface text when running the software program.
- the international translation of computer software can be realized based on the inserted code logic with translation function, reducing the use threshold caused by language barriers , so that the use of computer software can efficiently adapt to the language environment and habits of computer software users, and improve the computer software users' experience in using the software.
- FIG. 2 shows a flow chart of the steps of another software translation method embodiment of the present disclosure, which also focuses on the use process of the software translation method, and may specifically include the following steps:
- Step 201 run the target software program, and use the code logic with translation function to rewrite the first interface text setting code logic in the software program;
- the target software program can be run to run the required The executable content of the code segment in the translated computing software program; in order to enable the target software program to have the translation function when it is running, before running the target software program that needs to be interface translated, the target software program that is running can be edited in advance.
- the code logic is processed, so that the translation function can be realized based on the processed code logic that can be run when running the target software program.
- the pre-processing of the code logic in the running software program can be expressed as using the code logic with translation function to rewrite the first interface text setting code logic used for interface text setting in the software program. Specifically, it can be set in the UI component text setting Insert the code logic with the translation function at the beginning of the API logic section.
- the method of determining the code logic position of the first interface text setting code logic in the memory code segment for setting the interface text can be determined based on the interface function information of the first interface text setting,
- the interface text setting information of the target software program can be obtained, the interface text setting information can include the interface function information set by the first interface text, and then the target software program can be statically scanned and analyzed for function symbols according to the interface function information to determine the software program The code logic position of the first interface text setting code logic used for interface text setting in the code segment in the memory.
- related documents about UI text controls in different software frameworks can be obtained.
- related documents about UI text controls in software programs that need to be translated can be obtained, including interface settings.
- the interface function information may refer to relevant content information about the text setting API in the UI text control.
- the UI text setting API can be obtained A specific location in computer memory.
- the code logic position of the segment determines the code logic position that needs to be modified, so that the code logic for setting the interface text is modified at the code logic position that needs to be modified, and replaced with the code logic that has a translation function.
- Step 202 Run the code logic with translation function in the first interface text setting code logic to translate the interface text, and run the second interface text setting code logic before rewriting to display the translated interface text.
- FIG. 3 it shows a schematic diagram of the code logic for rewriting the software program in the embodiment of the present disclosure.
- the content blocks A and B are the code logic for the first interface text setting in the target software program.
- the code logic position of the code segment set in the interface text in the memory can be located at point a as shown in the figure, then the determined code logic position that needs to be modified can refer to the part located in front of the code logic of the first interface text setting
- the position of the code segment in the memory that is, before point a, at this time, it can be determined that the content block A before point a is the code logic that needs to be replaced.
- content block C is the code logic with translation function
- the content block C can be compared to a The content block at the position before the click is modified and replaced, that is, content block A is replaced with content block C, and content A (that is, the logic of the second interface text setting code) is backed up.
- the first interface text setting can be run
- the code logic with translation function in the code logic translates the original text information of the interface text, and runs the first interface text setting code logic to display the translated target text information on the software interface to realize the translation and display of the software program interface text .
- FIG. 4 shows a flow chart of the steps of another software translation method embodiment of the present disclosure, focusing on the technical implementation process of the software translation method, which may specifically include the following steps:
- Step 401 obtaining the interface function in the code logic of the first interface text setting code
- the processing of the code logic of the computer software program that needs to translate its interface can be expressed as using the code logic with translation function to rewrite the code logic of the first interface text setting in the software program, in specific
- the function of the program running and its performance can be achieved by calling the API of the operating system or the virtual machine. At this time, in the process of rewriting the code logic for setting the interface text, it is actually the first interface text setting The interface function in the code logic is processed.
- the API function used for UI text setting in the software program can be obtained first.
- Step 402 intercepting the interface function of the first interface text setting, pointing the interface function of the first interface text setting to the rewritten code logic
- the obtained interface function can be intercepted. Specifically, it can be realized by an inline hook technology, and after interception, it can be based on the The determined specific location of the interface function of the interface text setting performs corresponding processing on the interface function, so as to realize the rewriting of the code logic for the interface text setting.
- the rewritten code logic may refer to the first interface text setting code logic that has code logic with a translation function before the code logic used for interface text setting, then the processing of the interface function may be expressed as the rewritten The interface function points to the first interface text of the code logic with translation function to set the code logic.
- the UI text sets the timing of rewriting and replacing the API code.
- the code logic position is modified and replaced, and the rewritten API function code segment is pointed to the binary logic code in the memory after modification and replacement.
- the position of the UI text setting API in the computer memory can be obtained by combining the static scanning and analysis of the function symbols of the program code.
- the UI text setting API code can be rewritten and replaced according to the determined position , the implementation of UI text setting API code rewriting and replacement operations can be handled by some implemented tools or frameworks, such as Substrate, etc.
- Step 403 Call back the interface function set in the second interface text to display the target software interface text corresponding to the target text information after the intercept operation of the interface function set in the first interface text.
- the rewritten interface function can point to the code logic with translation function and the code logic used for interface text setting before the code logic used for interface text setting, then at this time, the user After the interface function set in the interface text intercepts and rewrites the pointed operation, in order to ensure the functional availability of the software program, the jump instruction in the hook method can be used to call back to the original method to continue execution. Before calling back, it is necessary to supplement the execution target The original code logic of the method has been replaced to ensure the integrity of the original method.
- the original binary code logic needs to be retained (i.e. The second interface text sets the code logic), so that when the code logic of the backup part is run later, the original binary code logic and running results can still take effect, so that the translated text can be displayed on the software interface normally.
- the original code logic that has been replaced that is, the second interface text setting code logic can be backed up, so that the rewritten function can be run when the running software program calls the interface function of the first interface text in the UI language display link.
- the last interface function uses the code logic with translation function to translate the original text information of the interface to obtain the target text information, and then calls back the interface function set by the second interface text to display the target software interface text corresponding to the target text information.
- the embodiments of the present disclosure can be applied to any software implementation based on the software translation method proposed by the embodiments of the present disclosure, such as computer software programs that need to translate their interfaces. limit.
- FIG. 5 it shows a schematic diagram of an application scenario of a software translation method in an embodiment of the present disclosure. Assuming that there is a certain computer software and the language text of the software program is language A, computer software user 1 and computer software user 2 can Install and run a certain computer software respectively.
- the language environment of computer software user 1 is language A, and the language environment of computer software user 2 is language B.
- the computer software When computer software user 1 installs and runs the computer software , the computer software can be directly installed and run, and the interface text of language A is displayed on the running computer software interface at this time; when the computer software user 2 installs and runs the computer software, the installed computer software During the running process, in the UI language display link, it is necessary to rewrite the code logic used for interface text setting (that is, the first interface text setting code logic), that is, the code logic with translation function in the first interface text setting code logic After the interface text of language A is translated into language B, the code logic is set to display the translated interface text on the computer software interface through the second interface text backed up before rewriting.
- the code logic used for interface text setting that is, the first interface text setting code logic
- the code logic is set to display the translated interface text on the computer software interface through the second interface text backed up before rewriting.
- any software applied to the software translation method can be embodied as an accelerator, that is, the running software program can be an accelerator.
- Accelerator can be a kind of installation-free application program, which can include multiple game software, users can directly double-click to use the accelerator, and can directly select one of the game software to accelerate after the verification is successful, assuming that the selected accelerated game
- the software is the game software whose interface needs to be translated. Since the game software is accelerated through the accelerator, the accelerator can be used to translate the interface text of the game software selected for acceleration.
- FIG. 6 it shows a schematic diagram of an application scenario of another software translation method in an embodiment of the present disclosure.
- game software can be accelerated by an accelerator (here computer software has been installed)
- game software user 1 and game software user 2 can respectively run the accelerator to accelerate the game software
- the language environment of game software user 1 is language A
- the language environment of game software user 2 For language C, when the game software user 1 accelerates the computer software, he can directly accelerate the game software, and at this time, the interface text of language A is displayed on the accelerated game software interface; 2
- the first interface text setting code logic used for interface text setting can be implemented through the running accelerator Rewriting, that is, after translating the interface text of language A into language C through the code logic with translation function set in the first interface text setting code logic, and then translating the translated interface through the second interface text
- the text that needs to be displayed on the UI is obtained by rewriting the call of the UI component text setting API, which eliminates the analysis, translation, modification, and replacement of the additional language resource package of the software, and dynamically obtains the software UI in real time
- Translating the content that needs to be displayed on the interface can fully translate the UI language of a software; in addition, the use of machine translation and manual proofreading can ensure the speed of the translation process and the accuracy of the translation results.
- this solution has a general usage scenario, and will not be limited by the proprietary UI or business logic of the software itself, and does not need to analyze and understand the UI or business logic of the software , there is no need to consider the verification mechanism of the software for the language resource package.
- FIG. 7 shows a structural block diagram of an embodiment of a software translation device of the present disclosure, which may specifically include the following modules:
- the software program running module 701 is configured to execute and run the target software program, and determine the target file in the target software program, wherein the target file includes the first interface text setting code logic;
- the original text information translation module 702 is configured to execute the code logic with translation function set in the first interface text setting code logic, and translate the original text information in the software interface through the code logic with translation function to Get the target text information;
- the interface text display module 703 is configured to execute the code logic of setting the second interface text to display the corresponding software interface according to the target text information.
- the original text information translation module 702 may include the following submodules:
- the code logic rewriting sub-module is configured to execute the code logic of rewriting the first interface text setting code using the code logic with translation function.
- the code logic rewriting submodule may include the following units:
- an interface function acquisition unit configured to execute the interface function in the logic of acquiring the first interface text setting code
- the interface function pointing unit is configured to perform an interception operation on the interface function used for setting the first interface text, and point the interface function used for setting the interface text to the rewritten code logic; the rewritten code
- the logic includes first interface text setting code logic of code logic with translation function.
- the interface text display module may include the following submodules:
- the interface text display submodule is configured to call back the interface function set by the second interface text to display the target software interface text corresponding to the target text information after executing the interception operation on the interface function set by the first interface text.
- the code logic rewriting submodule may include the following units:
- the code logic position determination unit is configured to determine the code logic position of the first interface text setting code logic in the code segment in the memory
- the code logic rewriting unit is configured to execute at the code logic position, and use the code logic with translation function to rewrite the first interface text setting code logic.
- the code logic location determination unit may include the following subunits:
- the interface text setting information acquisition subunit is configured to perform acquisition of interface text setting information for the target software program; the interface text setting information includes interface function information of the first interface text setting;
- the code logic position determination subunit is configured to perform static scanning analysis of function symbols on the target file of the target software program according to the interface function information, and determine the code segment of the first interface text setting code logic in the memory logical location.
- the code logic rewriting unit may include the following subunits:
- the code logic location determination subunit is configured to determine the code logic location to be modified according to the code logic location of the code segment in the memory according to the code logic location of the code logic set in the first interface text when running the target software program and loading the preset dynamic link library ;
- the code logic rewriting subunit is configured to modify the first interface text setting code logic at the code logic position that needs to be modified, and replace it with code logic that has a translation function.
- the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
- An embodiment of the present disclosure also provides an electronic device, including:
- It includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor.
- the computer program When the computer program is run by the processor, the following method steps are implemented:
- a corresponding software interface is displayed according to the target text information through the second interface text setting code logic.
- setting code logic with a translation function in the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- said rewriting said first interface text setting code logic by using said code logic with translation function includes:
- the rewritten code logic includes the first interface text setting of the code logic with translation function code logic.
- said setting code logic through the second interface text to display a corresponding software interface according to the target text information, including:
- the interface function set in the second interface text is called back to display the target software interface text corresponding to the target text information.
- using the code logic with translation function to rewrite the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- the determining the code logic position of the first interface text setting code logic in the code segment of the memory includes:
- the interface text setting information includes interface function information set by the first interface text
- the target file of the target software program is statically scanned and analyzed for function symbols, and the code logic position of the code segment of the first interface text setting code logic in the memory is determined.
- the translating the original text information in the software interface through the code logic with translation function to obtain the target text information includes:
- the code logic position of the code segment in the internal memory is set according to the first interface text to determine the code logic position to be modified
- the target software program can be run, and the code logic with translation function is set in the first interface text setting code logic of the target software program, and the original text information in the software interface is processed by the code logic with translation function.
- Translate and then set the code logic through the second interface text to display the corresponding software interface according to the target text information, so as to realize the translation and display of the software interface text when running the software program.
- the international translation of computer software can be realized based on the inserted code logic with translation function, reducing the use threshold caused by language barriers , so that the use of computer software can efficiently adapt to the language environment and habits of computer software users, and improve the computer software users' experience in using the software.
- An embodiment of the present disclosure also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the following method steps are implemented:
- a corresponding software interface is displayed according to the target text information through the second interface text setting code logic.
- setting code logic with a translation function in the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- said rewriting said first interface text setting code logic by using said code logic with translation function includes:
- the rewritten code logic includes the first interface text setting of the code logic with translation function code logic.
- said setting code logic through the second interface text to display a corresponding software interface according to the target text information, including:
- the interface function set in the second interface text is called back to display the target software interface text corresponding to the target text information.
- using the code logic with translation function to rewrite the first interface text setting code logic includes:
- the code logic with the translation function is used to rewrite the code logic of the first interface text setting.
- the determining the code logic position of the first interface text setting code logic in the code segment of the memory includes:
- the interface text setting information includes interface function information set by the first interface text
- the target file of the target software program is statically scanned and analyzed for function symbols, and the code logic position of the code segment of the first interface text setting code logic in the memory is determined.
- the translating the original text information in the software interface through the code logic with translation function to obtain the target text information includes:
- the code logic position of the code segment in the internal memory is set according to the first interface text to determine the code logic position to be modified
- the target software program can be run, and the code logic with translation function is set in the first interface text setting code logic of the target software program, and the original text information in the software interface is processed by the code logic with translation function.
- Translate and then set the code logic through the second interface text to display the corresponding software interface according to the target text information, so as to realize the translation and display of the software interface text when running the software program.
- the international translation of computer software can be realized based on the inserted code logic with translation function, reducing the use threshold caused by language barriers , so that the use of computer software can efficiently adapt to the language environment and habits of computer software users, and improve the computer software users' experience in using the software.
- FIG. 8 shows a structural block diagram of a computer-readable storage medium according to an embodiment of the present disclosure.
- a computer program can be stored on the computer-readable storage medium 801, wherein the computer program can realize the above-mentioned software translation when executed by a processor.
- Each process of the method embodiment can achieve the same technical effect, and will not be repeated here to avoid repetition.
- embodiments of the present disclosure may be provided as methods, apparatuses, or computer program products. Accordingly, embodiments of the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- Embodiments of the present disclosure are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing terminal equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing terminal equipment Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
- These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Stored Programmes (AREA)
Abstract
Description
Claims (10)
- 一种软件翻译方法,其中,所述方法包括:运行目标软件程序,确定所述目标软件程序中的目标文件,其中,所述目标文件中包括第一界面文本设置代码逻辑;在第一界面文本设置代码逻辑中设置具有翻译功能的代码逻辑,通过所述具有翻译功能的代码逻辑对所述软件界面中的原始文本信息进行翻译以得到目标文本信息;通过第二界面文本设置代码逻辑根据所述目标文本信息展示相应的软件界面。
- 根据权利要求1所述的方法,其中,所述在第一界面文本设置代码逻辑中设置具有翻译功能的代码逻辑,包括:采用所述具有翻译功能的代码逻辑改写所述第一界面文本设置代码逻辑。
- 根据权利要求2所述的方法,其中,所述采用所述具有翻译功能的代码逻辑改写所述第一界面文本设置代码逻辑,包括:获取所述第一界面文本设置代码逻辑中的接口函数;对所述第一界面文本设置的接口函数进行拦截操作,将所述第一界面文本设置指向改写后的代码逻辑;所述改写后的代码逻辑包括具有翻译功能的代码逻辑的第一界面文本设置代码逻辑。
- 根据权利要求3所述的方法,其中,所述通过第二界面文本设置代码逻辑根据所述目标文本信息展示相应的软件界面,包括:在对第一界面文本设置的接口函数的拦截操作之后,回调第二界面文本设置的接口函数展示与目标文本信息相应的目标软件界面文本。
- 根据权利要求2所述的方法,其中,采用所述具有翻译功能的代码逻辑改写所述第一界面文本设置代码逻辑,包括:确定所述第一界面文本设置代码逻辑在内存中代码段的代码逻辑位置;在所述代码逻辑位置,采用所述具有翻译功能的代码逻辑对所述第一界面文本设置代码逻辑进行改写。
- 根据权利要求5所述的方法,其中,所述确定所述第一界面文本设置代码逻辑在内存中代码段的代码逻辑位置,包括:获取针对所述目标软件程序的界面文本设置信息;所述界面文本设置信息包括第一界面文本设置的接口函数信息;根据所述接口函数信息对所述目标软件程序的目标文件进行函数符号静态扫描分析,确定所述第一界面文本设置代码逻辑在内存中代码段的代码逻辑位置。
- 根据权利要求6所述的方法,其中,所述在所述代码逻辑位置,采用所述具有翻译功能的代码逻辑对所述第一界面文本设置代码逻辑进行改写,包括:在运行所述目标软件程序加载预设动态链接库时,根据第一界面文本设置在内存中代码段的代码逻辑位置确定需要修改的代码逻辑位置;在所述需要修改的代码逻辑位置对所述第一界面文本设置代码逻辑进行修改,并替换为具有翻译功能的代码逻辑。
- 一种软件翻译装置,所述装置包括:软件程序运行模块,被配置为执行运行目标软件程序,确定所述目标软件程序中的目标文件,其中,所述目标文件中包括第一界面文本设置代码逻辑;原始文本信息翻译模块,被配置为执行在第一界面文本设置代码逻辑中设置具有翻译功能的代码逻辑,通过所述具有翻译功能的代码逻辑对所述软件界面中的原始文本信息进行翻译以得到目标文本信息;界面文本展示模块,被配置为执行通过第二界面文本设置代码逻辑根据所述目标文本信息展示相应的软件界面。
- 一种电子设备,包括:处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器运行时实现如权利要求1-7中任一项所述软件翻译方法的步骤。
- 一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器运行时实现如权利要求1至7中任一项所述软件翻译方法的步骤。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/547,514 US12517708B2 (en) | 2021-06-10 | 2022-03-24 | Method for software translation, electronic device, and non-transitory computer-readable storage medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110649646.2A CN113342437B (zh) | 2021-06-10 | 2021-06-10 | 一种软件翻译方法和装置 |
| CN202110649646.2 | 2021-06-10 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022257554A1 true WO2022257554A1 (zh) | 2022-12-15 |
Family
ID=77476633
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/082870 Ceased WO2022257554A1 (zh) | 2021-06-10 | 2022-03-24 | 一种软件翻译方法和装置 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US12517708B2 (zh) |
| CN (1) | CN113342437B (zh) |
| WO (1) | WO2022257554A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113342437B (zh) * | 2021-06-10 | 2023-03-24 | 网易(杭州)网络有限公司 | 一种软件翻译方法和装置 |
| CN113918261B (zh) * | 2021-10-19 | 2025-08-19 | 北京沃东天骏信息技术有限公司 | 多语言适配方法、装置、设备和存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2001088704A1 (en) * | 2000-05-16 | 2001-11-22 | Eurocity Online | Real time translation of user interfaces in an arbitrary application |
| CN105138350A (zh) * | 2015-07-29 | 2015-12-09 | 北京四方继保自动化股份有限公司 | 一种组态软件国际化多语言的实现方法 |
| US20190188004A1 (en) * | 2017-12-15 | 2019-06-20 | Citrix Systems, Inc. | Software application dynamic linguistic translation system and methods |
| CN113342437A (zh) * | 2021-06-10 | 2021-09-03 | 网易(杭州)网络有限公司 | 一种软件翻译方法和装置 |
Family Cites Families (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0635710A (ja) * | 1992-07-21 | 1994-02-10 | Nec Corp | 汎用コンピュータオンラインプログラムにおける翻訳名称取得方法 |
| US5678039A (en) * | 1994-09-30 | 1997-10-14 | Borland International, Inc. | System and methods for translating software into localized versions |
| IL127073A0 (en) * | 1998-11-15 | 1999-09-22 | Tiktech Software Ltd | Software translation system and method |
| US20030058267A1 (en) * | 2000-11-13 | 2003-03-27 | Peter Warren | Multi-level selectable help items |
| EP1423842A4 (en) * | 2001-06-30 | 2007-05-09 | Cokinetics Systems | INTERNET INTERFACE AND INTEGRATION LANGUAGE SYSTEM AND METHOD |
| US20030110478A1 (en) * | 2001-11-21 | 2003-06-12 | Evelyn Duesterwald | Portable run-time code synthesis in a caching dynamic translator |
| ITUD20060067A1 (it) * | 2006-03-15 | 2007-09-16 | D Agostini Organizzazione Srl | Metodo e sistema di velocizzazione della traduzione automatica al computer |
| US9170826B2 (en) * | 2012-12-17 | 2015-10-27 | Sap Se | Common multi-language text management in a business-oriented software framework |
| US20140189310A1 (en) * | 2012-12-27 | 2014-07-03 | Nvidia Corporation | Fault detection in instruction translations |
| US9767210B2 (en) * | 2013-03-28 | 2017-09-19 | International Business Machines Corporation | Dynamically enhancing user interface |
| US9256546B2 (en) * | 2014-03-31 | 2016-02-09 | International Business Machines Corporation | Transparent code patching including updating of address translation structures |
| CN109284145A (zh) * | 2018-08-28 | 2019-01-29 | 北京城市网邻信息技术有限公司 | 多语言配置文件的生成和展示方法及装置、设备和介质 |
| CN110909552B (zh) * | 2018-09-14 | 2023-05-30 | 阿里巴巴集团控股有限公司 | 翻译方法及装置 |
| CN110134404A (zh) * | 2019-04-12 | 2019-08-16 | 深圳壹账通智能科技有限公司 | 代码翻译方法、装置、计算机设备和存储介质 |
| CN110134397A (zh) * | 2019-04-12 | 2019-08-16 | 深圳壹账通智能科技有限公司 | 代码片段翻译方法、装置、计算机设备和存储介质 |
| US11301643B2 (en) * | 2019-12-02 | 2022-04-12 | Sap Se | String extraction and translation service |
-
2021
- 2021-06-10 CN CN202110649646.2A patent/CN113342437B/zh active Active
-
2022
- 2022-03-24 WO PCT/CN2022/082870 patent/WO2022257554A1/zh not_active Ceased
- 2022-03-24 US US18/547,514 patent/US12517708B2/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2001088704A1 (en) * | 2000-05-16 | 2001-11-22 | Eurocity Online | Real time translation of user interfaces in an arbitrary application |
| CN105138350A (zh) * | 2015-07-29 | 2015-12-09 | 北京四方继保自动化股份有限公司 | 一种组态软件国际化多语言的实现方法 |
| US20190188004A1 (en) * | 2017-12-15 | 2019-06-20 | Citrix Systems, Inc. | Software application dynamic linguistic translation system and methods |
| CN113342437A (zh) * | 2021-06-10 | 2021-09-03 | 网易(杭州)网络有限公司 | 一种软件翻译方法和装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| US20240053967A1 (en) | 2024-02-15 |
| CN113342437A (zh) | 2021-09-03 |
| US12517708B2 (en) | 2026-01-06 |
| CN113342437B (zh) | 2023-03-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111881401B (zh) | 基于WebAssembly的浏览器深度学习方法及系统 | |
| US9946525B2 (en) | Extracting source code | |
| CN113342436B (zh) | 一种游戏翻译方法和装置 | |
| US8347287B2 (en) | System and method for localizing a server application using a client-side translator | |
| US10846101B2 (en) | Method and system for starting up application | |
| US9495720B2 (en) | Method and apparatus for compiling and executing an application using virtualization in a heterogeneous system | |
| EP3035191B1 (en) | Identifying source code used to build executable files | |
| CN100476734C (zh) | 用于修改信息以从源语言变换为目标语言的方法和系统 | |
| CN107077337A (zh) | 用于执行根据两个指令集架构编译的应用编码的系统和方法 | |
| CN106815058A (zh) | 一种模拟器的识别方法和系统 | |
| CN112559453A (zh) | 一种数据入库方法、装置、电子设备和存储介质 | |
| US20170351506A1 (en) | Automating feature graduation | |
| CN103885814A (zh) | 在x86架构上运行ARM APK的模拟器装置和方法 | |
| CN113342437B (zh) | 一种软件翻译方法和装置 | |
| US11029924B2 (en) | Program optimization by converting code portions to directly reference internal data representations | |
| US9176714B2 (en) | Re-using legacy libraries in software | |
| KR20220036331A (ko) | 그래픽 함수들을 가상화하기 위한 가상 머신 | |
| US12360990B2 (en) | Transliteration of machine interpretable languages for enhanced compaction | |
| CN109062973A (zh) | 一种问答资源的挖掘方法、装置、服务器及存储介质 | |
| Xu et al. | A Framework to Run C/C++ Application on Web-based OS | |
| Lee et al. | Windows Server Automation with PowerShell Cookbook | |
| Liang et al. | A mobile integrated development environment for C programming | |
| CN117873482A (zh) | 智能合约的代码验证方法、装置、设备及存储介质 | |
| CN119807563A (zh) | 一种字体文件加载方法、装置、电子设备及存储介质 | |
| Kernel-to-userspace | Linux kernel |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22819159 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 18547514 Country of ref document: US |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22819159 Country of ref document: EP Kind code of ref document: A1 |
|
| WWG | Wipo information: grant in national office |
Ref document number: 18547514 Country of ref document: US |