A multilingual processing method and device, related equipment and storage medium

By generating and storing the element identifiers of interface elements and the relationship between the target text, the problem of multilingual processing in closed-source SDKs is solved, and the internationalization of multilingual interface elements is realized.

CN114721756BActive Publication Date: 2026-05-19TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-01-04
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

In existing technologies, closed-source SDKs cannot achieve multilingual processing by modifying the source code, which prevents the access party from providing multilingual support for the interface elements in the closed-source SDK.

Method used

By obtaining the interface element description information and original text from the target data package, element identifiers are generated, and the original text is modified in different language environments to form the target text, which is then stored in the memory to achieve multilingual switching.

Benefits of technology

It enables multilingual switching of UI elements in the closed-source SDK, meets the internationalization needs of the APP in different language environments, and provides basic internationalization capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114721756B_ABST
    Figure CN114721756B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a multilingual processing method and device, related equipment and a storage medium, which are mainly applied to multilingual processing of interface elements in SDK. The method obtains description information and original text of an interface element in a target data packet, generates an element identifier of the interface element according to the description information, the element identifier being used for uniquely identifying the interface element, modifies the original text in at least one language environment according to the description information to obtain a target text, associates the target text with the element identifier, and stores the association relationship in a storage, so that the terminal can find the target text corresponding to the element identifier according to the association relationship when responding to a multilingual switching processing operation. The multilingual switching processing of the SDK through the above method can provide technical support for the access party to perform multilingual processing on the interface elements in the SDK, and meet the demand of the access party for supporting multilingual applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a multilingual processing method, apparatus, related equipment, and storage medium. Background Technology

[0002] With the rapid development and widespread application of information technology, applications (APPs) are becoming increasingly internationalized. Taking Tencent QQ as an example, Chinese people are accustomed to using Chinese characters, so in China, the fonts used in Tencent QQ's user interface (UI) can be presented in Chinese; Americans are accustomed to using English, so in the United States, the fonts used in Tencent QQ's UI can be presented in English, and so on.

[0003] An app can call a Software Development Kit (SDK) to provide a user interface (UI). If the fonts in the app's UI can be displayed in multiple languages, it means that the elements in the SDK called by the app support multiple languages. If the SDK only supports one language, and it's open-source, the user can add multilingual processing code to enable the UI elements to be displayed in multiple languages. However, if the SDK is closed-source, since its source code is not open, the user cannot add multilingual functionality to the SDK elements by modifying the source code. Therefore, it is essential to study how to enable multilingual support for elements in closed-source SDKs. Summary of the Invention

[0004] This invention provides a multilingual processing method, apparatus, related equipment, and storage medium, which can provide technical support for the access party to switch interface elements in the SDK in multiple languages.

[0005] On one hand, embodiments of the present invention provide a multilingual processing method, including:

[0006] Obtain the target data packet, wherein the target data packet includes the description information of the interface elements in the original data packet corresponding to the target data packet and the original text of the interface elements;

[0007] Generate element identifiers for the interface elements based on their description information;

[0008] The original text is modified in at least one language environment according to the description information to obtain the modified text, wherein the modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages;

[0009] The element identifier is associated with the target text and stored in the memory.

[0010] On the one hand, embodiments of the present invention provide yet another multilingual processing method, including:

[0011] Perform a static scan on the original data packet to obtain the description information of the interface elements in the original data packet;

[0012] Run the original data package, and during the running of the original data package, extract the original text of the interface elements in the original data package to obtain the original text;

[0013] The description information and the original text are packaged into the original data packet to obtain the target data packet;

[0014] The target data packet is sent to the access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element. The access party modifies the original text in at least one language environment based on the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element. Different texts in the target text correspond to different languages. The access party associates the element identifier with the target text and stores it in the memory.

[0015] On one hand, embodiments of the present invention provide a multilingual processing device, including:

[0016] An acquisition unit is used to acquire a target data packet, the target data packet including the description information of the interface elements in the original data packet corresponding to the target data packet and the original text of the interface elements;

[0017] A processing unit, configured to generate an element identifier for the interface element based on the description information of the interface element;

[0018] The processing unit is further configured to modify the original text in at least one language environment according to the description information to obtain the modified text, wherein the modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages;

[0019] A storage unit is used to associate the element identifier with the target text and store it in a memory.

[0020] On one hand, embodiments of the present invention provide yet another multilingual processing apparatus, comprising:

[0021] A processing unit is used to perform static scanning on the original data packet to obtain description information of the interface elements in the original data packet.

[0022] The processing unit is also configured to run the original data packet, and during the running of the original data packet, to extract the original text of the interface elements in the original data packet to obtain the original text.

[0023] The processing unit is further configured to package the description information and the original text into the original data packet to obtain the target data packet;

[0024] A sending unit is configured to send the target data packet to an access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element, and the access party modifies the original text in at least one language environment based on the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages. The access party associates the element identifier with the target text and stores it in a memory.

[0025] On one hand, embodiments of the present invention provide a terminal, including:

[0026] A processor for executing one or more computer instructions;

[0027] A memory for storing a computer program, the computer program comprising one or more computer instructions, the one or more computer instructions being used to instruct the processor to load and execute the method as described in any one of claims 1-4.

[0028] On one hand, embodiments of the present invention provide a server, including:

[0029] A processor for executing one or more computer instructions;

[0030] A memory for storing a computer program, the computer program comprising one or more computer instructions, the one or more computer instructions being used to instruct the processor to load and execute the method as described in any one of claims 5-8.

[0031] In one aspect, embodiments of the present invention provide a computer storage medium, characterized in that the computer storage medium stores program instructions, which are loaded by a processor and executed as described in any of the preceding aspects of the multilingual processing method. Attached Figure Description

[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 This is a schematic diagram of a multilingual processing system architecture provided by an embodiment of the present invention;

[0034] Figure 2 This is a schematic diagram of a multilingual processing flow provided by an embodiment of the present invention;

[0035] Figure 3 This is a schematic diagram of a multilingual processing method provided in an embodiment of the present invention;

[0036] Figure 4 This is a schematic diagram illustrating the relationship between interface elements and target text provided in an embodiment of the present invention;

[0037] Figure 5 This is a schematic diagram of a multilingual switching process provided in an embodiment of the present invention;

[0038] Figure 6 This is a schematic diagram of another multilingual processing method provided in an embodiment of the present invention;

[0039] Figure 7 This is a schematic diagram of a JSON format file structure provided in an embodiment of the present invention;

[0040] Figure 8 This is a schematic diagram of the structure of a multilingual processing device provided in an embodiment of the present invention;

[0041] Figure 9 This is a schematic diagram of the structure of a multilingual processing device provided in an embodiment of the present invention;

[0042] Figure 10 This is a schematic diagram of the structure of a terminal provided in an embodiment of the present invention;

[0043] Figure 11 This is a schematic diagram of the structure of a server provided in an embodiment of the present invention. Detailed Implementation

[0044] This invention proposes a multilingual processing method, primarily applied to multilingual processing of interface elements in an SDK. The method obtains description information and original text of interface elements from a target data package, generating element identifiers for each element based on the description information. These element identifiers uniquely identify interface elements, meaning different interface elements have different element identifiers. The original text is then modified in at least one language environment based on the description information to obtain the target text. The target text is then associated with the element identifiers, and this association is stored in memory. Upon detecting a multilingual switching operation, the terminal responds by finding the target text in the target language using the element identifier corresponding to the interface element requiring multilingual switching, and then displays the target text on the UI page.

[0045] The target data package includes description information of interface elements and original text of the interface elements in the original data package corresponding to the target data package. The original data package can be understood as an SDK including a UI page. The SDK can be either an open-source SDK (i.e., an open-source SDK) or a closed-source SDK (i.e., an SDK that is not open-source). For example, an open-source SDK for WeChat Pay containing the WeChat Pay interface, and a closed-source SDK for WeChat Login containing the WeChat Login interface. The interface elements can be understood as various components on the UI page, such as background images, buttons, input boxes, text boxes, etc. The description information can be understood as basic information of the interface elements, such as initial identifier, page position (coordinates), window position, etc. The original text can be understood as the text content on buttons or images, etc. The target text consists of original text and modified text, and the language used in the modified text is at least one other language besides the language used in the original text. Therefore, the target text includes text corresponding to at least two languages.

[0046] For example, assuming the original data package is a closed-source SDK containing the WeChat login function of the WeChat login interface, the interface elements can be, for example, icons, input boxes, login interface background images and buttons, etc.; the original text can be the text on the button, such as the word "Login", or it can be the text prompt message in the input box, such as "Please enter password" in the password input box; the target language can be English, Japanese, Spanish, German, French, etc.

[0047] In one embodiment, the target data package may further include an interface. The SDK access party (hereinafter referred to as the access party) can perform multilingual switching processing on the interface elements in the SDK (target data package) through the interface. The multilingual switching processing can be understood as performing language switching operations on the text of the interface elements. Specifically, when the access party detects a call operation to the interface, it determines the target language and the element identifier of the interface element that needs to perform multilingual switching processing. Then, based on the association stored in the memory, it obtains the target text in the target language corresponding to the element identifier. Finally, it renders and displays the target text on the corresponding UI page.

[0048] This application embodiment performs multilingual processing on the interface elements in the SDK using the above method, enabling the terminal to find the target text through association and then perform multilingual switching on the interface elements, thus meeting the APP's need to present the content to the user in multiple languages ​​and providing a basic capability for the internationalization of the APP.

[0049] In one embodiment, the multilingual processing method can be applied to, for example... Figure 1 In the system shown, such as Figure 1 As shown, the system includes at least one terminal 101 and a server 102. The terminal 101 can establish a communication connection with the server 102.

[0050] The aforementioned terminals include, but are not limited to, smartphones, smart speakers, tablets, etc., and the aforementioned servers run a speech recognition model. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, etc., but are not limited to these. Terminals and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this connection.

[0051] In one embodiment, the target data packet of this application embodiment can be stored in a server (i.e., the SDK provider can be a server), and the terminal can be the access party. In this application scenario, the overall multilingual processing flow of the multilingual processing method can be found in [reference needed]. Figure 2As shown. The server performs a static scan of the original data packet to obtain the description information of the interface elements. During the execution of the original data packet, the server processes the assignment methods of the interface elements to extract the original text of the interface elements. Then, the server formats the description information and original text of the interface elements into JSON format to obtain a JSON file. Finally, the server packages the JSON file to obtain the target data packet and stores it on the server. The terminal can obtain the target data packet from the server. When the terminal detects an initialization operation for the target data packet, it runs the SDK to read the terminal's local files and then renders the UI page contained in the target data packet to obtain the rendered page. The terminal maps the description information of the interface elements to different language environments to obtain the element identifier of each interface element. The terminal modifies the original text of the interface elements in different language environments to obtain the association between the unique element identifier of the interface element and the target text corresponding to at least two languages, and stores the association in a global hash table. When the terminal detects an operation for multi-language switching, it enters the multi-language switching process and finally renders and displays the target text corresponding to the target language on the page.

[0052] Please see Figure 3 , Figure 3 This is a schematic diagram of a multilingual processing method provided in an embodiment of the present invention. For example... Figure 3 As shown, the method includes:

[0053] S301, Obtain the target data packet. The target data packet includes the description information and original text of the interface elements in the original data packet corresponding to the target data packet.

[0054] The terminal acquires the target data packet, initializes it, renders the UI pages corresponding to the interface elements within the target data packet, and caches the rendered UI pages in a global hash table. The target data packet includes description information and original text for the interface elements.

[0055] In a specific embodiment, the description information may include an initial identifier, page position, and window position, etc.; the original text may include text, button titles, image names, etc. For example, suppose the target data package includes a WeChat login function with a WeChat login interface, and the interface elements only include a login button. In the above case, the description information of the interface elements may specifically be the initial identifier btn01 of the login button, the page position (left: 100px, top: 150px), and the window position Fra01; the original text may be "Login".

[0056] S302, Generate element identifiers for interface elements based on their description information.

[0057] In one embodiment, the initial identifier in the description information is a unique identifier for the interface element. However, the initial identifier may be empty. In this case, other information is needed to help locate the interface element, such as the page position and window position. Therefore, to avoid the situation where the terminal cannot find the interface element by its initial identifier because it is empty, this embodiment of the invention maps the description information of the interface element to different language environments to obtain the element identifier of the interface element. Specifically, the mapping rule can be: concatenating the initial identifier of the interface element, inPage (page position), and frame (window position) to obtain a new field. This new field is the element identifier of the interface element, which is a unique identifier of the interface element during the execution of the target data packet, and this element identifier must not be empty.

[0058] For example, taking the login button mentioned above as an example, the element identifier of the login button obtained after the terminal processes the initial identifier btn01, page position (left: 100px, top: 150px), and window position Fra01 of the login button according to the mapping rules can be, for example, btn01Fra01. The element identifier btn0Fra01 is used to uniquely identify the login button mentioned above.

[0059] S303, Modify the original copy in at least one language environment based on the description information to obtain the modified copy, wherein the modified copy and the original copy constitute the target copy.

[0060] In one embodiment, the terminal modifies the original text in at least one language based on the description information to obtain the modified text in at least one language. The at least one language environment is provided by the terminal; specifically, the at least one language environment can be understood as at least one language supported by the application in the terminal.

[0061] In a specific embodiment, it is assumed that the original text is the two Chinese characters "登录" in the above login button, and the languages supported by the application are English and Japanese. In this case, modifying the original text in at least one language environment according to the description information can be understood as modifying the original Chinese text into English and Japanese texts. Accordingly, the target text can be understood as a set of texts corresponding to the three languages of Chinese, English, and Japanese. Specifically, in the above assumption, modifying the original text in at least one language environment according to the description information means translating the Chinese "登录" into the English text "Loginin" and the Japanese text "ログイン", and the target text is {"登录", "Login in", "ログイン"}.

[0062] In another embodiment, the above step S302 may also be executed after S303, and the embodiments of the present application do not limit the execution order of S302 and S303.

[0063] S304, associatively store the element identifier and the target text in a memory.

[0064] In one embodiment, as Figure 4 shown, after the terminal obtains the target text of the interface element, associate the element identifier of the interface element with the target text to obtain a one-to-many relationship table, and then generate a set according to the relationship table and the element identifier, and store this set in a global hash table. The terminal can use this global hash table to find the target text corresponding to the element identifier in any target language by any element identifier.

[0065] Specifically, there can be multiple one-to-many relationship tables. Here, it is assumed that there are two relationship tables. The content stored in relationship table 1 is the element identifier btn01Fra01 of the login button and the target copy in multiple languages corresponding to the element identifier. For example, the Chinese target copy "Login", the English target copy "Login in", and the Japanese target copy "ログイン"; the content stored in relationship table 2 is the element identifier btn02Fra01 of the cancel button and the copy in multiple languages corresponding to the element identifier. For example, the Chinese target copy "Cancel", the English target copy "Cancel", and the Japanese target copy "キャンセル". Then, the content stored in the global hash table can be understood as a set storing the association relationship between the element identifier and multiple target copies. For example: a set composed of the association relationship 1 between the element identifier btn01Fra01 and the target copies in Chinese, English, and Japanese, and the association relationship 2 between the element identifier btn02Fra01 and the target copies in Chinese, English, and Japanese. Assuming that the target language is Chinese, the terminal can find the "login button" and the corresponding Chinese copy "Login" of the login button in this table through the element identifier btn01Fra01, and can also find the "cancel button" and the corresponding Chinese copy "Cancel" of the cancel button through the element identifier btn02Fra01.

[0066] In the embodiment of the present application, by obtaining the target data packet, and then generating the association relationship between the element identifier of the interface element and the target copy in the terminal through the description information stored in the target data packet. When performing multi-language switching processing, the corresponding target copy can be directly obtained from the element identifier of the interface element, providing a basic ability for the APP to present to the user in multiple languages.

[0067] In another embodiment, the target data packet may further include an interface. As Figure 5 shown, Figure 5 is a schematic diagram of another multi-language processing method provided by the embodiment of the present invention. When the target data packet includes an interface and there is already an association relationship between the element identifier and the target copy in the terminal, the method further includes:

[0068] S501, monitor the interface through the observer mode to detect whether there is a call operation on the interface.

[0069] In one embodiment, the observer pattern is used to listen for multilingual switching events, specifically to listen for calls to an interface, which implements multilingual switching processing for UI elements. In a specific embodiment, if a monitored function is triggered in object A, and object B sets up a listener during the initialization of that function, then object B can detect the timing of the monitored function's execution. Specifically, since the terminal (object B) sets up a listener for the interface implementing multilingual switching processing during SDK initialization, the terminal can detect the timing of the multilingual switching operation when it is triggered during SDK (object A) runtime.

[0070] S502, when a call operation to the interface is detected, in response to the call operation to the interface, the element identifier of the interface element requesting multilingual switching processing and the target language are determined.

[0071] In one embodiment, when the terminal detects a call operation to an interface, the terminal can respond to the call operation to the interface in the target data packet and determine the target language transmitted by the interface and the element identifier of the interface element that needs to be processed for multilingual switching.

[0072] In a specific embodiment, taking the WeChat login function containing the WeChat login interface as the target data packet as an example, assuming the target data packet includes an interface, and it is now necessary to switch the original text in the WeChat login interface to English text. Then, the target language can be understood as English, and the interface element requiring multilingual switching can be understood as the login button. Therefore, when the terminal detects a call to the interface in the target data packet, the terminal uses English as the target language and obtains the element identifier btn01Fra01 of the login button.

[0073] S503, search the memory for the target text corresponding to the target language associated with the element identifier.

[0074] In one embodiment, after obtaining the target language and element identifier, the terminal searches for the target text corresponding to the element identifier in a global hash table. Specifically, taking the WeChat login function containing the WeChat login interface as the target data packet as an example, after obtaining the element identifier btn01Fra01, the terminal searches for the target text in the hash table and obtains the English text "Login in" corresponding to the element identifier.

[0075] S504: When the page to be rendered does not exist in the memory, render the page corresponding to the target text to obtain the rendered page.

[0076] In one embodiment, after initializing the target data packet, the terminal retrieves the loaded and rendered UI page from the global hash table, modifies the text corresponding to each interface element by traversing the view, and obtains the target text. If it is an unloaded and unrendered UI page, the terminal retrieves the language value (i.e., the target text in the target language) from the global hash table when the UI page is created, and loads and renders the UI page in the corresponding language when creating interface elements such as labels, buttons, and images, and obtains the rendered page.

[0077] In a specific embodiment, assuming that the language currently set in the application on the terminal is English, and the WeChat login interface is an unrendered interface, when the access party creates the WeChat login interface, it needs to retrieve the English text of the interface elements in the WeChat login interface from the global hash table. For example, it needs to retrieve the English text "Loginin" of the login button, and then render and display the WeChat login interface. The resulting rendered page is the WeChat login page presented in English.

[0078] S505 displays the rendered page corresponding to the target text.

[0079] The terminal will then display the rendered page.

[0080] This application embodiment modifies the original text of interface elements in the target data package by calling the interface in the target data package, and finally displays the UI page under the target text on the terminal. The above multilingual processing method meets the need for the APP to present itself to the user in multiple languages.

[0081] Please see Figure 6 , Figure 6 This is a multilingual processing method provided in an embodiment of the present invention, such as... Figure 6 As shown, the method includes:

[0082] S601, perform a static scan on the original data packet to obtain the description information of the interface elements in the original data packet.

[0083] The server performs a static scan of the original data packet to extract keywords. Based on these keywords, the server retrieves the corresponding interface elements and their descriptions. The original data packet includes source code, and the keywords can be understood as the type of interface element, such as labels, buttons, or images. The descriptions vary depending on the keywords.

[0084] For example, assuming the keyword for an interface element is "buttons", the description information of the interface element may be the initial identifier of the button, the window in which the button is located, the button coordinates, and the image displayed after it is pressed. Assuming the keyword for an interface element is "images", the description information of the interface element may be the initial identifier of the image, the image's URL (Uniform Resource Locator), the image name, and the image's location on the page, where the URL includes both local and network paths.

[0085] S602, run the original data package, and during the process of running the original data package, extract the original text of the interface elements in the original data package to obtain the original text.

[0086] The server runs the original data packet and, during the execution of the original data packet, intercepts the original text to obtain the original text. The server extracts and matches the original text with the languages ​​supported by the application in the terminal to obtain the modified text. The modified text and the original text together constitute the target text of the interface element, where different texts in the target text correspond to different languages.

[0087] In one embodiment, the text of labels and buttons, and the images of buttons and images, may be sent by the server. Therefore, the server cannot directly record the text when performing a static scan of the original data packet. In other words, the server cannot directly obtain the original text of the interface elements through static scanning. Therefore, the server needs to use method swizzling (dynamic method swapping, which swaps two methods occurring at runtime) to hook the system's original assignment methods during the runtime of the original data packet, in order to intercept the original text. Specifically, the intercepted original text could be, for example, the word "Login" on the login button in the WeChat login interface mentioned above, and the languages ​​supported by the application could be, for example, English and Japanese.

[0088] S603, package the description information and original text into the original data packet to obtain the target data packet.

[0089] The server performs JSON formatting on the captured original text and the aforementioned description information to obtain a JSON file. The server stores the JSON file in the original data packet to obtain the target data packet, and then stores the target data packet on the server for use by the terminal.

[0090] In one embodiment, the JSON formatted file can be found here. Figure 7As shown. The content of the JSON format file is generated from the static scan results (i.e., generated from the description information). The scanned file content consists of files of type .m that are subclasses of viewController and UIView. During the static scan performed on the server, commented-out code in the source code is filtered to prevent the generation of dirty data. The outer data of the JSON format file information is an object structure containing label, button, and image nodes (i.e., containing keywords), and the data structure of the outer data is an array.

[0091] In a specific embodiment, it is assumed that the original data packet in the server includes the WeChat login interface, and the keywords obtained by the server through static scanning are "buttons" and "images". The array containing "buttons" includes two button elements: a cancel button and a login button. The array containing "images" includes one image element: the login page background image. In this case, the JSON file contains "buttons" and "images" nodes. The content stored in the "buttons" array can be, for example: the initial identifier (btn01) and coordinates (left: 200px, top: 150px) of the login button, and the initial identifier (btn02) and coordinates (left: 100px, top: 150px) of the cancel button. The content stored in the "images" array can be, for example: the initial identifier (img01) of the background image, the image's position information on the page (left: 1px, top: 1px), and the image name (bkgImg).

[0092] In another embodiment, the server may also add an interface to the original data packet to obtain the target data packet. The interface enables the access party (terminal) to run the multilingual processing function of the target data packet when the interface is invoked. Specifically, a parameter supporting multilingual processing function is added to the initialization method of the original data packet to achieve the addition of the interface to the original data packet.

[0093] S604, the target data packet is sent to the access party so that the access party generates the element identifier of the interface element according to the description information of the interface element. The access party modifies the original text in at least one language environment according to the description information to obtain the modified text. The access party associates the element identifier and the target text and stores them in the memory.

[0094] In one embodiment, the server sends the target data packet to the terminal, causing the terminal to execute steps S301 to S304 based on the target data packet. Therefore, some feasible implementations included in step S604 have already been... Figure 3 The relevant steps will be described in detail below, and will not be repeated here.

[0095] This application embodiment performs multilingual processing on the original data packet using the above method to obtain a target data packet for use by the access party. This allows the access party to switch the original text of the interface elements in the target data packet to the target text (i.e., enables the access party to perform multilingual switching processing on the interface elements in the SDK), which meets the access party's need for the application to support multiple languages ​​and provides a basic capability for the internationalization of the application.

[0096] Based on the description of the above-described multilingual processing method embodiments, this invention also discloses a multilingual processing apparatus, which may be a computer program (including program code) running on the aforementioned server. This multilingual processing apparatus can execute... Figure 3 and Figure 5 The method shown. Please refer to [link / reference]. Figure 8 The multilingual processing device may include the following units:

[0097] Acquisition unit 801 is used to acquire a target data packet, the target data packet including the description information of the interface elements in the original data packet corresponding to the target data packet and the original text of the interface elements;

[0098] Processing unit 802, the processing unit 802 is used to generate element identifiers of interface elements based on the description information of the interface elements;

[0099] The processing unit 802 is further configured to modify the original text in at least one language environment according to the description information to obtain the modified text, wherein the modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages;

[0100] Storage unit 803 is used to associate the element identifier with the target text and store it in the memory.

[0101] According to another embodiment of the present invention, Figure 8 The units in the multilingual processing device shown are divided based on logical functions. These units can be individually or entirely merged into one or more other units, or some of the units can be further divided into functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of the present invention. In other embodiments of the present invention, the multilingual processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and multiple units can collaborate to achieve them.

[0102] According to another embodiment of the present invention, the following can be performed by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 3 and Figure 5 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 8 The multilingual processing apparatus shown herein, and the multilingual processing method for implementing embodiments of the present invention, are described. The computer program may be recorded on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0103] The multilingual processing device in this embodiment of the invention can be used to perform the above-described... Figure 3 and Figure 5 The technical solutions in the corresponding method embodiments are similar in principle and technical effect, and will not be described again here.

[0104] Based on the description of the above embodiments of the multilingual processing method, this invention also discloses another multilingual processing apparatus, which may be a computer program (including program code) running on the aforementioned server. This multilingual processing apparatus can execute... Figure 6 The method shown. Please refer to [link / reference]. Figure 9 The multilingual processing device may include the following units:

[0105] Processing unit 901 is used to perform static scanning on the original data packet to obtain description information of interface elements in the original data packet;

[0106] The processing unit 901 is also used to run the original data packet, and during the running of the original data packet, to extract the original text of the interface elements in the original data packet to obtain the original text.

[0107] The processing unit 901 is further configured to package the description information and the original text into the original data packet to obtain the target data packet;

[0108] The sending unit 902 is configured to send the target data packet to the access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element, and the access party modifies the original text in at least one language environment based on the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages. The access party associates the element identifier with the target text and stores it in a memory.

[0109] According to another embodiment of the present invention, Figure 9 The units in the multilingual processing device shown are divided based on logical functions. These units can be individually or entirely merged into one or more other units, or some of the units can be further divided into functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of the present invention. In other embodiments of the present invention, the multilingual processing device may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and multiple units can collaborate to achieve them.

[0110] According to another embodiment of the present invention, the following can be performed by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM). Figure 6 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 9 The multilingual processing apparatus shown herein, and the multilingual processing method for implementing embodiments of the present invention, are described. The computer program may be recorded on, for example, a computer storage medium, loaded onto the aforementioned computing device via the computer storage medium, and run therein.

[0111] The multilingual processing device in this embodiment of the invention can be used to perform the above-described... Figure 6 The technical solutions in the corresponding method embodiments are similar in principle and technical effect, and will not be described again here.

[0112] Based on the descriptions of the method and device embodiments above, this invention also provides a terminal. Please refer to... Figure 10 The terminal includes at least a processor 1001, an input interface 1002, an output interface 1003, and a computer storage medium 1004, and the processor 1001, input interface 1002, output interface 1003, and computer storage medium 1004 in the terminal can be connected by a bus or other means.

[0113] The computer storage medium 1004 is a memory device in the terminal used to store programs and data. It is understood that the computer storage medium 1004 can include the terminal's built-in storage medium, or it can include extended storage media supported by the terminal. The computer storage medium 1004 provides storage space, which stores the terminal's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by the processor 1001. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium can be high-speed RAM, or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor. The processor 1001 (or CPU (Central Processing Unit)) is the terminal's computing and control core, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions.

[0114] In one embodiment, the processor 1001 may load and execute one or more instructions stored in the computer storage medium 1004 to implement the aforementioned related instructions. Figure 3 and Figure 5 The corresponding method steps in the multilingual processing method embodiment shown; in specific implementation, one or more instructions in the computer storage medium 1004 are loaded by the processor 1001 and executed as follows:

[0115] Obtain the target data packet, wherein the target data packet includes the description information of the interface elements in the original data packet corresponding to the target data packet and the original text of the interface elements;

[0116] Generate element identifiers for the interface elements based on their description information;

[0117] The original text is modified in at least one language environment according to the description information to obtain the modified text, wherein the modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages;

[0118] The element identifier is associated with the target text and stored in the memory.

[0119] The terminal in this embodiment of the invention can be used to perform the above-described... Figure 3 and Figure 5 The technical solutions in the corresponding method embodiments are similar in principle and technical effect, and will not be described again here.

[0120] Based on the descriptions of the method and apparatus embodiments above, this invention also provides a server. Please refer to... Figure 11 The server includes at least a processor 1101, an input interface 1102, an output interface 1103, and a computer storage medium 1104. The processor 1101, input interface 1102, output interface 1103, and computer storage medium 1104 within the server can be connected via a bus or other means.

[0121] The computer storage medium 1104 is a memory device in the server used to store programs and data. It is understood that the computer storage medium 1104 can include the server's built-in storage medium, or it can include extended storage media supported by the server. The computer storage medium 1104 provides storage space that stores the server's operating system. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by the processor 1101. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor. The processor 1101 (or CPU (Central Processing Unit)) is the server's computing and control core, suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to achieve corresponding method flows or corresponding functions.

[0122] In one embodiment, the processor 1101 may load and execute one or more instructions stored in the computer storage medium 1104 to implement the aforementioned related... Figure 6 The corresponding method steps in the multilingual processing method embodiment shown; in specific implementation, one or more instructions in the computer storage medium 1104 are loaded by the processor 1101 and executed as follows:

[0123] Perform a static scan on the original data packet to obtain the description information of the interface elements in the original data packet;

[0124] Run the original data package, and during the running of the original data package, extract the original text of the interface elements in the original data package to obtain the original text;

[0125] The description information and the original text are packaged into the original data packet to obtain the target data packet;

[0126] The target data packet is sent to the access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element. The access party modifies the original text in at least one language environment based on the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element. Different texts in the target text correspond to different languages. The access party associates the element identifier with the target text and stores it in the memory.

[0127] The server in this embodiment of the invention can be used to execute the technical solutions in the method embodiments corresponding to 6 above. Its implementation principle and technical effect are similar, and will not be repeated here.

[0128] This application also provides a computer storage medium storing a computer program for the aforementioned multilingual processing method. The computer program includes program instructions. When one or more processors load and execute these program instructions, the multilingual processing method described in the embodiments can be implemented, and will not be repeated here. The beneficial effects of using the same method will also not be repeated here. It is understood that the program instructions can be deployed on one or more devices capable of communicating with each other.

[0129] Furthermore, it should be understood that the above-disclosed embodiments are merely preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.

Claims

1. A multilingual processing method, characterized in that, Applied to the access party, the method includes: A target data package is obtained, comprising description information of interface elements and original text of the interface elements in the original data package corresponding to the target data package; the description information of the interface elements is obtained by statically scanning the original data package to extract keywords from the original data package and obtaining the original text based on the keywords; the original text is obtained by running the original data package and, during the running of the original data package, using a dynamic method to hook the original assignment method of the system to intercept the original text of the interface elements in the original data package; the target data package is obtained by packaging the description information and the original text into the original data package. The element identifier of the interface element is generated based on the description information of the interface element; the original data package is a software development kit (SDK), which can be an open-source SDK or a closed-source SDK. The original text is modified in at least one language environment according to the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element. Different texts in the target text correspond to different languages. The at least one language is provided by the access party. The modification is used to add text in at least one language environment based on the language provided by the access party. Each language in the at least one language is different from the language corresponding to the original text. The element identifier is associated with the target text and stored in the memory; Determine the element identifier and target language of the UI element requesting multilingual switching; Search the memory for the text corresponding to the target language associated with the element identifier; Display the rendered page corresponding to the text.

2. The method according to claim 1, characterized in that, The target data packet includes an interface; the element identifier and target language of the interface element requesting multilingual switching processing include: In response to a call to the interface, the element identifier and target language of the interface element requesting multilingual switching are determined.

3. The method according to claim 2, characterized in that, Before determining the element identifier and target language of the interface element requesting multilingual switching processing in response to a call to the interface, the method further includes: The interface is monitored using the observer pattern to detect whether there are any calls to the interface. When a call to the interface is detected, the element identifier and target language of the interface element that triggers the multilingual switching process are determined.

4. The method according to claim 2, characterized in that, After searching the memory for the target text corresponding to the target language associated with the element identifier, the method further includes: When the rendering page does not exist in the memory, the page corresponding to the target text is rendered to obtain the rendering page; When the rendering page exists in the memory, the rendering page is retrieved from the memory.

5. A multilingual processing method, characterized in that, include: Perform a static scan on the raw data packets to extract keywords from them; Obtain the description information of the interface element corresponding to the keyword from the original data packet; Run the original data package, and during the running of the original data package, use dynamic methods to hook the original assignment method of the system to extract the original text of the interface elements in the original data package and obtain the original text. The description information and the original text are packaged into the original data packet to obtain the target data packet; The target data packet is sent to the access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element. The access party modifies the original text in at least one language environment based on the description information to obtain the modified text. The modified text and the original text constitute the target text of the interface element. Different texts in the target text correspond to different languages. The access party stores the element identifier and the target text in a memory. When the element identifier of the interface element requesting multilingual switching processing and the target language are determined, the access party can find the text corresponding to the target language associated with the element identifier through the memory and display the rendered page corresponding to the text. The original data packet is a software development kit (SDK), which can be an open-source or closed-source SDK; the at least one language is provided by the access party, and the modification is used to add text in at least one language environment based on the language provided by the access party, wherein each of the at least one languages ​​is different from the language corresponding to the original text.

6. The method according to claim 5, characterized in that, Before sending the target data packet to the access party, the method further includes: An interface is added to the original data packet to obtain the target data packet, so that the access party can run the multilingual processing function of the target data packet when calling the interface.

7. The method according to claim 6, characterized in that, The step of adding an interface to the original data packet to obtain the target data packet includes: A parameter supporting multilingual processing is added to the initialization method of the original data packet to enable the addition of the interface to the original data packet.

8. A multilingual processing device, characterized in that, The device, located at the access point, includes: An acquisition unit is configured to acquire a target data packet, the target data packet including description information of interface elements and original text of the interface elements in the original data packet corresponding to the target data packet; the description information of the interface elements is obtained by statically scanning the original data packet to extract keywords from the original data packet, and obtaining the original text based on the keywords in the original data packet; the original text is obtained by running the original data packet and, during the running of the original data packet, using a dynamic method to hook the original assignment method of the system to intercept the original text of the interface elements in the original data packet; the target data packet is obtained by packaging the description information and the original text into the original data packet. The processing unit is configured to generate an element identifier for the interface element based on the description information of the interface element; the original data package is a software development kit (SDK), which may be an open-source SDK or a closed-source SDK. The processing unit is further configured to modify the original text in at least one language environment according to the description information to obtain the modified text, wherein the modified text and the original text constitute the target text of the interface element, and different texts in the target text correspond to different languages; the at least one language is provided by the access party, and the modification is used to add text in at least one language environment based on the language provided by the access party, wherein each language in the at least one language is different from the language corresponding to the original text; A storage unit, wherein the storage unit is used to associate the element identifier with the target text and store it in the memory; The processing unit is further configured to determine the element identifier and target language of the interface element requesting multilingual switching; search the memory for the text corresponding to the target language associated with the element identifier; and display the rendered page corresponding to the text.

9. A multilingual processing terminal, characterized in that, include: A processor for executing one or more computer instructions; A memory for storing a computer program, the computer program comprising one or more computer program instructions, the one or more computer program instructions being used to instruct the processor to load and execute the multilingual processing method as described in any one of claims 1-4.

10. A multilingual processing device, characterized in that, include: A processing unit is configured to perform a static scan on the original data packet to extract keywords from the original data packet; Obtain the description information of the interface element corresponding to the keyword from the original data packet; The processing unit is also used to run the original data packet, and during the running of the original data packet, to hook the original assignment method of the system using a dynamic method to extract the original text of the interface elements in the original data packet and obtain the original text. The processing unit is further configured to package the description information and the original text into the original data packet to obtain the target data packet; A sending unit is configured to send the target data packet to an access party, so that the access party generates an element identifier for the interface element based on the description information of the interface element. The access party modifies the original text in at least one language environment based on the description information to obtain a modified text. The modified text and the original text constitute the target text of the interface element. Different texts in the target text correspond to different languages. The access party stores the element identifier and the target text in a memory. When the element identifier of the interface element requesting multilingual switching processing and the target language are determined, the access party can search for the text corresponding to the target language associated with the element identifier through the memory and display the rendered page corresponding to the text. The original data packet is a software development kit (SDK), which can be an open-source or closed-source SDK; the at least one language is provided by the access party, and the modification is used to add text in at least one language environment based on the language provided by the access party, wherein each of the at least one languages ​​is different from the language corresponding to the original text.

11. A server, characterized in that, include: A processor for executing one or more computer instructions; A memory for storing a computer program, the computer program comprising one or more computer instructions, the one or more computer instructions being used to instruct the processor to load and execute the multilingual processing method as described in any one of claims 5-7.

12. A computer storage medium, characterized in that, The computer storage medium stores program instructions, which are loaded by a processor and executed as described in any one of claims 1-7.