User interface generation method, apparatus, device, and computer storage medium

CN116339729BActive Publication Date: 2026-09-22CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310211712.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-27
Publication Date
2026-09-22
Estimated Expiration
2043-02-27

AI Technical Summary

Technical Problem

但是由于业务国际化的需求不断出现,便有了对用户界面进行多语言支持的改造需要,通常情况下改造量往往十分巨大,需要大量的人工操作,同时改造过程十分繁琐,而且容易出现人为的操作错误,因此造成改造成本大和准确率低下的问题

Benefits of technology

[0046]本申请实施例通过获取到待显示用户界面以及用户设置的语言文字种类,通过将用户界面中的所有文本词替换成对应的翻译词的方法生成用户界面进行显示,自动化地实现了对于用户界面的多语言改造,无需大量人工操作,节约人力成本的同时可以提高对于文本词进行替换的准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116339729B_ABST
    Figure CN116339729B_ABST
Patent Text Reader

Abstract

The application discloses a user interface generation method, device and equipment and a computer storage medium, and belongs to the field of financial technology in display technology. The method comprises the following steps: acquiring a user interface to be displayed and a character language type set by a user; traversing all text words in the user interface to be displayed, and determining a translation word of the character language type corresponding to each text word; replacing each text word in the user interface with the translation word of the character language type corresponding to the text word, to obtain a user interface; and displaying the user interface on a user device. The text words on the user interface are replaced to generate a new user interface in multiple languages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the financial technology field of display technology, and particularly relates to a method, apparatus, device and computer storage medium for generating a user interface. Background Technology

[0002] Today, with the rise of internet technology, software services based on browser and server architecture are commonplace. However, the increasing demand for international business has created a need to modify user interfaces to support multiple languages. These modifications are often massive, requiring extensive manual intervention. The process is cumbersome and prone to human error, resulting in high costs and low accuracy. Summary of the Invention

[0003] This application provides a method, apparatus, device, and computer storage medium for generating user interfaces, capable of generating user interfaces for different language requirements.

[0004] In a first aspect, embodiments of this application provide a method for generating a user interface, comprising:

[0005] Obtain the user interface to be displayed and the text language set by the user;

[0006] Iterate through all text words in the user interface to be displayed and determine the translation word for each text word in the corresponding language.

[0007] Replace each text word in the user interface to be displayed with the corresponding translation word for the language of the text word to obtain the user interface;

[0008] Display the user interface on the user's device.

[0009] Optionally, iterate through all text words in the user interface to be displayed, and determine the translation word for each text word in its corresponding language, including:

[0010] Iterate through the labels of each text word in the user interface to be displayed, with each label containing the number of each text word;

[0011] Search for the number in the preset dictionary to determine the multiple translation words corresponding to the number;

[0012] The translation term that identifies the language of a given text among multiple translation terms.

[0013] Optionally, the method further includes, before obtaining the user interface to be displayed and the text language type set by the user:

[0014] Retrieve at least one hyperlink tag text from at least one user interface configuration folder;

[0015] Iterate through each hyperlink tag text and identify all text words in each hyperlink tag text;

[0016] Each text word is translated to obtain multiple translation words for each text word;

[0017] A dictionary is constructed based on the text words, their numbers, and their translations.

[0018] Optionally, the method is characterized in that, after traversing each hypertext link markup text and determining all text words in each hypertext link markup text, the method further includes:

[0019] Get the storage path of the hyperlink identifier text where each text word is located;

[0020] Count each text word to obtain the count value for each text word;

[0021] Each text word is assigned a number based on its storage path and count value;

[0022] Tag each text word according to its number.

[0023] Secondly, embodiments of this application provide a user interface generation apparatus, comprising:

[0024] The acquisition module is used to acquire the user interface to be displayed and the text language set by the user;

[0025] The determination module is used to traverse all text words in the user interface to be displayed and determine the translation word for the language of each text word;

[0026] The replacement module is used to replace each text word in the user interface to be displayed with the corresponding translation word in the language of the text word, thus obtaining the user interface;

[0027] The display module is used to display the user interface on the user device.

[0028] Optionally, the module determines all text words in the user interface to be displayed, and determines the translation word for each text word in its corresponding language, including:

[0029] The traversal module is used to traverse the labels of each text word in the user interface to be displayed, with each label including the number of each text word;

[0030] The search module is used to search for a number in a preset dictionary and determine the multiple translation words corresponding to that number;

[0031] The determination module is also used to identify the language of the translated word among multiple translated words.

[0032] Optionally, before the acquisition module acquires the user interface to be displayed and the text language type set by the user, the device further includes:

[0033] The acquisition module is also used to acquire at least one hypertext link identifier text under at least one user interface configuration folder;

[0034] The traversal module is also used to traverse each hypertext link tag text and determine all text words in each hypertext link tag text;

[0035] The translation module is used to translate each text word, obtaining multiple translation words for each text word;

[0036] The building module is used to construct a dictionary based on text words, text word numbers, and translation words.

[0037] Optionally, after the traversal module traverses each hypertext markup text and determines all text words in each hypertext markup text, the device further includes:

[0038] The acquisition module is used to obtain the storage path of the hypertext link identifier text where each text word is located;

[0039] The counting module is used to count each text word and obtain the count value for each text word;

[0040] The building module is used to construct a number for each text word based on the storage path and the count value;

[0041] The tag module is used to tag each text word based on its number.

[0042] Thirdly, embodiments of this application provide an electronic device, the device comprising:

[0043] Processor and memory storing computer program instructions;

[0044] The method for generating the user interface described in the first aspect above, used by the processor to execute computer program instructions.

[0045] Fourthly, embodiments of this application provide a computer storage medium storing computer program instructions, which, when executed by a processor, implement the user interface generation method described in the first aspect.

[0046] This application embodiment obtains the user interface to be displayed and the language and script type set by the user, and generates the user interface for display by replacing all text words in the user interface with corresponding translation words. This automatically realizes the multilingual transformation of the user interface without a lot of manual operation, saving labor costs and improving the accuracy of text word replacement. Attached Figure Description

[0047] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart illustrating a method for generating a user interface according to an embodiment of this application.

[0049] Figure 2 This is a schematic diagram of a user interface to be displayed, provided for one embodiment of this application.

[0050] Figure 3 This is a schematic diagram of a user interface provided in one embodiment of this application.

[0051] Figure 4 This is a schematic diagram of a user interface generation apparatus provided in one embodiment of this application.

[0052] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0053] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.

[0054] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0055] It should be noted that the acquisition, storage, use, and processing of data in this application embodiment all comply with the relevant provisions of national laws and regulations.

[0056] To address the problems of the prior art, embodiments of this application provide a method, apparatus, device, and computer storage medium for generating a user interface. The method for generating a user interface provided in this application will be described first.

[0057] With the popularization of the Internet, browsers have become an increasingly indispensable application in daily life. People in various countries rely on browsers for their daily searches. Currently, browsers are often developed using HyperText Markup Language (HTML) to develop content programs. Since the original design and development did not consider the need for multilingual switching, it is necessary to modify the browser's user interface in order to achieve application internationalization.

[0058] Because the scope of the renovations is often enormous and requires a large amount of manual labor, the process is extremely complex, resulting in high renovation costs.

[0059] Therefore, embodiments of this application provide a method, apparatus, device, and computer storage medium for generating a user interface, thereby solving or partially solving the above-mentioned problems.

[0060] Figure 1 The diagram shows a flowchart of a user interface generation method according to an embodiment of this application.

[0061] like Figure 1 As shown, the method for generating the user interface includes:

[0062] S110: Obtain the user interface to be displayed and the text language set by the user.

[0063] When a user launches a browser, before the user interface is displayed, this undisplayed interface is referred to as the "user interface to be displayed." After obtaining the user interface to be displayed, the user-set language can be retrieved. This language can be determined from a JavaScript file (.js) on the user's device. When the user opens the browser's user interface, the browser calls the JavaScript file to implement various functions. Since the JavaScript file can be manually configured, the language can be determined from it. For example, if the user interface is in Chinese, the JavaScript file might be named cn.js. Therefore, the user-set language can be obtained by retrieving the JavaScript file.

[0064] S120: Traverse all text words in the user interface to be displayed and determine the translation word for the language type of each text word.

[0065] Once the user interface to be displayed is obtained, all text words in the user interface can be iterated through. The text words in the user interface to be displayed can include, for example... Figure 2 The text words shown can be used to determine the words that need to be replaced in the user interface by traversing all text words. Therefore, the translation words for the corresponding language of the text words can be found by calling a search engine, or the translation words for the corresponding language of the text words can be determined from a set of translation words for multiple text words.

[0066] S130: Replace each text word in the user interface to be displayed with the corresponding translation word for the language type of the text word to obtain the user interface.

[0067] By replacing each text word in the user interface with the corresponding translation word for the language, it is possible to generate a user interface for the language specified by the user.

[0068] S140: Display the user interface on the user device.

[0069] The generated user interface is then displayed on the user's device, thus completing the process of generating a user interface in the user's desired language. For example, if the user selected to generate an English user interface, the newly generated user interface would look like this: Figure 3 As shown.

[0070] This method allows for the automatic generation of user interfaces in different languages ​​when a user launches the browser, replacing all text displayed in the user interface with translations in the user's desired language. This achieves automated generation of user interfaces for different languages, reducing labor costs while improving the efficiency of generating user interfaces and facilitating browser internationalization.

[0071] In the game implementation, all text words in the user interface to be displayed are traversed to determine the translation word for each text word in its corresponding language, including:

[0072] S1201: Iterate through the labels of each text word in the user interface to be displayed, with each label including the number of each text word.

[0073] When iterating through all text words in the user interface to be displayed, you can simultaneously iterate through the tag of each text word. Each tag can include a number for each text word. This number can be generated by tagging and numbering the text words when writing the browser program, such as... Figure 2 In the user interface shown, each text word has a label with a number. The numbering rules can be set manually, such as numbering each text word according to numbers.

[0074] S1202: Search for the number in the preset dictionary and determine the multiple translation words corresponding to the number.

[0075] After determining the number of each text word, you can search for it in a preset dictionary based on the number to find multiple translation words corresponding to that number. The preset dictionary can be a pre-configured Excel file. For example, the first column is the text word number, the second column is the text word, and the third to nth columns are the translation words in different languages ​​corresponding to that text word. Therefore, you can get multiple translation words based on the number.

[0076] S1203: Translation terms that identify the language of a given text among multiple translation terms.

[0077] The translation term for the user-defined language can be identified from multiple translation terms.

[0078] In this embodiment, by traversing the tags of text words to obtain their numbers, and then using these numbers to retrieve translation words from a preset dictionary, multiple translation words corresponding to each text word can be quickly and accurately determined. From these translation words, the translation words for the language type required by the user can be found, overcoming the problem of low accuracy caused by manually modifying the browser user interface.

[0079] In some embodiments, the method further includes, before obtaining the user interface to be displayed and the text language type set by the user:

[0080] S101: Obtain at least one hypertext link identifier text under at least one user interface configuration folder.

[0081] In order to implement text word replacement for the browser user interface, when writing the browser application, at least one hypertext link markup text in at least one user interface configuration folder can be obtained.

[0082] Hypertext markup text is a markup language used to describe browsers, using tags to describe them. Therefore, multiple hypertext markup texts may exist in the browser's user interface configuration folder.

[0083] S102: Traverse each hypertext link tag text and determine all text words in each hypertext link tag text.

[0084] Text content in browsers typically appears in two forms within hyperlink markup text: either as text within the tag or as an attribute of the tag, such as the common hyperlink A tag.

[0085] <a herf="http: xxxx.com”alt="点击打开”> XX Homepage

[0086] "Click to open" is the content of the A tag's ALT attribute, while "XX Homepage" is the text within the tag.

[0087] Therefore, when determining all the text words in each hypertext link tag text, it is necessary to determine both the text within the tag and the attribute text of the tag.

[0088] S103: Translate each text word to obtain multiple translation words corresponding to each text word.

[0089] Each word in a hyperlink tag can be translated using a search engine, resulting in multiple translations in various languages. Alternatively, translation software can be used to translate the text words into their corresponding translations.

[0090] S104: Construct a dictionary based on text words, text word numbers, and translation words.

[0091] A dictionary can be constructed based on text words, text word numbers, and multiple translation words corresponding to the text words. You can choose to construct an Excel spreadsheet as the dictionary, with the first column being the text word number, the second column being the text word, and the third to nth columns being the translation words in different languages ​​corresponding to the text word. Alternatively, you can construct a file in other formats as the dictionary.

[0092] In this embodiment, since the hyperlink markup text is an important file for building the browser user interface, and the text words in the browser user interface are often reflected in the hyperlink markup text, we can traverse each hyperlink markup text to find all the text words in each hyperlink markup text, translate all the text words, and then construct a dictionary with the text words, their numbers, and translations. Therefore, the dictionary can achieve comprehensive coverage of the text words displayed in the user interface, thereby improving the accuracy of replacing text words with translations.

[0093] In some embodiments, the method is characterized in that, after traversing each hypertext markup text and determining all text words in each hypertext markup text, the method further includes:

[0094] S1021: Obtain the storage path of the hypertext link identifier text where each text word is located.

[0095] Because the user interface configuration folder may contain multiple subfolders, and each subfolder may contain multiple folders, and each folder may contain hyperlink tags, in order to locate the text words in each hyperlink tag, it is necessary to obtain the storage path of each hyperlink tag. For example, A\B means that a certain hyperlink tag is stored in folder B under folder A.

[0096] S1022: Count each text word to obtain the count value for each text word.

[0097] Within each hyperlink markup text, each text word can be counted. For example, in a certain hyperlink markup text under a certain storage path, the first text word that appears is counted as 1, and each subsequent text word is counted as 2...3.... After counting the text words in one hyperlink markup text, when opening another hyperlink markup text to count the text words, the count can be added on top of the previous hyperlink markup text, so that each text word has a unique count value.

[0098] S1023: Construct a number for each text word based on the storage path and the count value.

[0099] By using the storage path of each hyperlink markup text as a prefix and the count value of each text word as a suffix, a number can be constructed for each text word. For example, for a text word with a count value of 1 appearing in the hyperlink markup text with storage path A\B, when constructing the number, the forward slash in the storage path can be replaced with an underscore, for example, A\B can be replaced with A_B, so the number of this text word would be "A_B_1". The number of each text word can be constructed using the above method.

[0100] S1024: Tag each text word according to its number.

[0101] After constructing the number for each text word, you can tag each text word. For example, you can add an MLS tag to each text word, add an ID attribute to the MLS tag, and tag the text word by the ID attribute. For example, the tag for a text word is "A_B_1". You can also add a CLASS attribute to the MLS tag and tag the text by the CLASS attribute. For example, the tag for a text word can also be "MLS_A_B_1".

[0102] In this embodiment, by obtaining the storage path of the hypertext link indicating the text where each text word is located, and then counting each text word, a number for each text word is constructed based on the storage path and the count value. This method ensures that each text word has a unique number, and the location of each text word can be accurately located based on the number, thereby improving the accuracy of replacement when replacing text words later.

[0103] like Figure 4 As shown, this application embodiment provides a user interface generation apparatus, including:

[0104] The acquisition module 201 is used to acquire the user interface to be displayed and the text language type set by the user.

[0105] The determination module 202 is used to traverse all text words in the user interface to be displayed and determine the translation word for the language type of each text word.

[0106] The replacement module 203 is used to replace each text word in the user interface to be displayed with the corresponding translation word in the language of the text word, so as to obtain the user interface.

[0107] Display module 204 is used to display a user interface on a user device.

[0108] In some embodiments, the determining module iterates through all text words in the user interface to be displayed and determines the translation word for each text word in its corresponding language, including:

[0109] The traversal module is used to traverse the labels of each text word in the user interface to be displayed, with each label including the number of each text word.

[0110] The search module is used to search for a number in a preset dictionary and determine the multiple translation words corresponding to that number.

[0111] The determination module is also used to identify the language of the translated word among multiple translated words.

[0112] In some embodiments, before the acquisition module acquires the user interface to be displayed and the text language type set by the user, the apparatus further includes:

[0113] The acquisition module is also used to acquire at least one hypertext link identifier text under at least one user interface configuration folder.

[0114] The traversal module is also used to traverse each hyperlink tag text and determine all text words in each hyperlink tag text.

[0115] The translation module is used to translate each text word, resulting in multiple translation words for each text word.

[0116] The building module is used to construct a dictionary based on text words, text word numbers, and translation words.

[0117] In some embodiments, after the traversal module traverses each hypertext markup text and determines all text words in each hypertext markup text, the apparatus further includes:

[0118] The acquisition module is used to obtain the storage path of the hypertext link identifier text where each text word is located.

[0119] The counting module is used to count each text word and obtain the count value for each text word.

[0120] The building module is used to construct a number for each text word based on the storage path and the count value.

[0121] The tag module is used to tag each text word based on its number.

[0122] The apparatus of the above embodiments is used to implement the corresponding user interface generation method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0123] Figure 5 A schematic diagram of the hardware structure of an electronic device is provided in the application embodiment.

[0124] The electronic device may include a processor 301 and a memory 302 storing computer program instructions.

[0125] Specifically, the processor 301 may include a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0126] Memory 302 may include mass storage for data or instructions. For example, and not limitingly, memory 302 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 302 may include removable or non-removable (or fixed) media. Where appropriate, memory 302 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 302 is non-volatile solid-state memory.

[0127] In a particular embodiment, memory 302 includes read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.

[0128] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of this application.

[0129] The processor 301 reads and executes computer program instructions stored in the memory 302 to implement any of the user interface generation methods in the above embodiments.

[0130] In one example, the electronic device may also include a communication interface 303 and a bus 310. Wherein, as... Figure 5 The processor 301, memory 302, and communication interface 303 are connected through bus 310 and complete communication with each other.

[0131] The communication interface 303 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.

[0132] Bus 310 includes hardware, software, or both, that couples components of an online data traffic metering device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Low Pin Count (LPC) bus, a memory bus, a Microchannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or combinations of two or more of these. Where appropriate, bus 310 may include one or more buses. Although specific buses are described and illustrated in embodiments of this application, any suitable bus or interconnect is contemplated herein.

[0133] The electronic devices described above are used to implement the corresponding user interface generation method in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0134] Furthermore, in conjunction with the user interface generation methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the user interface generation methods in the above embodiments.

[0135] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.

[0136] The functional blocks shown in the above-described structural diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0137] It should also be noted that the exemplary embodiments mentioned in this application describe methods or apparatuses based on a series of steps or devices. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0138] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.

[0139] The above description is merely a specific embodiment of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the devices, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.

Claims

1. A method for generating a user interface, characterized in that, include: Obtain the user interface to be displayed, determine the text language type set by the user based on the js file in the user device, the user interface implements the function by calling the js file, and the user interface is a user interface that has been started but has not yet been displayed; Traverse all text words in the user interface to be displayed, and determine the translation word for each text word corresponding to the language type; The user interface is obtained by replacing each text word in the user interface to be displayed with the corresponding translation word for the language type of the text word; Display the user interface on the user device; The process of traversing all text words in the user interface to be displayed and determining the translation word for each text word corresponding to the language category includes: Iterate through the labels of each text word in the user interface to be displayed, with each label including the number of each text word; Search the number in the preset dictionary to determine the multiple translation words corresponding to the number; Determine the translation term for the language type from among the plurality of translation terms; Before obtaining the user interface to be displayed and the text language set by the user, the method further includes: Retrieve at least one hyperlink tag text from at least one user interface configuration folder; Iterate through each of the hypertext link marker texts and determine all text words in each of the hypertext link marker texts; Based on the storage path of the hypertext link indicating the text where each text word is located, and the count value of each text word, construct the number of each text word; Each of the text words is translated using a search engine to obtain multiple translated words corresponding to each text word; A dictionary is constructed based on the text words, the text word numbers, and the translation words.

2. The user interface generation method according to claim 1, characterized in that, After traversing each of the hypertext markup texts and determining all text words in each of the hypertext markup texts, the method further includes: Obtain the storage path of the hypertext link identifier text where each of the text words is located; Count each of the text words to obtain a count value for each text word; A number is constructed for each of the text words based on the storage path and the count value; Each of the text words is tagged according to the number.

3. A user interface generation apparatus, characterized in that, include: The acquisition module is used to acquire the user interface to be displayed, determine the text language type set by the user based on the js file in the user device, and implement the functions by calling the js file. The user interface is a user interface that has been started but has not yet been displayed. The determination module is used to traverse all text words in the user interface to be displayed and determine the translation word for each text word corresponding to the language type. A replacement module is used to replace each text word in the user interface to be displayed with a translation word of the language type to obtain the user interface; A display module is used to display the user interface on a user device; The traversal module is used to traverse the labels of each text word in the user interface to be displayed, with each label including the number of each text word; The search module is used to search for the number in a preset dictionary and determine the multiple translation words corresponding to the number; The determining module is also used to determine the translation word of the language type among the plurality of translation words; The device further includes: The acquisition module is also used to acquire at least one hypertext link identifier text under at least one user interface configuration folder before the acquisition module acquires the user interface to be displayed and the text language type set by the user; The traversal module is also used to traverse each of the hypertext link marker texts and determine all text words in each of the hypertext link marker texts; A construction module is used to construct a number for each text word based on the storage path of the hypertext link indicating the text where each text word is located and the count value of each text word; The translation module is used to translate each of the text words using a search engine to obtain multiple translated words corresponding to each of the text words; A construction module is used to construct a dictionary based on the text words, the text word numbers, and the translation words.

4. The user interface generation apparatus according to claim 3, characterized in that, After the traversal module traverses each hypertext link marker text and determines all text words in each hypertext link marker text, the device further includes: The acquisition module is used to acquire the storage path of the hypertext link identifier text where each of the text words is located; The counting module is used to count each of the text words and obtain the count value of each text word; A construction module is used to construct a number for each of the text words based on the storage path and the count value; The tagging module is used to tag each of the text words according to the number.

5. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the user interface generation method as described in any one of claims 1-2.

6. A computer storage medium, characterized in that, The computer storage medium stores computer program instructions, which, when executed by a processor, implement the user interface generation method as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Multi-language interface translation method and device, equipment and storage medium

    CN115543522A