Game interface text translation method and device
By replacing text resources before and after a hot update of the game program and translating function calls in a virtual environment, the problem of game hot update failure caused by static resource replacement is solved. This achieves efficient translation and compatibility of game interface text, improving translation efficiency and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU JUNYUN TECH CO LTD
- Filing Date
- 2026-03-20
- Publication Date
- 2026-04-17
AI Technical Summary
The existing static resource replacement method for translating game interface text prevents the game program from being hot-updated, affecting the normal updates and maintenance of the game.
Before and after a hot update of the game program, the original text resources of the old version are used to replace the target language text resources, and the original text resources of the new version are backed up after the hot update. At the same time, the text resources in the calling function are intercepted and translated through a virtual environment to achieve dynamic translation.
It achieves efficient translation of game interface text without affecting hot updates of the game program, has good compatibility, reduces translation and maintenance costs, and improves translation efficiency and user experience.
Smart Images

Figure CN121879807A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of game interface text translation, and in particular to a method and apparatus for translating game interface text. Background Technology
[0002] With the increasing popularity of cross-platform games, the demand for introducing high-quality overseas games into the domestic market has surged. However, most overseas games lack Chinese adaptation, creating a barrier for users whose native language is Chinese and restricting the market coverage of the games. At the same time, when game developers borrow from overseas works, language barriers also affect the efficiency of technical communication, making the need for translation of game interface text increasingly urgent.
[0003] In related technologies, static resource replacement is commonly used to translate game interface text. This involves unpacking, translating, repackaging, and replacing text resources so that the game program loads the replaced text resources during the resource loading phase to achieve the game interface text translation function. However, this method modifies the game files, making it impossible to complete file verification during hot updates, leading to game hot updates failing. Summary of the Invention
[0004] The main purpose of this application is to provide a method and apparatus for translating game interface text, which aims to solve the technical problem that the existing static resource replacement method for translating game interface text results in the inability to hot update the game program.
[0005] To achieve the above objectives, this application proposes a method for translating game interface text, including: Before hot-updating the target game program, replace the old version of the target language text resources with the original text resources of the old version. After the target game program is hot-updated, the original text resources of the new version are replaced with the new version of the target language text resources, and the original text resources of the new version are backed up.
[0006] In one embodiment, the method further includes: Send a version verification request to the server; Receive the update decision response sent by the server; When the update decision response indicates that an update is needed, a file download request is sent to the server; Receive a download response from the server, which carries the new version of the target language text resources and replacement rules.
[0007] In one embodiment, replacing the original text resource with a new version of the target language text resource includes: According to the replacement rules, the original text resources of the new version are replaced with the target language text resources of the new version.
[0008] Furthermore, to achieve the above objectives, this application proposes another method for translating game interface text, including: Run the target game program in a virtual environment and intercept the function calls made by the target game program during its execution; When the calling function is a target calling function carrying original text resource data, the original text resources in the target calling function are extracted; The extracted original text resources are translated to obtain target language text resources; Replace the original text resources in the target calling function with the target language text resources; Execute the target function call carrying the text data in the target language to display the text data in the target language in the game interface.
[0009] Furthermore, to achieve the above objectives, this application also proposes a game interface text translation device, comprising: The first replacement module is configured to replace the old version of the target language text resources with the old version's original text resources before the target game program undergoes a hot update. The second replacement module is configured to replace the original text resources of the new version with the new version of the target language text resources after the target game program is hot-updated, and to back up the original text resources of the new version.
[0010] Furthermore, to achieve the above objectives, this application also proposes a game interface text translation device, comprising: The function call interception module is configured to run the target game program in a virtual environment and intercept the function calls made by the target game program during its execution. The text extraction module is configured to extract the original text resources in the target function when the calling function is a target calling function carrying original text resource data; The text translation module is configured to translate the extracted original text resources to obtain target language text resources; The text replacement module is configured to replace the original text resources in the target calling function with the target language text resources; The function execution module is configured to execute a target function carrying text data in the target language to display the text data in the target language in the game interface.
[0011] One or more technical solutions proposed in this application have at least the following technical effects: A method for translating game interface text is proposed. Before the target game program is hot-updated, the old version of the original text resources are replaced with the old version of the target language text resources. After the target game program is hot-updated, the new version of the original text resources are replaced with the new version of the target language text resources, and the new version of the original text resources are backed up. This method can not only efficiently complete the translation of game interface text, but also does not affect the hot update of the game program. Attached Figure Description
[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0013] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0014] Figure 1 A flowchart illustrating the first embodiment of the game interface text translation method provided in this application; Figure 2 A flowchart illustrating the second embodiment of the game interface text translation method provided in this application.
[0015] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0016] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application. To better understand the technical solutions of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0017] This application provides a method for translating text in a game interface.
[0018] In the first embodiment of the game interface text translation method of this application, refer to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the game interface text translation method of this application. The game interface text translation method may include steps S102-S103: Step S102: Before hot updating the target game program, replace the old version of the target language text resources with the old version of the original text resources.
[0019] It's important to note that hot updates refer to a technical method where the game doesn't need to re-download the full installation package or uninstall and reinstall. During client operation or startup, incremental / full update resources are retrieved from the server via the network, and file verification, replacement, and loading are completed to achieve game version upgrades and content fixes / additions. An older version refers to a version prior to the latest version, which is also the version of the target game program in the current runtime environment. The current runtime environment can be a device terminal or a virtual environment. The target language text resources correspond to the versions of the original text resources; that is, the older version of the original text resources and the older version of the target language text resources belong to the same version. For example, the original text resources for game version 1.0 are configured with the target language text resources for game version 1.0.
[0020] Specifically, before the target game program undergoes a hot update, the client can obtain the version number of the target game program in the current running environment based on an automatic packet capture mechanism. Then, based on the version number of the target game program in the current running environment, it can match the original text resources with the same version number and use the original text resources to overwrite the target language text resources to restore the files. This allows the target game program to pass the text verification smoothly during the hot update.
[0021] Step S103: After the target game program is hot-updated, the original text resources of the new version are replaced with the target language text resources of the new version, and the original text resources of the new version are backed up.
[0022] It should be noted that the new version refers to the latest version of the target game program, and the target language text resource of the new version is the text resource corresponding to the original text resource of the latest version of the target game program.
[0023] The game interface text translation method in this embodiment replaces the old version of the target language text resources with the old version of the original text resources before the target game program is hot-updated; after the target game program is hot-updated, the new version of the original text resources are replaced with the new version of the target language text resources, and the new version of the original text resources are backed up. This method can not only efficiently complete the translation of the game interface text, but also does not affect the hot update of the game program.
[0024] In one feasible implementation, the acquisition of the new version of the target language text is based on the client. Specifically, the target game program is first hot-updated in the runtime environment, and then the original text resources of the new version are unpacked, translated, and repackaged to obtain the new version of the target language text resources.
[0025] In one feasible implementation, the method further includes step S101: Step S101: Send a version verification request to the server; receive an update decision response from the server; when the update decision response indicates that a version needs to be updated, send a file download request to the server; receive a download response from the server carrying the target language text resources and replacement rules of the new version.
[0026] Specifically, the client can be configured to periodically send a version verification request to the server in response to a user instruction. This version verification request carries the version number of the target game program in the current runtime environment. Upon receiving the version verification request from the client, the server compares the version number of the target game program in the current runtime environment with the latest version number of the target game program, and then sends an update decision response to the client. The update decision response can be configured to indicate whether a version needs updating or not. When the client receives the update decision response, and the update decision response indicates that a version needs updating, it sends a file download request to the server, so that the server can distribute the new version of the target language text resources and replacement rules. Accordingly, the step S103, "replacing the original text resources of the new version with the target language text resources of the new version," is configured to replace the original text resources of the new version with the target language text resources of the new version according to the replacement rules.
[0027] It should also be noted that the most common game engine is Unity. Game development using this engine typically follows a framework and specifications that separate resources from logic, and has the following characteristics: display text resources are generally placed in the game's local installation directory on the client, and the format is relatively fixed, such as using the .pak format; the game performs resource file version checks and dynamically downloads them to achieve hot updates at startup; the game generally uses relatively common methods for text rendering and display within the engine framework; therefore, the above-mentioned game interface text translation method is particularly suitable for games developed using the Unity engine.
[0028] The game interface text translation method of this embodiment generates the new version of the target language text and replacement rules on the server side. The client only needs to download the new version of the target language text and replacement rules to use it, which improves translation efficiency and user experience.
[0029] In the second embodiment of the game interface text translation method of this application, refer to Figure 2 , Figure 2 This is a flowchart illustrating the second embodiment of the game interface text translation method of this application. The game interface text translation method may include steps S201 to S205: Step S201: Run the target game program in the virtual environment and intercept the function calls made by the target game program during its execution.
[0030] Specifically, the target game program is run in a virtual environment, and its function call behavior is monitored. Before the function call is executed, the function call is intercepted.
[0031] Understandably, running the target game program in a virtual environment creates an independent memory isolation environment for the target game process, and all modifications only affect the memory space of that process without affecting local physical files.
[0032] Step S202: When the calling function is a target calling function carrying original text resource data, extract the original text resources from the target calling function.
[0033] Specifically, when a function call is intercepted, the type of the function call is determined. If the function call carries original text resources, it is identified as the target function call and the original text resources in the target function call are extracted.
[0034] Step S203: Translate the extracted original text resources to obtain target language text resources.
[0035] Specifically, after extracting the original text resources, they can be translated into target language text resources based on one of the following: a local thesaurus, a translation program, or a server-side translation.
[0036] Step S204: Replace the original text resource in the target calling function with the target language text resource.
[0037] Step S205: Execute the target call function carrying the text data of the target language to display the text data of the target language in the game interface.
[0038] In one feasible implementation, steps S201 to S205 above are achieved based on HOOK technology.
[0039] This embodiment of the game interface text translation method involves running a target game program in a virtual environment and intercepting the function calls during the program's execution. When a function call carries original text resource data, the original text resource is extracted from that function. The extracted original text resource is then translated to obtain target language text resources. These target language text resources replace the original text resources in the target function call. Finally, the target function call carrying the target language text data is executed to display the target language text data in the game interface, achieving this without modifying the original game text. This system offers highly compatible and non-intrusive dynamic translation of game interface text, operating entirely within a virtual environment. It bypasses game anti-cheat detection and file verification mechanisms, ensuring compatibility with game hot update processes. It accurately captures and replaces all function calls carrying text, enabling real-time translation of text across all scenarios. Furthermore, it eliminates the reliance on unpacking and repackaging game resource packages, avoiding the need to adapt to different game file formats and encryption rules. This significantly improves cross-game and cross-version compatibility, greatly reducing translation maintenance costs. It can also directly execute functions after translation to render the translated text, ensuring real-time translation and display integrity, while balancing translation quality, operational security, and version compatibility.
[0040] This application also provides a game interface text translation device, which may include: The first replacement module is configured to replace the old version of the target language text resources with the old version's original text resources before the target game program undergoes a hot update. The second replacement module is configured to replace the original text resources of the new version with the new version of the target language text resources after the target game program is hot-updated, and to back up the original text resources of the new version.
[0041] This application also provides another game interface text translation device, which may include: The function call interception module is configured to run the target game program in a virtual environment and intercept the function calls made by the target game program during its execution. The text extraction module is configured to extract the original text resources in the target function when the calling function is a target calling function carrying original text resource data; The text translation module is configured to translate the extracted original text resources to obtain target language text resources; The text replacement module is configured to replace the original text resources in the target calling function with the target language text resources; The function execution module is configured to execute a target function carrying text data in the target language to display the text data in the target language in the game interface.
[0042] The game interface text translation device provided in this application, employing the game interface text translation method described in the above embodiments, can solve the main technical problems. Compared with related technologies, the beneficial effects of the game interface text translation device provided in this application are the same as those of the game interface text translation method described in the above embodiments, and other technical features in this game interface text translation device are the same as those disclosed in the game interface text translation method described in the above embodiments, and will not be repeated here.
[0043] The above are only some embodiments of this application and do not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A game interface text translation method applied to a client, characterized in that, The method includes: Before hot-updating the target game program, replace the old version of the target language text resources with the original text resources of the old version. After the target game program is hot-updated, the original text resources of the new version are replaced with the new version of the target language text resources, and the original text resources of the new version are backed up.
2. The game interface text translation method of claim 1, wherein, The method further includes: Send a version verification request to the server; Receive the update decision response sent by the server; When the update decision response indicates that an update is needed, a file download request is sent to the server; Receive a download response from the server, which carries the new version of the target language text resources and replacement rules.
3. The game interface text translation method as described in claim 2, characterized in that, The process of replacing the original text resources with new versions of target language text resources includes: According to the replacement rules, the original text resources of the new version are replaced with the target language text resources of the new version.
4. A method for translating text in a game interface, characterized in that, The method includes: Run the target game program in a virtual environment and intercept the function calls made by the target game program during its execution; When the calling function is a target calling function carrying original text resource data, the original text resources in the target calling function are extracted; The extracted original text resources are translated to obtain target language text resources; Replace the original text resources in the target calling function with the target language text resources; Execute the target function call carrying the text data in the target language to display the text data in the target language in the game interface.
5. A game interface text translation device, characterized in that, The device includes: The first replacement module is configured to replace the old version of the target language text resources with the old version's original text resources before the target game program undergoes a hot update. The second replacement module is configured to replace the original text resources of the new version with the new version of the target language text resources after the target game program is hot-updated, and to back up the original text resources of the new version.
6. A game interface text translation device, characterized in that, The device includes: The function call interception module is configured to run the target game program in a virtual environment and intercept the function calls made by the target game program during its execution. The text extraction module is configured to extract the original text resources in the target function when the calling function is a target calling function carrying original text resource data; The text translation module is configured to translate the extracted original text resources to obtain target language text resources; The text replacement module is configured to replace the original text resources in the target calling function with the target language text resources; The function execution module is configured to execute a target function carrying text data in the target language to display the text data in the target language in the game interface.
Citation Information
Patent Citations
Copywriting translation method and device, terminal and storage medium
CN111241852A
Game translation method and device
CN113244624A
Game translation method and device
CN113342436A