International page generation method and device, equipment, medium and program product

By marking placeholders in H5 pages and establishing a mapping table, and combining a large language model for translation and layout adaptation, the problem of low efficiency in manual coding during H5 page internationalization generation is solved, achieving efficient and accurate internationalized page generation.

CN121834083APending Publication Date: 2026-04-10深圳毕加索电子有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
深圳毕加索电子有限公司
Filing Date
2026-03-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In existing technologies, H5 page generation methods are difficult to meet the needs of multilingual and multi-regional cultural adaptation, resulting in the need for users to manually code internationalized H5 pages, which is inefficient.

Method used

By marking target content in the initial page to generate placeholder tags, a mapping table is established between the target content and the source text content, layout information and contextual semantic information. Then, a preset large language model is used for translation and layout adaptation to generate the target internationalized page.

Benefits of technology

It improves the efficiency and accuracy of generating internationalized pages, avoids translations that are too long, too short, or ambiguous due to language differences and lack of context, ensures the accuracy and completeness of the translated content, and solves the typesetting problems caused by differences in the length of different languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121834083A_ABST
    Figure CN121834083A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of low code generation, and discloses an internationalized page generation method and device, equipment, a medium and a program product.The internationalized page generation method comprises the steps that an initialized page is generated according to a page template and multiple components, multiple target contents in the initialized page are marked, and placeholder marks are obtained; mapping each placeholder mark with the source text content, the layout information and the context semantic information of the corresponding target content to obtain a target mapping relation table; translating the source text content into a target language according to the layout information and the context semantic information corresponding to each placeholder mark in the target mapping relation table to obtain target translation content; the target translation content is updated into the initialized page according to the placeholder mark, layout adaptation adjustment is conducted on the target translation content, and the target internationalized page is obtained.According to the internationalized page generation method and device, the target content is marked and translated according to the placeholder mark, and the internationalized page generation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of low-code generation technology, specifically to methods, apparatus, devices, media, and program products for generating internationalized pages. Background Technology

[0002] With the rapid development of internet technology, H5 (HyperText Markup Language 5) low-code platforms, through their visual interfaces, pre-built components, and logic orchestration tools, enable users to quickly develop H5 pages by dragging and dropping, greatly reducing the development threshold of H5 pages and gradually becoming an important tool for enterprises to improve business efficiency.

[0003] In related technologies, the method for generating H5 pages involves combining pre-built platform components. However, when it is necessary to generate internationalized H5 pages, it often relies heavily on pre-built platform components, which makes it difficult to meet the needs of multilingual and multi-regional cultural adaptation. The generation of internationalized H5 pages still requires users to manually code, resulting in low operational efficiency. Summary of the Invention

[0004] This invention provides a method, apparatus, device, medium, and program product for generating internationalized pages, in order to solve the problem that the generation of internationalized H5 pages still requires manual coding by users, resulting in low operational efficiency, due to the existing H5 page generation methods in related technologies.

[0005] In a first aspect, the present invention provides a method for generating an internationalized page, comprising: generating an initial page based on a page template selected by a user and multiple components; marking multiple target contents in the initial page to obtain placeholder marks corresponding to each target content; the target content being the content to be translated, with a one-to-one correspondence between the target content and the placeholder marks; mapping each placeholder mark to the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping relationship table; translating the source text content into a target language based on the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping relationship table to obtain target translated content; the target language being the language to be translated selected by the user; adjusting the layout of the target translated content; and updating the adjusted target translated content to the initial page based on the placeholder marks to obtain the target internationalized page.

[0006] The internationalization page generation method of this invention generates an initial page based on a user-selected page template and multiple components, improving the development efficiency of the initial page. Multiple target contents within the initial page are marked, resulting in placeholder tags for each target content. These placeholder tags uniquely and clearly identify the target content requiring translation within the initial page, providing precise operational objects for subsequent translation. This invention maps each placeholder tag to the corresponding source text content, layout information, and contextual semantic information of the target content, obtaining a target mapping table. This establishes not only a correspondence between placeholder tags and source text content but also a correspondence between placeholder tags and layout information and contextual semantic information, providing data support for high-quality translation and accurate layout. The introduction of contextual semantic information ensures that subsequent translation is no longer based on individual words or sentences but on their specific context within the initial page, improving the accuracy of the target translation content. Furthermore, generating the target mapping table facilitates the management of target content and placeholder tags. This invention translates source text into the target language based on the layout information and contextual semantic information corresponding to each placeholder in the target mapping table, resulting in the target translated content. By combining layout and contextual semantic information during translation, it effectively avoids translations that are too long or too short due to language differences, as well as ambiguities or errors caused by missing context, thus improving the accuracy of language translation. This invention also performs layout adaptation adjustments on the target translated content, updating the adjusted target translated content to the initial page based on the placeholders, resulting in the target internationalized page. By precisely updating the target translated content to the corresponding position on the initial page using placeholders, it ensures the accuracy and completeness of the target translated content, avoiding misalignment or omissions. The layout adaptation adjustments to the translated content solve the typesetting problems caused by differences in the length of characters in different languages, improving the quality of the target internationalized page.

[0007] In one optional implementation, multiple target contents in the initialization page are marked to obtain placeholder marks corresponding to each target content. This includes: performing text recognition on multiple initial contents in the initialization page to obtain initial text content and initial non-text content; the initial content is the original content in the initialization page; using the initial text content as the target content, generating corresponding placeholder marks at the initial text content; performing text extraction on the initial non-text content to obtain text extraction results; determining whether the text extraction results contain content to be translated; if the text extraction results contain content to be translated, using the text extraction results as the target content, generating corresponding placeholder marks at the initial non-text content.

[0008] In one optional implementation, each placeholder marker is mapped to the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping table, including: performing semantic parsing on the initialization page to obtain the source text content, layout information, and contextual semantic information of each target content; associating each placeholder marker with the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping table.

[0009] In one optional implementation, the source text content is translated into the target language according to the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping table to obtain the target translated content. This includes: inputting the source text content, layout information, and contextual semantic information corresponding to each placeholder mark in the target mapping table into a preset large language model to obtain the target translated content.

[0010] In one optional implementation, the layout adaptation adjustment of the target translation content includes: adjusting the layout of the target translation content corresponding to each placeholder mark according to the layout information corresponding to each placeholder mark, adjusting the text direction of the target translation content according to a preset language rule table, and adjusting the text length of the target translation content.

[0011] In one optional implementation, updating the target translation content after layout adaptation to the initialization page according to the placeholder markers to obtain the target internationalization page includes: replacing the content at the marker position corresponding to the placeholder marker in the initialization page with the target translation content after layout adaptation to obtain the target internationalization page.

[0012] In one optional implementation, after adjusting the layout of the target translated content to obtain the target internationalized page, the method for generating the internationalized page further includes: generating a Uniform Resource Locator (URL) based on the placeholder markers corresponding to the target internationalized page.

[0013] Secondly, the present invention provides an apparatus for generating an internationalized page, comprising: a content marking module, used to generate an initial page based on a page template selected by the user and multiple components, marking multiple target contents in the initial page to obtain placeholder marks corresponding to each target content; the target content is the content to be translated, and the target content corresponds one-to-one with the placeholder marks; an information mapping module, used to map each placeholder mark to the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping relationship table; a text translation module, used to translate the source text content into a target language based on the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping relationship table, to obtain target translated content; the target language is the language to be translated selected by the user; and a page generation module, used to perform layout adaptation adjustments on the target translated content, and update the layout-adapted target translated content to the initial page according to the placeholder marks, to obtain the target internationalized page.

[0014] Thirdly, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the computer instructions to perform the method for generating internationalized pages according to the first aspect or any corresponding embodiment described above.

[0015] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the method for generating an internationalized page according to the first aspect or any corresponding embodiment thereof.

[0016] Fifthly, the present invention provides a computer program product, including computer instructions for causing a computer to execute the method for generating an internationalized page according to the first aspect or any corresponding embodiment thereof. Attached Figure Description

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

[0018] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the first process of generating an internationalized page according to an embodiment of the present invention; Figure 3This is a schematic diagram of a second process for generating an internationalized page according to an embodiment of the present invention; Figure 4 This is a flowchart illustrating a method for generating a target mapping relationship table according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the third process of generating an internationalized page according to an embodiment of the present invention; Figure 6 This is a schematic diagram of the fourth process of generating an internationalized page according to an embodiment of the present invention; Figure 7 This is a schematic diagram of the fifth process of generating an internationalized page according to an embodiment of the present invention; Figure 8 This is a schematic diagram of the sixth process of generating an internationalized page according to an embodiment of the present invention; Figure 9 This is a schematic diagram illustrating the beneficial effects of the method for generating an internationalized page according to an embodiment of the present invention. Figure 10 This is a structural block diagram of an apparatus for generating an internationalized page according to an embodiment of the present invention; Figure 11 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0021] As an optional application scenario of this invention, such as Figure 1 As shown, the system for generating this internationalized page may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0022] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0023] This invention provides a method for generating internationalized pages, which uses placeholder tags to mark and translate target content, thereby improving the efficiency of generating internationalized pages.

[0024] According to an embodiment of the present invention, an embodiment of a method for generating an internationalized page is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0025] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 2 This is a first flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps: Step S201: Based on the page template and multiple components selected by the user, an initialization page is generated. Multiple target contents in the initialization page are marked to obtain placeholder marks corresponding to each target content. The target content is the content to be translated, and there is a one-to-one correspondence between the target content and the placeholder marks.

[0026] The page template is a preset page structure framework, containing basic elements such as layout and style, used to quickly generate pages; the components are reusable page function modules; the initial page is a page in the original language generated based on the page template selected by the user and multiple components. The initial page can be an H5 page, and the original language can be Simplified Chinese.

[0027] In some alternative implementations, the target content is the text to be translated that exists on the initialization page; the placeholder marker is a special marker used to uniquely identify each target content to be translated.

[0028] In some optional implementations, multiple page templates and multiple components for implementing different functions are preset. Users select page templates and multiple components according to their needs, and combine the page templates and multiple components to generate an initialization page.

[0029] Step S202: Map each placeholder marker to the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping table.

[0030] In the initialization page, each target content has corresponding source text content, layout information, and contextual semantic information. The source text content is the original language text of the target content; the layout information is the display attributes of the target content on the initial page, such as font, font size, color, alignment, and container size; the contextual semantic information is the context information of the target content; and the target mapping relationship table is a structured data table that records each placeholder mark and its corresponding source text content, layout information, and contextual semantic information.

[0031] In some optional implementations, each placeholder marker is associated with the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping table consisting of multiple placeholder markers and their corresponding source text content, layout information, and contextual semantic information.

[0032] Step S203: Translate the source text content into the target language according to the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping table to obtain the target translation content; the target language is the language to be translated selected by the user.

[0033] The target language is the language specified by the user into which the source text content needs to be translated. For example, the target language can be English. The target translation content is the target language text obtained after translating the source text content.

[0034] Step S204: Adjust the layout of the target translation content to adapt it. Update the target translation content after layout adaptation to the initial page according to the placeholder mark to obtain the target internationalization page.

[0035] Specifically, the target translated content is used to replace the content corresponding to the placeholder tags in the initial page; the target internationalization page is the final generated page that contains content in the target language and has a reasonable layout.

[0036] In some optional implementations, after adjusting the layout of the target translated content to obtain the target internationalized page, the method for generating the internationalized page further includes: generating a Uniform Resource Locator (URL) based on the placeholder markers corresponding to the target internationalized page.

[0037] The Uniform Resource Locator (URL) is a network address used to uniquely identify and access the target internationalized page. A URL is generated based on the placeholder tag corresponding to the target internationalized page and pushed to the user's terminal so that the user can access the internationalized page through the URL.

[0038] The internationalization page generation method provided in this embodiment generates an initial page based on the user-selected page template and multiple components, improving the development efficiency of the initial page. Multiple target contents in the initial page are marked, resulting in placeholder tags for each target content. These placeholder tags uniquely and clearly identify the target content requiring translation in the initial page, providing precise operation objects for subsequent translation. This embodiment maps each placeholder tag to the corresponding source text content, layout information, and contextual semantic information of the target content, obtaining a target mapping table. This establishes not only the correspondence between placeholder tags and source text content but also the correspondence between placeholder tags and layout information and contextual semantic information, providing data support for high-quality translation and accurate layout. The introduction of contextual semantic information ensures that subsequent translation is no longer based on independent words or sentences but on their specific context within the initial page, improving the accuracy of the target translation content. Furthermore, generating the target mapping table facilitates the management of target content and placeholder tags. This invention translates source text into the target language based on the layout information and contextual semantic information corresponding to each placeholder in the target mapping table, resulting in the target translated content. Combining layout and contextual semantic information during translation effectively avoids translations that are too long or too short due to language differences, as well as ambiguities or errors caused by missing context, thus improving the accuracy of language translation. This invention also performs layout adaptation adjustments on the target translated content, updating the adjusted target translated content to the initial page based on the placeholders, resulting in the target internationalized page. Utilizing placeholders to accurately update the target translated content to the corresponding positions on the initial page ensures the accuracy and completeness of the target translated content, avoiding misalignment or omissions. Layout adaptation adjustments to the translated content solve the typesetting problems caused by differences in the length of text in different languages, improving the quality of the target internationalized page.

[0039] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 3 This is a second flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps: Step S301: Based on the page template and multiple components selected by the user, an initialization page is generated. Multiple target contents in the initialization page are marked to obtain placeholder marks corresponding to each target content. The target content is the content to be translated, and the target content and the placeholder marks correspond one-to-one.

[0040] Specifically, step S301 includes: Step S3011: Generate an initialization page based on the page template and multiple components selected by the user; perform text recognition on multiple initial contents in the initialization page to obtain initial text content and initial non-text content; the initial content is the original content in the initialization page.

[0041] In some alternative implementations, users open the low-code H5 generation platform through a client (browser), select a page template, configure low-code components for the page template content, and generate an H5 initialization page with a unique identifier.

[0042] In some optional implementations, text recognition is performed on multiple initial contents in the initialization page to obtain initial text content and initial non-text content, including: parsing the initialization page to obtain multiple initial contents, traversing the multiple initial contents in the initialization page using the HTML (HyperText Markup Language) syntax rule base, and performing text recognition on the multiple initial contents in the initialization page to obtain initial text content and initial non-text content.

[0043] The initial text content refers to the plain text information extracted from the initial page after text recognition, such as titles, descriptions, and button text; the initial non-text content refers to the non-text information separated from the initial page after text recognition, such as images, videos, and icons.

[0044] Step S3012: Using the initial text content as the target content, generate corresponding placeholder markers at the initial text content location.

[0045] In some optional implementations, when the initial content is initial text content, the initial text content is directly used as the target content, and a corresponding unique placeholder mark is generated at the initial text content.

[0046] Step S3013: Extract text from the initial non-text content to obtain the text extraction result. Determine whether there is content to be translated in the text extraction result. If there is content to be translated in the text extraction result, use the text extraction result as the target content and generate a corresponding placeholder mark at the initial non-text content.

[0047] In some alternative implementations, optical character recognition (OCR) is used to extract text from the initial non-text content to obtain the text extraction result.

[0048] In some optional implementations, determining whether the text extraction result contains content to be translated includes: determining whether there is text in the text extraction result; if there is text, then determining that the text extraction result contains content to be translated; if there is no text, then determining that the text extraction result does not contain content to be translated.

[0049] In some alternative implementations, if the extracted text does not contain any content to be translated, then no marking is required.

[0050] In some optional implementations, a corresponding placeholder mark is generated at the initial non-text content location, including: replacing the corresponding mark content in the initialization page with the placeholder mark, wherein the placeholder mark carries a unique placeholder identifier.

[0051] Step S302: Map each placeholder marker to the source text content, layout information, and contextual semantic information of the corresponding target content to obtain a target mapping table.

[0052] Specifically, step S302 includes: Step S3021: Perform semantic parsing on the initialized page to obtain the source text content, layout information, and contextual semantic information of each target content.

[0053] Step S3022: Associate each placeholder marker with the source text content, layout information and contextual semantic information of the corresponding target content to obtain a target mapping relationship table.

[0054] In some optional implementations, placeholders for the initial text content are associated with the corresponding source text content, layout information, and contextual semantic information to obtain a first mapping table; placeholders for the initial non-text content are associated with the corresponding source text content, layout information, and contextual semantic information to obtain a second mapping table; and the first and second mapping tables are merged to obtain a target mapping table.

[0055] In some alternative implementations, each placeholder tag carries a unique placeholder identifier, source text content, layout information, and contextual semantic information.

[0056] For example, Figure 4This is a flowchart illustrating the method for generating a target mapping relationship table according to an embodiment of the present invention. The method involves obtaining an H5 page source file (i.e., initializing the page), parsing and constructing the H5 page source file using DOM (Document Object Model), extracting content features to obtain multiple initial contents, determining whether each initial content is text content, establishing a placeholder mapping if the initial content is text content, and performing OCR recognition on the initial non-text content to determine if text exists if text exists. If text exists, a placeholder mapping is established, and contextualized placeholders are generated based on the placeholder mapping results. The mapping relationship table is then stored.

[0057] Specifically, the H5 processing server retrieves the uploaded H5 page source file and parses the H5 content into a standard DOM tree structure using an H5 parser. It then traverses each DOM node, adding metadata to each node. This metadata includes node type (whether it's plain text), node position, text font size, font type, text direction, and text length. It also stores unique node IDs for its neighbors, establishes contextual relationships between nodes, and finally generates a unique identifier for each node. Finally, it constructs an H5 content rule base, including regular HTML syntax rules, text node rules, non-text node rules, and style rules. It then traverses each DOM node and, based on the constructed H5... The content rule base extracts key node information, including node type (plain text, image, or other), node content, node layout information, and node context. If the node is a text node, the text content within the node is directly extracted; otherwise, the possible text in the image is identified using ORC. Contextualized placeholders are generated for each of the above translatable contents, and a unique placeholder ID is generated at the marked location. These placeholder IDs are then mapped to the original text content, text layout information (including text font, text font size, text direction, text length, etc.), and context information. The corresponding mapping relationships are stored, a mapping relationship table is generated, and the mapping relationship table is associated with the unique ID of the H5 page.

[0058] Step S303: Translate the source text content into the target language according to the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping relationship table to obtain the target translation content; the target language is the language to be translated selected by the user.

[0059] Specifically, step S303 includes: Step S3031: Input the source text content, layout information and contextual semantic information corresponding to each placeholder in the target mapping table into the preset large language model to obtain the target translation content.

[0060] Among them, the Large Language Model (LLM) is an artificial intelligence model based on deep learning.

[0061] In some optional implementations, the target mapping table is traversed, and based on layout information and contextual semantic information, a preset large language model is used to perform contextual translation on the source text content corresponding to the placeholder markers. The preset large language model prompt word is set to a professional translation expert. The source text content is translated in combination with layout information and contextual semantic information, and the translated target content is output. The target translation content includes the text length. The target translation content is stored in the corresponding target mapping table.

[0062] Step S304: Adjust the layout of the target translation content to adapt it. Update the target translation content after layout adaptation to the initial page according to the placeholder mark to obtain the target internationalization page.

[0063] Specifically, step S304 includes: Step S3041: Based on the layout information corresponding to each placeholder mark, adjust the layout of the target translation content corresponding to each placeholder mark, adjust the text direction of the target translation content according to the preset language rule table, and adjust the text length of the target translation content.

[0064] The process involves traversing the target mapping table, configuring the context layout of the target translation content corresponding to multiple placeholders based on the layout information of each placeholder, matching the text direction according to the preset language rule table for different languages, and adaptively scaling the text length according to the ratio of the text length before and after translation. If the ratio increases, the font size is reduced and the text wraps automatically; if the ratio decreases, the inner margin of the page is increased.

[0065] Step S3042: Replace the content at the marked position corresponding to the placeholder mark in the initialization page with the target translation content after layout adaptation adjustment to obtain the target internationalization page.

[0066] Specifically, if the content at the marked position corresponding to the placeholder mark is the initial text content, the content at the marked position corresponding to the placeholder mark is replaced with the target translation content after layout adaptation. If the content at the marked position corresponding to the placeholder mark is the initial non-text, the target translation content is generated based on the initial non-text, the text content at the marked position corresponding to the placeholder mark is replaced with the target translation content, and the target internationalization page is generated after traversing the target mapping relationship table.

[0067] The internationalized page generation method provided in this embodiment introduces contextualized placeholders compared to ordinary placeholders, associating them with contextual information to make the translation more accurate. Based on the characteristics of H5 files, it distinguishes between plain text and non-plain text content to be translated, performs DOM parsing on the H5 file, extracts and divides the content, and uses an OCR large model to extract the text content within images. It also proposes an adaptive H5 layout algorithm, calculating the adaptability of the translated H5 layout from dimensions such as text direction, length, and pixel size, which can effectively improve the efficiency and quality of generating internationalized H5 pages.

[0068] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 5 This is a third flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 5 As shown, the process includes the following steps: Select a pre-built H5 page template and configurable low-code components to generate an initial H5 page with a unique page ID (Identifier); based on the target language, parse the H5 page using H5 internationalization to generate an H5 page in the target language; store the generated H5 page and the corresponding page resources on the server according to the unique page ID; the server generates an accessible URL address based on the unique page ID to support page access.

[0069] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 6 This is a fourth flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 6 As shown, the process includes the following steps: Select a pre-set H5 page template and configurable low-code components to generate an initial H5 page with a unique page ID; parse the generated initial H5 page, traverse the page content based on the HTML syntax rule library, extract text and non-text content and store them separately; mark the acquired text content, replace it with contextualized placeholders and record the placeholder ID and contextual content, map the original text content to it and store it; perform OCR recognition on the acquired non-text content, extract the text information, record the placeholder ID, map the original content to it and store it; according to the target language, translate the extracted text content using an LLM large model in combination with the context, obtain the corresponding target language text content and store it according to the placeholder ID; adapt the translated text content to generate a translated H5 page using an adaptive typesetting algorithm.

[0070] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 7This is a fifth flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 7 As shown, the process includes the following steps: Obtain the initial H5 page; parse the H5 page content; determine if the H5 page content is text; if so, replace it with contextualized placeholders; if not, perform OCR text recognition and replace it with contextualized placeholders; perform contextual translation using LLM; adapt the H5 page layout; generate the target language H5 page.

[0071] This embodiment provides a method for generating internationalized pages, which can be used on computer devices. Figure 8 This is a sixth flowchart of a method for generating an internationalized page according to an embodiment of the present invention, such as... Figure 8 As shown, the process includes the following steps: The process involves traversing the H5 page to obtain node information, treating each target content as a node; determining whether a node is plain text; if it is plain text, performing rule matching; if it is not plain text, obtaining the text recognized by OCR and performing rule matching, which includes three rules: consistent context layout, text direction, and text length. After rule matching, the process re-determines whether the node is plain text. If it is not plain text, the original image is obtained, and text replacement is performed using the LLM large model. H5 node integration is then performed. If it is plain text, H5 node integration is performed to generate an H5 page in the target language.

[0072] In some alternative implementations, Figure 9 This is a schematic diagram illustrating the beneficial effects of the method for generating an internationalized page according to an embodiment of the present invention. H5 parsing and H5 content classification are used to solve the translation of non-text content; contextualized translation is used to solve mistranslations due to missing context; adaptive layout and typesetting are used to solve layout disorder; and finally, an internationalized H5 page is generated.

[0073] This embodiment also provides an internationalized page generation apparatus, which is used to implement the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0074] This embodiment provides a device for generating internationalized pages, such as... Figure 10 As shown, it includes: The content tagging module 1001 is used to generate an initial page based on the page template and multiple components selected by the user, and to tag multiple target contents in the initial page to obtain placeholder tags corresponding to each target content; the target content is the content to be translated, and there is a one-to-one correspondence between the target content and the placeholder tags.

[0075] The information mapping module 1002 is used to map each placeholder mark to the source text content, layout information and contextual semantic information of the corresponding target content to obtain a target mapping relationship table.

[0076] The text translation module 1003 is used to translate the source text content into the target language according to the layout information and contextual semantic information corresponding to each placeholder mark in the target mapping relationship table, so as to obtain the target translation content; the target language is the language to be translated selected by the user.

[0077] The page generation module 1004 is used to adjust the layout of the target translation content. Based on the placeholder markers, the adjusted target translation content is updated to the initial page to obtain the target internationalization page.

[0078] In some alternative implementations, the content tagging module 1001 includes: The content recognition unit is used to perform text recognition on multiple initial contents in the initialization page to obtain initial text content and initial non-text content; the initial content is the original content in the initialization page.

[0079] The text content tagging unit is used to take the initial text content as the target content and generate corresponding placeholder tags at the initial text content location.

[0080] The non-text content tagging unit is used to extract text from the initial non-text content, obtain the text extraction result, determine whether there is content to be translated in the text extraction result, and if there is content to be translated in the text extraction result, the text extraction result is used as the target content, and a corresponding placeholder tag is generated at the initial non-text content.

[0081] In some alternative implementations, the information mapping module 1002 includes: The semantic parsing unit is used to perform semantic parsing on the initialized page to obtain the source text content, layout information, and contextual semantic information of each target content.

[0082] The information association unit is used to associate each placeholder mark with the source text content, layout information and contextual semantic information of the corresponding target content to obtain a target mapping relationship table.

[0083] In some alternative implementations, the text translation module 1003 includes: The content translation unit is used to input the source text content, layout information, and contextual semantic information corresponding to each placeholder in the target mapping table into a preset large language model to obtain the target translation content.

[0084] In some alternative implementations, the page generation module 1004 includes: The layout adjustment unit is used to adjust the layout of the target translation content corresponding to each placeholder mark according to the layout information corresponding to each placeholder mark, adjust the text direction of the target translation content according to the preset language rule table, and adjust the text length of the target translation content.

[0085] The translation content replacement unit is used to replace the content at the marked position corresponding to the placeholder mark in the initial page with the target translation content after layout adaptation, so as to obtain the target internationalized page.

[0086] In some alternative implementations, the apparatus for generating internationalized pages further includes: The locator generation module is used to generate Uniform Resource Locators (URLs) based on the placeholder tags corresponding to the target internationalized page.

[0087] The internationalized page generation apparatus provided in this embodiment of the invention can execute the internationalized page generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method. Further functional descriptions of the various modules and units described above are the same as in the corresponding embodiments described above, and will not be repeated here.

[0088] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0089] The following is a detailed reference. Figure 11 The diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 1101, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 1102 or a program loaded from memory 1108 into random access memory (RAM) 1103. The RAM 1103 also stores various programs and data required for the operation of the electronic device. The processor 1101, ROM 1102, and RAM 1103 are interconnected via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0090] Typically, the following devices can be connected to I / O interface 1105: input devices 1106 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 1107 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 1108 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1109. Communication device 1109 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 11 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0091] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 1109, or installed from a memory 1108, or installed from a ROM 1102. When the computer program is executed by the processor 1101, it performs the functions defined in the internationalized page generation method of the embodiments of the present invention.

[0092] Figure 11 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0093] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium after being downloaded via a network. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium may also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the internationalized page generation method shown in the above embodiments is implemented.

[0094] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0095] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A method for generating an internationalized page, characterized by, The method comprises: According to the page template selected by the user and the plurality of components, an initialization page is generated, a plurality of target contents in the initialization page are marked to obtain a placeholder mark corresponding to each target content; the target content is to-be-translated content, and the target content and the placeholder mark correspond one by one; Each placeholder mark is mapped with source text content, layout information and context semantic information of the corresponding target content to obtain a target mapping relationship table; According to the layout information and the context semantic information corresponding to each placeholder mark in the target mapping relationship table, the source text content is translated into a target language to obtain target translation content; the target language is a to-be-translated language selected by the user; The target translation content is layout-adapted and adjusted, the target translation content after the layout adaptation and adjustment is updated into the initialization page according to the placeholder mark, and a target internationalization page is obtained.

2. The method of claim 1, wherein, The plurality of target contents in the initialization page are marked to obtain a placeholder mark corresponding to each target content, comprising: Text recognition is performed on the plurality of initial contents in the initialization page to obtain initial text content and initial non-text content; the initial content is original content in the initialization page; The initial text content is taken as the target content, and the corresponding placeholder mark is generated at the initial text content; Text extraction is performed on the initial non-text content to obtain a text extraction result, it is judged whether the text extraction result contains to-be-translated content, if the text extraction result contains to-be-translated content, the text extraction result is taken as the target content, and the corresponding placeholder mark is generated at the initial non-text content.

3. The method according to claim 1 or 2, characterized in that, The mapping of each placeholder mark with source text content, layout information and context semantic information of the corresponding target content to obtain a target mapping relationship table comprises: Semantic analysis is performed on the initialization page to obtain the source text content, the layout information and the context semantic information of each target content; Each placeholder mark is associated with the source text content, the layout information and the context semantic information of the corresponding target content to obtain the target mapping relationship table.

4. The method according to claim 1 or 2, characterized in that, According to the layout information and the context semantic information corresponding to each placeholder mark in the target mapping relationship table, the source text content is translated into a target language to obtain target translation content, comprising: The source text content, the layout information and the context semantic information corresponding to each placeholder mark in the target mapping relationship table are input into a preset large language model to obtain target translation content.

5. The method according to claim 1 or 2, characterized in that, The layout adaptation and adjustment of the target translation content comprise: According to the layout information corresponding to each placeholder mark, the target translation content corresponding to each placeholder mark is layout-adjusted, the text direction of the target translation content is adjusted according to a preset language rule table, and the text length of the target translation content is adjusted.

6. The method of claim 1 or 2, wherein, The target translation content is updated into the initialization page according to the placeholder mark, and a target internationalization page is obtained. The content of the mark position corresponding to the placeholder mark in the initialization page is replaced by the target translation content, and a target internationalization page is obtained.

7. The method according to claim 1 or 2, characterized in that, After the target translation content is adjusted for layout adaptation to obtain the target internationalization page, the method further comprises: A uniform resource locator is generated according to the placeholder mark corresponding to the target internationalization page.

8. An apparatus for generating internationalized web pages, characterized in that, The device comprises: A content mark module is configured to generate an initialization page according to a page template selected by a user and a plurality of components, mark a plurality of target contents in the initialization page to obtain a placeholder mark corresponding to each target content, wherein the target content is to-be-translated content, and the target content and the placeholder mark correspond to each other; An information mapping module is configured to map each placeholder mark with source text content, layout information and context semantic information of the corresponding target content to obtain a target mapping relationship table; A text translation module is configured to translate the source text content into a target language according to the layout information and the context semantic information corresponding to each placeholder mark in the target mapping relationship table to obtain target translation content, wherein the target language is a to-be-translated language selected by the user; A page generation module is configured to adjust the target translation content for layout adaptation, update the target translation content adjusted for layout adaptation into the initialization page according to the placeholder mark, and obtain a target internationalization page.

9. An electronic device, comprising: The memory and the processor are communicatively connected, the memory stores computer instructions, and the processor executes the computer instructions to perform the method for generating an internationalization page according to any one of claims 1 to 7. The computer readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the method for generating an internationalization page according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer instructions are used to make a computer execute the method for generating an internationalization page according to any one of claims 1 to 7.

11. A computer program product, characterised in that, ​

Citation Information

Patent Citations

  • Language translation method and device, electronic equipment and storage medium

    CN115329782A

  • Automatic multi-language construction method, system and device and storage medium

    CN119166251A

  • Text translation method and device and storage medium

    CN119962543A

  • Multi-language internationalization translation method and system, medium and equipment

    CN121303160A

  • Page generation method, system, equipment and medium

    CN121433658A