A page translation method, device, equipment and medium
By extracting and filling the attribute information and target data of the page tags, efficient translation of the target page is realized, the problem of low translation efficiency and difficulty in the existing technology is solved, and the accuracy of the translation result is improved.
Patent Information
- Application Number
- CN202411463818.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-21
AI Technical Summary
The existing page translation methods are less efficient and accurate, and the translation work is more difficult.
By obtaining the pre -configured target page, use the page translation plug -in to activate the operation of the attribute information of the page label, fill it to the blank data table, generate the target data that matches the attribute information, fill in the translation data table. Translation on the page.
Improved the efficiency of page translation, reduced the difficulty of translation work, and improved the accuracy of the translation results.
Smart Images

Figure CN118981354B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of language translation, and in particular to a page translation method, device, equipment and medium. Background Art
[0002] With the development of globalization, more and more companies and organizations need to expand their business systems to different regions and language environments. Various types of regional business systems have emerged in this context. This type of system takes the simplified Chinese business system as the baseline and is customized based on the business needs of different regions. During the development process, in order to meet the requirements of non-Chinese regions for pages to support simplified Chinese, traditional Chinese, English and other languages, the user interface needs to be internationalized. However, since the baseline is the simplified Chinese version, this transformation process faces many challenges.
[0003] The traditional page translation method usually involves creating resource files in different languages, and the system renders the page according to the language option in the user session. Although this solution has achieved multi-language support to a certain extent, it also has some problems. First, changes to resource files require the redeployment of applications, which greatly reduces the flexibility of the system. Second, manually writing resource files and performing page transformation requires a lot of time and manpower costs, increasing development costs. In addition, non-standard resource naming also brings difficulties to subsequent maintenance and management.
[0004] In summary, the existing page translation methods have the problems of low efficiency and accuracy of page translation and high difficulty of page translation. Summary of the invention
[0005] The present invention provides a page translation method, device, equipment and medium, which can solve the problems of low working efficiency and accuracy of existing page translation methods and great difficulty in page translation work.
[0006] In a first aspect, an embodiment of the present invention provides a method for translating a page, which is executed by a page translation plug-in, and the method includes:
[0007] Get a pre-configured target page;
[0008] According to the page translation plug-in activation operation of the user for the target page, the attribute information of each page tag in the target page is extracted, and the attribute information of each page tag is filled into a pre-configured blank data table to obtain a data table to be translated;
[0009] Generate target data that matches the attribute information of each page tag respectively, and fill the to-be-translated data table based on each target data to obtain a target data table;
[0010] The target page is translated according to the target data table to obtain a translated page.
[0011] In a second aspect, an embodiment of the present invention provides a page translation device, the device comprising:
[0012] A page acquisition module is used to acquire a pre-configured target page;
[0013] A data table filling module is used to extract the attribute information of each page tag in the target page according to the page translation plug-in activation operation of the user for the target page, extract the attribute information of each page tag, and fill the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated;
[0014] A target data table generating module is used to generate target data that matches the attribute information of each page tag, and fill the data table to be translated based on each target data to obtain a target data table;
[0015] The translation module is used to translate the target page according to the target data table to obtain a translated page.
[0016] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a page translation method described in any embodiment of the present invention.
[0020] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a page translation method described in any embodiment of the present invention when executed.
[0021] The technical solution of the embodiment of the present invention, after obtaining a pre-configured target page, according to the user's page translation plug-in activation operation for the target page, extracts the attribute information of each page tag in the target page, and fills the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated, then generates target data that matches the attribute information of each page tag respectively, and fills the data table to be translated based on each target data to obtain a target data table, and finally translates the target page according to the target data table to obtain a translated page, which solves the problems of low working efficiency and accuracy of existing page translation methods and great difficulty of page translation work, realizes the translation operation of the target page, improves the working efficiency of page translation work, reduces the difficulty of translation work, and improves the accuracy of translation results.
[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a flow chart of a page translation method provided according to the first embodiment of the present invention;
[0025] Figure 2 is a flow chart of a page translation method provided according to Embodiment 2 of the present invention;
[0026] Figure 3 is a schematic diagram of the structure of a page translation device provided according to Embodiment 3 of the present invention;
[0027] Figure 4 The present invention is a schematic diagram of the structure of an electronic device for implementing a page translation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, any variation of the terms "including" and "having" is intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 A flow chart of a page translation method provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of translating a target page. The method can be executed by a page translation device. The page translation device can be implemented in the form of hardware and / or software. The page translation device can be configured in a page translation plug-in with a page translation function.
[0032] like Figure 1 As shown, the method includes:
[0033] S110: Obtain a pre-configured target page.
[0034] The target page is an interface for displaying information to users in the business system. These pages need to support multiple languages to meet the needs of users in non-Chinese regions; further, in this embodiment, the target page can be constructed by technologies such as HTML, CSS and JavaScript, which are responsible for presenting text, images, links and other content, and interacting with users. In the process of displaying to customers, the text content in the target page needs to be translated so that it can be displayed correctly in different language environments. For example, a target page may contain buttons such as "Login", "Register", "Personal Center", and text boxes such as "User Name", "Password", and "Verification Code".
[0035] In this embodiment, the target page can be provided and modified by the relevant developers of the target page to ensure the integrity of the data and further ensure the accuracy of the translation result.
[0036] S120. According to the page translation plug-in activation operation of the user for the target page, the attribute information of each page tag in the target page is extracted, and the attribute information of each page tag is filled into a pre-configured blank data table to obtain a data table to be translated.
[0037] The header of the blank data table includes: page tag ID, language type ID and tag content, the target page includes at least one page tag; and the attribute information of the page tag includes: page tag ID, language type ID and tag content of the page tag.
[0038] Among them, the activation operation can be a user's selection operation on a specific option in the page translation plug-in; further, the specific option in the translation plug-in can be referenced in the plug-in through the method of customizing the tag StrRes according to the user's operating habits; illustratively, a code that can be used for the custom tag StrRes provided in this embodiment is: <%@taglib prefix="StrRes" uri="target page URL" %>.
[0039] In this embodiment, the page translation plug-in may be a tool installed in a browser or other application, and is used to translate the text content on the target page into other languages. Exemplarily, the page translation plug-in may be an IDEA plug-in; further, the IDEA plug-in is an extended function module added to the IntelliJ IDEA integrated development environment. Accordingly, in this embodiment, the page translation activation operation can be performed on the target page through the IDEA plug-in.
[0040] Based on S110, the page tag includes a button containing text content and a text box with text content on the target page; further, the page tag ID is an identifier used to uniquely identify each page tag, which can be a combination of numbers or letters in a preset format. This embodiment does not limit the specific form of the page tag ID; further, the page tag ID can also be bound to the specific position of the page tag in the target page, so that the user or the system can locate the display position of the page tag in the target page according to the page tag ID.
[0041] Further, the label content is the text content contained in the page label. In this embodiment, the page translation plug-in will extract the attribute information of each page label in the target page according to the user's activation operation, including the ID of the page label, the language type ID and the label content. Then, these attribute information are filled into a blank data table to form a data table to be translated. This data table will serve as the basis for subsequent translation work. By translating the data in the table, multilingual translation of the page content can be achieved.
[0042] S130 , generating target data respectively matching the attribute information of each page tag, and filling the to-be-translated data table based on each target data to obtain a target data table.
[0043] Optionally, the data table to be translated is filled based on each target data, including: retrieving a target row having the same page tag ID as the target data in the data table to be translated; locating the position of the target row in the data table to be translated, and filling the target data into an adjacent position of the target row.
[0044] Specifically, first, the system will generate target data that matches the page tag based on its attribute information. Then, by retrieving the target row with the same page tag ID as the target data in the data table to be translated, the position to be filled is found. Next, the position of the target row in the data table is accurately located, and the target data is filled into the adjacent position of the target row. In this way, the data table to be translated is filled with the target data, forming a target data table, which contains the attribute information of the page tag and the translated content. This filling method ensures the correct association between the target data and the page tag, and provides an accurate data basis for subsequent translation and page display. At the same time, by locating the adjacent position of the target row for filling, the structure and logical integrity of the data table can be maintained, which facilitates data management and use.
[0045] S140: Translate the target page according to the target data table to obtain a translated page.
[0046] Specifically, the target page is translated according to the target data table to obtain a translated page, including: based on the target data table, replacing the tag content of each page tag of the target web page with the tag content of the target data matching the page tag; and displaying each replaced page tag on the target page to obtain a translated page.
[0047] Exemplarily, in the present embodiment, first, the system will replace the label content of each page label of the target web page with the label content of the target data matching the page label based on the target data table. This means that the system will find the corresponding page label in the target web page according to the information in the target data table, and update its label content to the translation content in the target data. Next, the system will display each replaced page label on the target page to obtain a translated page. This step ensures that the translated page label can be correctly presented on the target page, thereby achieving the translation of the page. Through the above steps, the system can translate the target page according to the target data table, replace the content of the page label with the translated content, and display the translated result on the target page, thereby obtaining a translated page. In this way, the user can see the translated version of the target page, meeting the needs of multi-language display.
[0048] On the basis of the above steps, the header of the blank data table further includes: a code table name; the attribute information of the page tag further includes: a code table name of the page tag.
[0049] Among them, the code table is the grouping of page tags; illustratively, if a page tag a is located in the drop-down menu A on the target page, the code table name matching the page tag a is A; similarly, the target page can be initialized to code table B. If a page tag b is directly displayed on the target page, such as a page pop-up prompt or page text, but is not located in the drop-down menu of the target page, the code table name matching the page tag b is B.
[0050] Optionally, in this embodiment, the page translation method also includes: after detecting that the user has created a new code table operation on the target page, according to the user's page translation plug-in activation operation on the target page, obtaining the code table name of the new code table created by the user on the target page and each page tag in the new code table; extracting the attribute information of each page tag, and filling the target data table based on the attribute information of the page tag and the code table name of the new code table to obtain an updated data table; generating target data that matches the attribute information of each page tag respectively, and filling the updated data table based on each target data and the code table name to obtain an updated data table; translating the new code table according to the updated data table to obtain a result page.
[0051] Among them, the activation operation can be an operation of selecting a specific option in the page translation plug-in by the user; it should be noted that the characteristic options in this step and the specific options in step S120 should have certain differences so that the user can distinguish them when selecting options; further, the multiple options with differences can be generated by the relevant users according to their usage habits during the process of customizing tags.
[0052] The technical solution of the embodiment of the present invention obtains a pre-configured target page, extracts the attribute information of each page tag in the target page according to the user's page translation plug-in activation operation for the target page, and fills the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated, then generates target data that matches the attribute information of each page tag respectively, and fills the data table to be translated based on each target data to obtain a target data table, and finally translates the target page according to the target data table to obtain a translated page, thereby realizing the translation operation of the target page, improving the work efficiency of page translation, reducing the difficulty of translation work, and improving the accuracy of translation results.
[0053] Embodiment 2
[0054] Figure 2 This is a flow chart of a page translation method provided in the second embodiment of the present invention. This embodiment is refined based on the above embodiment. In this embodiment, the method of generating target data that matches the attribute information of each page tag is specifically refined.
[0055] like Figure 2 As shown, the method includes:
[0056] S210: Acquire a pre-configured target page, and acquire a target language type and a language number table preset by a user.
[0057] The language number table includes at least one language type and a language type ID matching the language type.
[0058] It is easy to understand that the language number table at least stores the current language type of the page tag of the target page and the language type of the target language; further, the content of the language number table can be adjusted by relevant personnel according to actual needs, and this embodiment does not limit this.
[0059] S220 , extracting each row of information in the data table to be translated as a target information row in sequence according to the filling order of each attribute information in the data table to be translated.
[0060] S230: Copy the target information row to obtain the information row to be translated.
[0061] S240: Based on the preset translation software, the label content in the information line to be translated is translated into the target language type, and the translation result and the language type ID matching the target language type are respectively updated to the label content and the language type ID of the information line to be translated, so as to obtain the target data.
[0062] On the basis of the above steps, exemplarily, according to the filling order of each attribute information in the data table to be translated, the system will extract each row of information in the data table to be translated in turn, and use it as the target information row. Next, the system will copy the target information row to obtain the information row to be translated. Then, based on the preset translation software, the system will translate the label content in the information row to be translated and translate it into the target language type; wherein, the preset translation software can be software with text translation function such as opencc4j. After the translation is completed, the system will update the translation result to the label content of the information row to be translated, and at the same time update the language type ID matching the target language type to the language type ID of the information row to be translated. In this way, the target data containing the translated label content and language type ID is obtained. Through the above steps, the system can extract information row by row and translate and update it according to the filling order of the attribute information in the data table to be translated, so as to obtain the target data. These target data can be used for subsequent page translation and display to realize the function of translating the page content into the target language. The specific translation process and subsequent processing can be further optimized and expanded according to actual needs and system design.
[0063] S250: Fill the to-be-translated data table based on each target data to obtain a target data table.
[0064] S260: Translate the target page according to the target data table to obtain a translated page.
[0065] Specifically, after obtaining the target data, the system will associate it with the target page. The system will find the corresponding page tag in the target page based on the page tag ID in the target data, and update the translated tag content to the target page. At the same time, the system will also determine the language type of the target page based on the language type ID in the target data, and make corresponding settings. Through the above steps, the system can fully translate the target page according to the target data table, convert the tag content in the page into the target language, and display it on the target page. In this way, users can see the translated page, meeting the needs of multi-language display.
[0066] It should be noted that in this embodiment, the specific formats of the blank data table and the language number table and the display content of the table headers in each table can be customized according to personal operating habits. This embodiment does not impose specific restrictions on the specific formats of each table and the format of the display content.
[0067] The technical solution of the embodiment of the present invention is as follows: after obtaining a pre-configured target page, according to the page translation plug-in activation operation of the user for the target page, the attribute information of each page label in the target page is extracted, and the attribute information of each page label is filled into a pre-configured blank data table to obtain a data table to be translated, then the target language type and language number table preset by the user are obtained, and according to the filling order of each attribute information in the data table to be translated, each row of information in the data table to be translated is sequentially extracted as a target information row, and then the target information row is copied to obtain an information row to be translated, and the label content in the information row to be translated is translated into the target language type based on the preset translation software, and the translation result and the language type ID matching the target language type are respectively updated to the label content and the language type ID of the information row to be translated to obtain target data, and then the data table to be translated is filled based on each target data to obtain a target data table, and finally the target page is translated according to the target data table to obtain a translated page, so as to realize the translation operation of the target page, improve the work efficiency of page translation work, reduce the difficulty of translation work, and improve the accuracy of translation results.
[0068] Embodiment 3
[0069] Figure 3 A schematic diagram of the structure of a page translation device provided in Embodiment 3 of the present invention.
[0070] like Figure 3 As shown, the device comprises:
[0071] The page acquisition module 310 is used to acquire a pre-configured target page;
[0072] The data table filling module 320 is used to extract the attribute information of each page tag in the target page according to the page translation plug-in activation operation of the user for the target page, extract the attribute information of each page tag, and fill the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated;
[0073] The target data table generating module 330 is used to generate target data that matches the attribute information of each page tag, and fill the data table to be translated based on each target data to obtain the target data table;
[0074] The translation module 340 is used to translate the target page according to the target data table to obtain a translated page.
[0075] The technical solution of the embodiment of the present invention obtains a pre-configured target page, extracts the attribute information of each page tag in the target page according to the user's page translation plug-in activation operation for the target page, and fills the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated, then generates target data that matches the attribute information of each page tag respectively, and fills the data table to be translated based on each target data to obtain a target data table, and finally translates the target page according to the target data table to obtain a translated page, thereby realizing the translation operation of the target page, improving the work efficiency of page translation, reducing the difficulty of translation work, and improving the accuracy of translation results.
[0076] Based on the above embodiment, the target data table generating module 330 includes:
[0077] A data acquisition unit, used to acquire a target language type and a language number table preset by a user; wherein the language number table includes at least one language type and a language type ID matching the language type;
[0078] An information row extraction unit, used to extract each row of information in the data table to be translated as a target information row in sequence according to the filling order of each attribute information in the data table to be translated;
[0079] A data copying unit, used for copying the target information row to obtain the information row to be translated;
[0080] The target data acquisition unit is used to translate the label content in the information line to be translated into the target language type based on the preset translation software, and update the translation result and the language type ID matching the target language type to the label content and language type ID of the information line to be translated respectively to obtain the target data.
[0081] Based on the above embodiment, the target data table generating module 330 further includes:
[0082] A retrieval unit, used to retrieve a target row having the same page tag ID as the target data in the to-be-translated data table;
[0083] The positioning and filling unit is used to locate the position of the target row in the to-be-translated data table and fill the target data into the adjacent position of the target row.
[0084] Based on the above embodiment, the translation module 340 includes:
[0085] A data replacement unit, used to replace the tag content of each page tag of the target web page with the tag content of the target data matching the page tag based on the target data table;
[0086] The display unit is used to display each replaced page tag on the target page to obtain a translated page.
[0087] On the basis of the above embodiment, the translation device of the page also includes: a newly created code table translation module, which is used to obtain the code table name of the newly created code table on the target page and each page tag in the newly created code table according to the user's page translation plug-in activation operation on the target page after detecting that the user has a newly created code table operation on the target page; extract the attribute information of each page tag, and fill the target data table based on the attribute information of the page tag and the code table name of the newly created code table to obtain an updated data table; generate target data that matches the attribute information of each page tag respectively, and fill the updated data table based on each target data and the code table name to obtain an updated data table; translate the newly created code table according to the updated data table to obtain a result page.
[0088] A page translation device provided in an embodiment of the present invention can execute a page translation method provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0089] Embodiment 4
[0090] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0091] like Figure 4As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0092] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0093] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for translating a page.
[0094] Accordingly, the method comprises:
[0095] Get a pre-configured target page;
[0096] According to the page translation plug-in activation operation of the user for the target page, the attribute information of each page tag in the target page is extracted, and the attribute information of each page tag is filled into a pre-configured blank data table to obtain a data table to be translated;
[0097] Generate target data that matches the attribute information of each page tag respectively, and fill the to-be-translated data table based on each target data to obtain a target data table;
[0098] The target page is translated according to the target data table to obtain a translated page.
[0099] In some embodiments, a method for translating a page may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for translating a page described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute a method for translating a page in any other appropriate manner (e.g., by means of firmware).
[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0101] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0102] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0104] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0105] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
Claims
1. A method for translating a page, executed by a page translation plug-in, characterized in that: include: Get a pre-configured target page; According to the page translation plug-in activation operation of the user for the target page, the attribute information of each page tag in the target page is extracted, and the attribute information of each page tag is filled into a pre-configured blank data table to obtain a data table to be translated; Generate target data that matches the attribute information of each page tag respectively, and fill the to-be-translated data table based on each target data to obtain a target data table; Translate the target page according to the target data table to obtain a translated page; The method of generating target data that matches the attribute information of each page tag includes: obtaining a target language type and a language number table preset by a user; wherein the language number table includes at least one language type and a language type ID that matches the language type; extracting each row of information in the data table to be translated as a target information row in turn according to the filling order of each attribute information in the data table to be translated; copying the target information row to obtain the information row to be translated; translating the label content in the information row to be translated into the target language type based on a preset translation software, and updating the translation result and the language type ID that matches the target language type to the label content and the language type ID of the information row to be translated respectively to obtain the target data; Among them, filling the data table to be translated based on each target data includes: retrieving the target row with the same page tag ID as the target data in the data table to be translated; locating the position of the target row in the data table to be translated, and filling the target data into the adjacent position of the target row.
2. The method according to claim 1, characterized in that The header of the blank data table includes: a page tag ID, a language type ID and tag content, and the target page includes at least one page tag; Furthermore, the attribute information of the page tag includes: the page tag ID, the language type ID and the tag content of the page tag.
3. The method according to claim 1, characterized in that The target page is translated according to the target data table to obtain a translated page, including: Based on the target data table, replacing the tag content of each page tag of the target page with the tag content of the target data matching the page tag; The replaced page labels are displayed on the target page to obtain a translated page.
4. The method according to claim 3, characterized in that The header of the blank data table further includes: a code table name; the attribute information of the page tag further includes: a code table name of the page tag; wherein the code table is the group to which the page tag belongs.
5. The method according to claim 4, characterized in that The method further comprises: After detecting that the user has created a new code table on the target page, according to the user's page translation plug-in activation operation on the target page, the code table name of the new code table created by the user on the target page and each page label in the new code table are obtained; Extracting the attribute information of each page tag, and filling the target data table based on the attribute information of the page tag and the code table name of the newly created code table to obtain an updated data table; Generate target data that matches the attribute information of each page tag, and fill the update data table based on each target data and the code table name to obtain an updated data table; The newly created code table is translated according to the updated data table to obtain a result page.
6. A page translation device, executed by a page translation plug-in, characterized in that: include: A page acquisition module is used to acquire a pre-configured target page; A data table filling module is used to extract the attribute information of each page tag in the target page according to the page translation plug-in activation operation of the user for the target page, extract the attribute information of each page tag, and fill the attribute information of each page tag into a pre-configured blank data table to obtain a data table to be translated; A target data table generating module is used to generate target data that matches the attribute information of each page tag, and fill the data table to be translated based on each target data to obtain a target data table; A translation module, used for translating the target page according to the target data table to obtain a translated page; The target data table generation module specifically includes: a data acquisition unit, which is used to acquire a target language type and a language number table preset by a user; wherein the language number table includes at least one language type and a language type ID matching the language type; an information row extraction unit, which is used to sequentially extract each row of information in the data table to be translated as a target information row according to the filling order of each attribute information in the data table to be translated; a data copying unit, which is used to copy the target information row to obtain the information row to be translated; a target data acquisition unit, which is used to translate the label content in the information row to be translated into the target language type based on a preset translation software, and update the translation result and the language type ID matching the target language type to the label content and the language type ID of the information row to be translated respectively, to obtain the target data; Among them, the target data table generation module also includes: a retrieval unit, which is used to retrieve a target row with the same page tag ID as the target data in the data table to be translated; a positioning and filling unit, which is used to locate the position of the target row in the data table to be translated and fill the target data into an adjacent position of the target row.
7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a page translation method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a page translation method according to any one of claims 1 to 5 when executed.
Citation Information
Patent Citations
Multi-language translation method, device and equipment for webpage
CN111639504A
Webpage multi-language loading method and device, equipment and medium
CN116955879A