CN113297858A - Page processing method, system and device and client equipment - Google Patents

Page processing method, system and device and client equipment Download PDF

Info

Publication number
CN113297858A
CN113297858A CN202010113528.5A CN202010113528A CN113297858A CN 113297858 A CN113297858 A CN 113297858A CN 202010113528 A CN202010113528 A CN 202010113528A CN 113297858 A CN113297858 A CN 113297858A
Authority
CN
China
Prior art keywords
page
translated
translation
page data
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010113528.5A
Other languages
Chinese (zh)
Inventor
陈曦
吴剑锋
王皓
周鸿伟
冯泽宇
欧夺标
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010113528.5A priority Critical patent/CN113297858A/en
Publication of CN113297858A publication Critical patent/CN113297858A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/58Use of machine translation, e.g. for multi-lingual retrieval, for server-side translation for client devices or for real-time translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A page processing method, system, device and client device are disclosed. The page processing method comprises the following steps: judging that the current page is a page to be translated; acquiring original page data needing to be translated in the current page; and replacing the original page data with the translated page data to obtain the translated current page. The invention directly uses the translated words to replace the original words in the page, can change the original word content in the page and simultaneously reserve the positions of elements such as pictures, videos, jump links, backgrounds and the like in the website, thereby providing page translation under the condition of not changing the original layout and typesetting of the website of the page.

Description

Page processing method, system and device and client equipment
Technical Field
The present invention relates to the field of page browsing, and in particular, to a page processing method, system, apparatus, and client device.
Background
At present, more and more users can visit websites of other countries through browsers, and the websites often do not support the Chinese mode or have poor Chinese effect. For such websites, generalized translation for pages may help users without the ability to read other languages to smoothly read the content of the web page. The existing page translation model has the problems that the local semantic smoothness is difficult to realize (for example, the translated Chinese expression is not consistent), the selectable languages are limited, and the user cannot perform active translation operation.
Accordingly, there is a need for an improved page processing scheme that enables page translation and display.
Disclosure of Invention
In order to solve at least one of the above problems, the present invention proposes a page processing scheme. According to the scheme, the data (such as characters) to be translated is acquired by judging that the page needs to be translated, and the translated characters are used for replacing the original characters, so that the positions of elements such as pictures, videos, jump links, backgrounds and the like in a website can be reserved while the original character content in the page is changed, and page translation is provided under the condition that the original layout and the typesetting of the website of the page are not changed.
According to a first aspect of the present invention, a page processing method is provided, including: judging that the current page is a page to be translated; acquiring original page data needing to be translated in the current page; and replacing the original page data with the translated page data to obtain the translated current page.
According to a second aspect of the present invention, there is provided a page processing system comprising: the server is used for translating and issuing the original page data; the client device is used for judging that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
According to a third aspect of the present invention, there is provided a client device comprising: a memory and a processor; the memory is used for storing translated page data issued by the translation server; the processor is used for judging that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
According to a fourth aspect of the present invention, there is provided a page processing apparatus comprising: the judging unit is used for judging that the current page is a page to be translated; the page data acquisition unit is used for acquiring original page data needing to be translated in the current page; and a page data replacing unit for replacing the original page data with the translated page data to obtain the translated current page.
According to a fifth aspect of the invention, there is provided a computing device comprising: a processor; and a memory having executable code stored thereon, which when executed by the processor causes the processor to perform the page processing method of the first aspect as described above.
According to a sixth aspect of the present invention, there is provided a non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the page processing method of the first aspect.
The page processing scheme of the invention can inject JavaScript script into the website by translating the content returned by the SDK, and can keep the positions of elements such as pictures, videos, jump links, backgrounds and the like in the website while changing the original text content in the page, thereby providing page translation without changing the original layout and typesetting of the page website.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in greater detail exemplary embodiments thereof with reference to the attached drawings, in which like reference numerals generally represent like parts throughout.
FIG. 1 shows a schematic flow diagram of a page processing method according to one embodiment of the invention.
Fig. 2 shows an example of page processing using the present invention.
FIG. 3 is a schematic block diagram of a page processing system according to one embodiment of the present invention.
FIG. 4 shows a schematic composition diagram of a client device according to one embodiment of the invention.
Fig. 5 is a schematic block diagram of a page processing apparatus according to an embodiment of the present invention.
Fig. 6 shows a comparative example before and after the page treatment according to the invention.
Detailed Description
Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
At present, more and more users can visit websites of other countries through browsers, and the websites often do not support the Chinese mode or have poor Chinese effect. For such websites, generalized translation for pages may help users without the ability to read other languages to smoothly read the content of the web page. The existing page translation model has the problems that the local semantic smoothness is difficult to realize (for example, the translated Chinese expression is not consistent), the selectable languages are limited, and the user cannot perform active translation operation.
Therefore, the invention provides an improved page processing scheme, which can inject JavaScript script into a website by translating the content returned by the SDK, change the original text content in the page, and simultaneously reserve the positions of elements such as pictures, videos, jump links, backgrounds and the like in the website, thereby providing page translation without changing the original layout and typesetting of the page website.
FIG. 1 shows a schematic flow diagram of a page processing method according to one embodiment of the invention. The method may be performed by a client device. Herein, a client device refers to a device having a web browsing function, and may particularly include a mobile smart device, such as a smartphone and a tablet computer. More specifically, the method may be performed by a browser application installed on a client device. Here, the browser application may refer to a dedicated browser application or an application having a page browsing function.
In step S110, it is determined that the current page is a page to be translated. In step S120, the original page data to be translated in the current page is obtained. In step S130, the translated page data is used to replace the original page data to obtain the translated current page. The original page data that needs to be translated typically includes only textual data. Therefore, the translated words are used for replacing the original words, so that the positions of elements such as pictures, videos, jump links, backgrounds and the like in a website are reserved while the original word content in the page is changed (namely, the whole page is not redrawn and rendered), and page translation is provided under the condition that the original layout and typesetting of the page website are not changed. Therefore, the translation page can be efficiently and quickly acquired, the method is more suitable for long page browsing, and in addition, the provided translation page and the original page have the same layout and typesetting, so that the translation page is easier to read and has more aesthetic feeling.
In a preferred embodiment of the present invention, a translation SDK (Software Development Kit) may be packaged in the browser application for executing the above page processing method, and after the browser application is started, the translation SDK is initialized to implement a corresponding translation function. In one embodiment, the translated SDK source code may be compiled into a jar library by a java (java language programming compiler) compiler and packaged into the browser application in a jar library manner. By packaging, the translation SDK can be compiled into a binary executable program, i.e., a final runnable browser package, together with the browser application.
For this reason, before step S110, a step of opening a browser application for displaying a page may be further included. The translation SDK contained within the browser application, when enabled (initialized), can establish communication with the translation server or translate using a local translation model. In different embodiments, the translation SDK may be initialized under different circumstances. For example, the initialization is performed automatically after the browser application is opened, based on a user operation, or at the discretion of other functions (e.g., a discretionary function module) of the browser application.
Specifically, in step S110, the determining that the current page is the page to be translated may include: acquiring page characteristic information of the current page; and judging the current page as a page to be translated based on the acquired page characteristic information. Here, the page characteristic information may be domain name information of the page. Here, the domain name information may refer to a web address for accessing the page, such as a URL (uniform resource identifier) of the page. For example, some web sites themselves can indicate the country to which the site belongs, and can thus be presumed to be foreign language sites that require translation (e.g., sites ending in co.jp are typically japanese sites). In a multi-language-enabled site, the domain name information will also typically include information referring to the display language such as/en/or/fr (e.g.,/en/English,/fr/French). Additionally or alternatively, the page characteristic information may be HTML tag information of the page. For example, when the browser acquires HTML data of a page for display, the browser may determine that the page is a page to be translated through a specific language tag in the data. In addition or alternatively, the page feature information may be content information of the page itself, such as title information or body information of the page, so that the page can be judged as a page needing translation by directly judging the content of the page itself.
In different embodiments, the page processing scheme of the present invention may determine whether the current page is a page to be translated based on different mechanisms. For example, the browser application may include a special determination unit or a function module to perform the above determination, and activate the translation SDK based on the determination that the current page is the page to be translated. For example, the translation SDK itself may be used to determine that the current page is a page to be translated. Alternatively or additionally, the current page may be judged as the page to be translated based on the user clicking the translation function menu, and the translation SDK may be enabled (initialized) accordingly.
Subsequently, in step S120, the translation SDK may screen out the original page data to be translated from the obtained current page data. For example, the translation SDK may obtain HTML data of a current page, and filter out contents to be translated based on a preset criterion.
In various embodiments, the raw page data to be translated may include at least one of: the text content of the page; text content determined to be foreign language; selecting the text content of the language; and the digital and/or symbolic content that needs to be changed. In one conventional embodiment, the translation SDK may take all displayed characters (e.g., including text, numbers, and symbols) in the current page as the original page data that needs to be translated, or may select only text and punctuation for translation. In a preferred embodiment, when the display page includes advertisements or other irrelevant content in addition to the body content, the translation SDK may only obtain the body content of the page as the original page data that needs to be translated. Alternatively or additionally, the translation SDK may obtain text content that is determined to be foreign, e.g., all foreign text content, or text content in a selected language, and may have exceptions that remain untranslated, e.g., widely known foreign languages such as "OK" or "sports". For example, the official website of a certain japanese celebrity is entitled to "good quality good (herein referred to as" japanese person name ") and, in different embodiments, all foreign languages (i.e.," good quality good ") may be entirely regarded as raw page data to be translated, and only a specified foreign language, for example, japanese (i.e.," good quality good ") may be translated, or only" good "may be translated when widely known japanese such as" good "is left un-translated. In another embodiment, specific numbers or symbols may be changed. For example, "$" may be translated as "dollars" when displaying an overseas shopping website, and even "100 $," for example, may be changed to "700 RMB" or "700 dollars" based on the current exchange rate.
In different embodiments, the translation SDK may use a local translation model to obtain translated page data based on the original page data, may use a cloud translation function to translate, or may use a combination of both. When the cloud translation function is used, the translation SDK uploads original page data to be translated to the translation server. The translation server completes translation and issues the translation. The translation SDK obtains translated page data returned by the translation server.
In the invention, a user can call up a function menu of the mobile phone browser App through a specific gesture, and touch a corresponding 'translation' function to execute the translation of the current page. Here, the user may merely click on the translation function, or further select the "Source language" and "target language" of the translation, e.g., from Japanese to Chinese. In other embodiments, the user may not set the "source language" and/or the "target language," but instead the browser front-end or the server back-end may make the determination, or based on default settings. For example, the target language may be set to "Chinese" by default. In addition, in the case where the user has good foreign language reading ability of one or even a plurality of, the user can set the english and japanese pages as not translated or not automatically translated on, for example, the browser setting page.
In the event that the user selects a source and/or target language, the translation SDK may upload the user selected source and/or target language information to the translation server. For example, the translation SDK may also determine the source language itself based on the page feature information and select the target language based on default or user routine or nationality. The translation server may then select the corresponding source language and/or target language translation model for translation. Alternatively or additionally, the translation server may select a specific translation model for translation based on the domain name of the current page or the original page data. For example, the translation server may determine that the source and/or target language information uploaded by the translation SDK is not accurate enough and may instead make the determination of the source and/or target language using the original page data itself, or, for example, page feature data uploaded by the translation SDK in combination with the translation SDK. The translation server may select different scene models for translation even if the source and target languages have been determined. For example, the same english has different translations in different shopping categories at a time, and the translation server may select a corresponding special scene model for translation according to, for example, the category information in the domain name data.
Subsequently, the obtaining, by the translation SDK, the translated page data returned by the translation server may include: the translation SDK obtains translated page data generated by the translation server by selecting a corresponding source language and/or target language translation model, or obtains translated page data generated by the translation server by selecting a specific translation model, wherein the specific translation model is selected based on the original page data or the domain name of the current page.
For convenience of operation and avoiding unnecessary traffic or waste of storage, the page processing method of the present invention may further include: continuously acquiring original page data content of a page under the same domain name to be translated; and continuously replacing the original page data with the translated page data. Here, the same domain name may refer to the complete page content under the same URL. For example, when the user slides the display screen of the mobile phone to display the page content, the scheme continues to perform the current page translation and content display. Alternatively or additionally, the same domain name may also refer to the content of different pages under the same website. For example, when the user browses each commodity page on a foreign shopping website, the scheme can also continuously and automatically perform translation and content display of each current page of the jump. .
In step S130 of the present invention, the page content is preferably changed by JavaScript script injection (hereinafter referred to as js injection). Thus, step S130 may include: and injecting a JavaScript script into the current page, wherein the JavaScript script replaces the original page data with the translated page data. Here, the JavaScript script may select a page element that needs to be replaced, and replace the page element with the translated content. The browser client can inject js into the website according to the content returned by the translation SDK, so that the original text content in the website is changed, the positions of elements such as pictures, videos, jump links, backgrounds and the like in the website are reserved, and webpage translation is realized under the condition that the original layout and typesetting of the website are not changed.
In order to improve the readability of the translated page, the replacing operation by using js injection can comprise at least one of the following operations: the JavaScript script displays the translated page data by using the word size, color, font and/or style of the original page data; the JavaScript script displays the translated page data based on a page layout using the modified font size, color, font and/or style of the original page data; and the JavaScript script alters the interrelationship of two or more translated page data items based on the page layout. For example, the injected js may display the translated content in a manner that is as consistent as possible with the original presentation. But the presentation of the translated content can be adjusted appropriately when the translated content deviates significantly from the original content. For example, if more characters are translated and take up more space, the font size may be reduced accordingly to avoid truncating the translated content or otherwise obstructing the display of other elements in the page. In addition, if there is a correlation between two elements in the page and the display according to the original page layout will affect the understanding of the user, the content of the two page elements may be adjusted, for example, in order or in an up-down relationship.
When the js is injected into the browser client, the content in the current browsing window can be preferentially injected by using a segmented injection mode, and then the content in other areas of the website can be injected, so that the translation speed in the current browsing area is improved. Then, injecting the JavaScript script to the current page may include: and based on the page area, the JavaScript script is injected in a segmented mode.
In one embodiment, injecting js segments may include injecting the JavaScript script into the current browsing area. Alternatively or additionally, the segmentally injecting js may include injecting the JavaScript script into the predicted to-be-browsed area based on the browsing direction, for example, when the current window is slid, js may be injected before going to another area of the current page, so that it is ensured that the translation effect is achieved when the page display is switched. Alternatively or additionally, segmentally injecting js may include injecting the JavaScript script into the current page body area. Alternatively or additionally, segmentally injecting js may further include injecting the JavaScript script into a result display area of a particular domain name. The page processing scheme (or specifically, the translation SDK) can detect the domain name change, and any operation under the same domain name can be automatically translated by the original 'original language' and 'target language', so that the consistent experience of a user in the access process is kept. When the non-same-domain name website is switched to in the browsing process, the operation of automatically requesting the translation result and injecting js can be stopped, so that unnecessary traffic consumption is avoided.
Fig. 2 shows an example of page processing using the present invention. As shown, a user may access a website using a browser client, making calls to translate the SDK based on browser monitoring or user selection. The translation SDK can preferably support multiple languages, so that the browser client can flexibly switch the target language and the original language. The translation SDK obtains the page content to be translated by default and transmits the related content to the server, and the server judges the language type of the web page, so that the condition that a user mistakenly identifies the web language and selects a wrong translation type is effectively avoided. In addition, the translation SDK can also realize translation content and effect together with the service end. The translation SDK may support the delivery of specific text information to the server according to the content of the website, and the server performs translation using, for example, an IM (instant messaging) scene model according to the delivered content. And then, the server side can return the translation result to the browser client side, and the client side can realize the display of the translation page through js injection.
The translation SDK and the server side can work cooperatively to continuously translate page contents in the same domain name and cooperate with corresponding segmented js injection. When the domain name change is detected, namely when the website with a different domain name is switched to in the browsing process, the operation of automatically requesting the translation result and injecting js can be stopped. Subsequently, a re-request can be made when conditions are met (e.g., a foreign web site is accessed), repeating the operations described above for invoking the translation SDK, accessing the client, and js injection.
In some embodiments, the page processing method of the present invention may further include the step of acquiring current location information. In one embodiment, the browser App for implementing the page processing method of the present invention may directly obtain the current geographical location information of the terminal, for example, obtain GPS positioning information of a smartphone. In another embodiment, the browser App may determine, through the networked gateway, the area where the user is currently located, e.g., the IP address shows that the user is located in the west lake, hangzhou, zhejiang.
The location information can be used by the translation SDK to help determine the source and/or target languages. For example, when the browser App is initially installed in the absence of default user information, the target language of the user may be determined from the current location information. For example, if the user is located in China for a long period of time, the translation SDK may consider the user to be a Chinese user and default the target language to Chinese.
In some cases, for example, the current location information indicates that the user is abroad, for example, the user is traveling in japan or europe, and the terminal may determine that the user temporarily travels abroad by a change in the location information. When a user travels in a foreign country, the user typically needs to access the web site in the language of that country. To this end, the translation SDK may determine a source language based on the current location information. Further, the translation SDK may screen out original page data to be translated from the obtained current page data based on the determined source language.
Therefore, the page processing method can automatically judge the source language and/or the target language according to the acquired current position information (including the position information which is acquired continuously historically), and accordingly, a translation module of the corresponding language is started to finish translation and replacement of the original page content.
The page processing scheme of the present invention can also be implemented as a page processing system. FIG. 3 is a schematic block diagram of a page processing system according to one embodiment of the present invention. As shown, the system 300 includes a server 310 and a plurality of client devices 320. The server 310 is used for translating the original page data and issuing the page data. Typically, the server 310 needs to provide translation services to a large number of client devices 320 at the same time. The client device 320 is configured to determine that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
FIG. 4 shows a schematic composition diagram of a client device according to one embodiment of the invention. As shown in fig. 4, client device 400 includes memory 410 and processor 420. The memory 410 is used for storing translated page data issued by the translation server. The processor 420 is configured to determine that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
The processor 420 in the above apparatus may be implemented as a stand-alone device structure, or the application functions implemented by the processor may be viewed as a stand-alone device structure. The independent apparatus structure may be referred to as a page processing apparatus, which may include a plurality of units. Fig. 5 is a schematic block diagram of a page processing apparatus according to an embodiment of the present invention.
The client device 420 may also be implemented as a computing device for implementing the page processing method of the present invention. Here, the processor 420 may be one multi-core processor or may include a plurality of processors. In some embodiments, processor 420 may include a general-purpose host processor and one or more special coprocessors such as a Graphics Processor (GPU), a Digital Signal Processor (DSP), or the like. In some embodiments, processor 420 may be implemented using custom circuits, such as an Application Specific Integrated Circuit (ASIC) or a Field Programmable Gate Array (FPGA).
The memory 410 may include various types of storage units, such as system memory, Read Only Memory (ROM), and permanent storage. Wherein the ROM may store static data or instructions that are required by the processor 420 or other modules of the computer. The persistent storage device may be a read-write storage device. The persistent storage may be a non-volatile storage device that does not lose stored instructions and data even after the computer is powered off. In some embodiments, the persistent storage device employs a mass storage device (e.g., magnetic or optical disk, flash memory) as the persistent storage device. In other embodiments, the permanent storage may be a removable storage device (e.g., floppy disk, optical drive). The system memory may be a read-write memory device or a volatile read-write memory device, such as a dynamic random access memory. The system memory may store instructions and data that some or all of the processors require at runtime. Further, the memory 410 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), magnetic and/or optical disks, may also be employed. In some embodiments, memory 410 may include a removable storage device that is readable and/or writable, such as a Compact Disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, dual layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, min SD card, Micro-SD card, etc.), a magnetic floppy disc, or the like. Computer-readable storage media do not contain carrier waves or transitory electronic signals transmitted by wireless or wired means.
The memory 410 has stored thereon executable code that, when processed by the processor 420, causes the processor 420 to perform the page processing methods described above.
Fig. 5 is a schematic block diagram of a page processing apparatus according to an embodiment of the present invention.
As shown in fig. 5, the page processing apparatus 500 may include a judgment unit 510, a page data acquisition unit 520, and a page data replacement unit 530. The determining unit 510 may be configured to determine that the current page is a page to be translated. The page data obtaining unit 520 may be configured to obtain original page data that needs to be translated in the current page. The page data replacing unit 530 may be configured to replace the original page data with the translated page data to obtain the translated current page.
In one embodiment, the apparatus may further include an initialization module configured to initialize the translation SDK packaged in the application and establish communication with a translation server after a browser application displaying a page is started.
In one embodiment, the determining unit 510 may be configured to at least one of: judging that the current page is a page to be translated based on the translation SDK; and judging the current page as the page to be translated based on the translation function menu clicked by the user.
In one embodiment, the page data replacement unit 520 may be configured to: and injecting a JavaScript script into the current page, and replacing the original page data by the JavaScript script by using the translated page data.
In various implementations, the game SDK may implement part or all of the functions of the above-described determination unit 510, page data acquisition unit 520, and page data replacement unit 530.
The page processing method, system, apparatus and client device according to the present invention have been described in detail above with reference to the accompanying drawings. The page processing scheme of the invention can inject JavaScript script into the website by translating the content returned by the SDK, and can keep the positions of elements such as pictures, videos, jump links, backgrounds and the like in the website while changing the original text content in the page, thereby providing page translation without changing the original layout and typesetting of the page website.
In the prior art, the translation function on the mobile side (e.g., smartphone) is supported primarily by the search engine, not the browser. This is mainly because a good translation model is not available, and it is difficult to maintain the original page layout after translating a web page, and the translated page is easily confused and becomes unreadable. Therefore, the invention is particularly suitable for being realized as a browser application with page translation and presentation functions, the browser application solves the problem of multilingual high-quality translation by combining with a strong cloud translation service, and on the other hand, the original webpage content can be processed by a built-in translation SDK (software development kit), and then the translated readable page can be presented by using a js injection form through a client under the condition of not influencing the original webpage typesetting. Fig. 6 shows a comparative example before and after the page treatment according to the invention. As shown in the figure, the presentation mode of font, font size, etc. is also kept unchanged from the original web page while the original web page layout is maintained. For example, the fonts such as red, highlight, bolding and the like in the original webpage can all keep the original style. The processed page also comprises a function menu from the source language to the target language. The figure shows a setting of automatically detecting a source language and translating into a Chinese language by default, and at this time, for example, the server can judge that the source language of the page is English (not Greek language appearing individually) according to the obtained page data, and select a corresponding English-to-Chinese translation model for translation and page presentation.
Furthermore, the method according to the invention may also be implemented as a computer program or computer program product comprising computer program code instructions for carrying out the above-mentioned steps defined in the above-mentioned method of the invention.
Alternatively, the invention may also be embodied as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) having stored thereon executable code (or a computer program, or computer instruction code) which, when executed by a processor of an electronic device (or computing device, server, etc.), causes the processor to perform the steps of the above-described method according to the invention.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (25)

1. A page processing method includes:
judging that the current page is a page to be translated;
acquiring original page data needing to be translated in the current page; and
replacing the original page data with the translated page data to obtain the translated current page.
2. The method of claim 1, wherein replacing the original page data with translated page data comprises:
and injecting a JavaScript script into the current page, wherein the JavaScript script replaces the original page data with the translated page data.
3. The method of claim 2, wherein injecting a JavaScript script into the current page comprises:
and based on the page area, the JavaScript script is injected in a segmented mode.
4. The method of claim 3, wherein based on page regions, injecting the JavaScript script in segments comprises at least one of:
injecting the JavaScript script into the current browsing area;
based on the browsing direction, injecting the JavaScript script into the predicted to-be-browsed area;
injecting the JavaScript script into the text area of the current page; and
and injecting the JavaScript script into a result display area of a specific domain name.
5. The method of claim 2, wherein the JavaScript script replacing the original page data with the translated page data comprises at least one of:
the JavaScript script displays the translated page data by using the word size, color, font and/or style of the original page data;
the JavaScript script displays the translated page data based on a page layout using the modified font size, color, font and/or style of the original page data; and
the JavaScript script alters the interrelationship of two or more translated page data items based on the page layout.
6. The method of claim 1, wherein determining that the current page is a page to be translated comprises:
acquiring page characteristic information of the current page; and
judging the current page as a page to be translated based on the acquired page characteristic information,
wherein, based on the acquired page feature information, the judging that the current page is the page to be translated includes:
based on the judgment that the current page is the page to be translated, starting the translation SDK, and/or
And the translation SDK judges that the current page is the page to be translated.
7. The method of claim 1, wherein determining that the current page is a page to be translated comprises:
judging the current page as a page to be translated based on the translation function menu clicked by the user; and
translation SDK is enabled.
8. The method according to claim 6 or 7, wherein the acquired page feature information comprises at least one of:
domain name information of the page;
HTML markup information of the page;
title information of the page; and
and text information of the page.
9. The method of claim 6 or 7, wherein obtaining original page data in the current page that needs to be translated comprises:
and screening out original page data needing to be translated from the obtained current page data by the translation SDK.
10. The method of claim 9, wherein the original page data to be translated comprises at least one of:
all foreign language text contents;
selecting the text content of the language; and
requiring altered numerical and/or symbolic content.
11. The method of claim 9, further comprising at least one of:
the translation SDK obtains translated page data based on the original page data using a local translation model, an
The translation SDK uploads original page data to be translated to a translation server;
and the translation SDK acquires the translated page data returned by the translation server.
12. The method of claim 11, further comprising:
the translation SDK uploads user-selected source and/or target language information to the translation server, and
the step of acquiring the translated page data returned by the translation server by the translation SDK comprises the following steps:
the translation SDK obtains translated page data generated by the translation server by selecting a corresponding source language and/or target language translation model, or
The translation SDK obtains translated page data generated by the translation server by selecting a specific translation model, wherein the specific translation model is selected based on the domain name of the original page data or the current page.
13. The method of claim 9, further comprising:
opening a browser application for displaying a page, the translation SDK being packaged within the application, and the translation SDK establishing communication with a translation server after being enabled.
14. The method of claim 9, further comprising:
and acquiring current position information.
15. The method of claim 14, wherein the translation SDK screening out original page data requiring translation from the obtained current page data comprises:
the translation SDK determines a source language based on the current position information; and
and screening the original page data needing to be translated from the obtained current page data by the translation SDK based on the determined source language.
16. The method of claim 14, further comprising:
the translation SDK determines a target language based on the current location information.
17. The method of claim 1, further comprising:
continuously acquiring original page data content of a page under the same domain name to be translated; and
continuously replacing the original page data with the translated page data.
18. A page processing system, comprising:
the server is used for translating and issuing the original page data;
the client device is used for judging that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
19. A client device, comprising: a memory and a processor;
the memory is used for storing translated page data issued by the translation server;
the processor is used for judging that the current page is a page to be translated; obtaining original page data needing to be translated in the current page by using a translation SDK; the translation SDK uploads the original page data to the server and acquires translated page data; and replacing the original page data with the translated page data to obtain the translated current page.
20. A page processing apparatus comprising:
the judging unit is used for judging that the current page is a page to be translated;
the page data acquisition unit is used for acquiring original page data needing to be translated in the current page; and
a page data replacing unit, configured to replace the original page data with the translated page data to obtain the translated current page.
21. The apparatus of claim 20, wherein the page data replacement unit is to:
and injecting a JavaScript script into the current page, and replacing the original page data by the JavaScript script by using the translated page data.
22. The apparatus of claim 20, further comprising:
and the initialization module is used for initializing the translation SDK packaged in the application and establishing communication with a translation server after the browser application displaying the page is started.
23. The apparatus of claim 22, wherein the determining unit is configured to at least one of:
judging that the current page is a page to be translated based on the translation SDK; and
and judging the current page as the page to be translated based on the translation function menu clicked by the user.
24. A computing device, comprising:
a processor; and
a memory having executable code stored thereon, which when executed by the processor, causes the processor to perform the method of any one of claims 1-17.
25. A non-transitory machine-readable storage medium having stored thereon executable code, which when executed by a processor of an electronic device, causes the processor to perform the method of any one of claims 1-17.
CN202010113528.5A 2020-02-24 2020-02-24 Page processing method, system and device and client equipment Pending CN113297858A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010113528.5A CN113297858A (en) 2020-02-24 2020-02-24 Page processing method, system and device and client equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010113528.5A CN113297858A (en) 2020-02-24 2020-02-24 Page processing method, system and device and client equipment

Publications (1)

Publication Number Publication Date
CN113297858A true CN113297858A (en) 2021-08-24

Family

ID=77317772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010113528.5A Pending CN113297858A (en) 2020-02-24 2020-02-24 Page processing method, system and device and client equipment

Country Status (1)

Country Link
CN (1) CN113297858A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104025079A (en) * 2011-09-09 2014-09-03 谷歌公司 User interface for translation webpage
CN104199917A (en) * 2014-08-29 2014-12-10 北京金山安全软件有限公司 Method and device for translating webpage content and client
CN104462074A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for conducting webpage data translation and browser client side
CN104881406A (en) * 2015-06-15 2015-09-02 携程计算机技术(上海)有限公司 Web page translation method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104025079A (en) * 2011-09-09 2014-09-03 谷歌公司 User interface for translation webpage
CN104199917A (en) * 2014-08-29 2014-12-10 北京金山安全软件有限公司 Method and device for translating webpage content and client
CN104462074A (en) * 2014-12-26 2015-03-25 北京奇虎科技有限公司 Method and device for conducting webpage data translation and browser client side
CN104881406A (en) * 2015-06-15 2015-09-02 携程计算机技术(上海)有限公司 Web page translation method and system

Similar Documents

Publication Publication Date Title
CN111339455B (en) Method and device for loading page first screen by browser application
JP6853397B2 (en) Content integration in non-browser applications
US9838444B2 (en) Systems and methods for dynamically providing fonts based on language settings
CN109740085B (en) Page content display method, device, equipment and storage medium
WO2018205773A1 (en) Message processing method and apparatus, storage medium, and computer device
JP6678773B2 (en) Server-based conversion of autoplay content to click-to-play content
CN111339458B (en) Page presentation method and device
US20100115452A1 (en) Methods and Systems for Providing Navigation Bars in a Client Browser for a Client Device
CN107179920B (en) Network engine starting method and device
TW201629806A (en) Method and device for displaying language message based on digital object identifier (ODI)
CN108874393B (en) Rendering method, rendering device, storage medium and computer equipment
CN106874023B (en) Dynamic page loading method and device
WO2018072388A1 (en) Method for pre-reading webpage, method and device for accessing webpage, and programmable device
JP6975339B2 (en) Backdrop rendering of digital components
WO2015172576A1 (en) Webpage generation method and device
US20120030562A1 (en) Device and method for generating customized webpages
US20210073340A1 (en) Design suggestion techniques for documents to-be-translated
CN110780939B (en) Method, device, computer equipment and storage medium for loading resource file
CN105824830A (en) Page displaying method, client and equipment
US20180143750A1 (en) Methods and apparatuses for configuring message properties in a networked communications system
KR20180019158A (en) METHOD AND DEVICE FOR PREVIEWING A DYNAMIC IMAGE, AND METHOD AND DEVICE FOR DISPLAYING A DISPLAY PACKAGE
CN106155654B (en) Method and device for shielding webpage operation and electronic equipment
US20230297618A1 (en) Information display method and electronic apparatus
CN107391534B (en) Page display method, page file return method, page display device, page file return device and computer storage medium
US20120089899A1 (en) Method and system for redisplaying a web page

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination