CN104199917A - Method and device for translating webpage content and client - Google Patents

Method and device for translating webpage content and client Download PDF

Info

Publication number
CN104199917A
CN104199917A CN201410438229.3A CN201410438229A CN104199917A CN 104199917 A CN104199917 A CN 104199917A CN 201410438229 A CN201410438229 A CN 201410438229A CN 104199917 A CN104199917 A CN 104199917A
Authority
CN
China
Prior art keywords
web page
current web
translation
pages
text message
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
CN201410438229.3A
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.)
Beijing Kingsoft Internet Security Software Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201410438229.3A priority Critical patent/CN104199917A/en
Publication of CN104199917A publication Critical patent/CN104199917A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/957Browsing optimisation, e.g. caching or content distillation
    • 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

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

The embodiment of the invention discloses a method, a device and a client for translating webpage content, wherein the method for translating the webpage content is applied to a browser client and comprises the following steps: the method comprises the steps of obtaining a hovering position of a mouse pointer in a current webpage, obtaining a text node corresponding to the hovering position in the content of the current webpage from a script of the current webpage according to the hovering position of the mouse pointer, obtaining text information corresponding to the text node in the content of the current webpage from the script of the current webpage according to the text node, and providing a translation of the text information, wherein the translation is obtained by translating the text information according to an original language type and a preset target language type of the content of the current webpage. By adopting the embodiment of the invention, the mouse pointer hovering translation can be realized in the current webpage, the operation is convenient and fast, and the translation efficiency is higher.

Description

A kind of interpretation method of Webpage content, device and client
Technical field
The present invention relates to Internet technical field, relate in particular to a kind of interpretation method, device and client of Webpage content.
Background technology
Fast development along with Internet technology, people's work and life more and more rely on means of Internet information platform, and owing to existing in the world, several families are multilingual, and people are when reading non-mother tongue webpage, may run into a language barrier, translation technology brings great convenience to people.
Translation is to use computer realization from a kind of language message, to be transformed into the behavior of another kind of language message, interpretation method for Webpage, obtain all text messages in the current web page page, and according to the homepages language type of the current web page page, all text messages in current web page are translated, to generate corresponding translation, and in the current web page page, show the translation getting.If user need to translate the part text message in the current web page page, need to open in addition translation software or dictionary web sites, complex operation, translation efficiency is lower.
Summary of the invention
Embodiment of the present invention technical matters to be solved is, a kind of interpretation method, device and client of Webpage content is provided, the text message in the current web page page can be translated, and simple operation, translation efficiency is higher.
In order to solve the problems of the technologies described above, the embodiment of the present invention provides a kind of interpretation method of Webpage content, is applied to browser client, comprising:
Obtain the hovering position of mouse pointer in the current web page page;
According to the hovering position of described mouse pointer, from the script of described current web page, obtain in current web page content of pages the text node corresponding to described hovering position;
According to the described text node obtaining, from the script of described current web page, obtain text message corresponding with described text node in described current web page content of pages;
The translation of described text message is provided, and wherein, described translation is translated and is obtained described text message according to the source language type of described current web page content of pages and predetermined target language type.
Correspondingly, the embodiment of the present invention also provides a kind of translating equipment of Webpage content, comprising:
Pointer position acquiring unit, for obtaining the hovering position of current web page page mouse pointer;
Text node acquiring unit for according to the hovering position of described mouse pointer, obtains in current web page content of pages the text node corresponding to described hovering position from the script of described current web page;
Text message acquiring unit for the text node obtaining described in basis, obtains text message corresponding with described text node in described current web page content of pages from the script of described current web page;
Translation provides unit, and for the translation of described text message is provided, wherein, described translation is translated and obtained described text message according to the source language type of described current web page content of pages and predetermined target language type.
Correspondingly, the embodiment of the present invention also provides a kind of browser client, comprises the translating equipment of above-mentioned Webpage content.
Implement the embodiment of the present invention, there is following beneficial effect: browser client is according to the hovering position of mouse pointer in the current web page page, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, the translation of text message is provided, wherein translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type, can in the current web page page, realize mouse pointer hovering translation, do not need to open in addition translation software or dictionary web sites, simple operation, translation efficiency is higher.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below the accompanying drawing of required use during embodiment is described is briefly described, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skills, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, first aspect provides;
Fig. 2 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, second aspect provides;
Fig. 3 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, the third aspect provides;
Fig. 4 is the structural representation of the translating equipment of a kind of Webpage content of providing in the embodiment of the present invention;
Fig. 5 is the structural representation that in the embodiment of the present invention, a kind of translation of Fig. 4 provides unit;
Fig. 6 is the structural representation that in the embodiment of the present invention, the another kind of translation of Fig. 4 provides unit;
Fig. 7 is the structural representation of the language form recognition unit of Fig. 4 in the embodiment of the present invention;
Fig. 8 is the structural representation of the another kind of language form recognition unit of Fig. 4 in the embodiment of the present invention;
Fig. 9 is the structural representation of a kind of browser client of providing in the embodiment of the present invention;
Figure 10 is the effect schematic diagram of a kind of mouse pointer hovering translation that provides in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of interpretation method of Webpage content, device and client, wherein the interpretation method of Webpage content can be applied to browser client, browser client can be according to the hovering position of mouse pointer in the current web page page, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, the translation of text message is provided, wherein translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type, can in the current web page page, realize mouse pointer hovering translation, do not need to open in addition translation software or dictionary web sites, simple operation, translation efficiency is higher.
In the embodiment of the present invention, mentioned browser client may operate in smart mobile phone, panel computer, personal computer (Personal Computer, PC) or in the terminal such as notebook computer, above-mentioned browser client can comprise web browser or electronic magazine client etc.
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, first aspect provides, and the interpretation method of the Webpage content in the embodiment of the present invention can comprise as shown in the figure:
S101, the hovering position that obtains mouse pointer in the current web page page.
Browser client can obtain the hovering position of mouse pointer in the current web page page, and wherein the hovering position of mouse pointer can comprise the coordinate of mouse pointer.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, can identify the source language type of current web page content of pages, wherein the source language type of Webpage content can comprise Chinese, English, Japanese, Korean or German etc., for example in current web page content of pages, half or text message over half are English, and can to identify the source language type of current web page content of pages be English to browser client.
Further alternative, after the source language type of browser client identification current web page content of pages, can to current web page content of pages, translate according to the source language type of identification and predetermined target language type, obtain the translation of current web page content of pages, source language type such as browser client identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, current web page content of pages can be translated into Chinese, if the source language type of browser client identification current web page content of pages is Chinese, predetermined target language type is English, current web page content of pages can be translated into English, and for example, user can arrange the corresponding relation of Webpage content and translation, for example user can submit to target language type to confirm instruction to browser client for current web page content of pages, browser client can be confirmed instruction according to target language type, according to source language type and the target language type of current web page content of pages, current web page content of pages is translated, obtain the translation of current web page content of pages, wherein target language type can be other language forms beyond the source language type of current web page content of pages.The embodiment of the present invention can be translated current web page content of pages in real time, so that user is need to browse the translation of the text message that the text node of mouse pointer hovering position is corresponding time, browser client can directly extract the translation of text message from the translation of current web page content of pages, and translation efficiency is higher.
Further alternative, browser client can obtain the text node of current web page content of pages from the script of current web page, determine between the code area under character corresponding with text node in the script of current web page, statistics belongs to the number of the character between above-mentioned each code area, and be language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages, for example, browser client obtains the text node of current web page content of pages from the script of current web page, browser client can determine that the character A that text node is corresponding belongs between the first code area, character B belongs between the second code area, character C belongs between the first code area etc., browser client can also be added up the number that belongs to the character between each code area, for example browser client is determined and is comprised between the first code area and between the second code area between the code area under character that text node is corresponding, in between the first code area, the number of character is 200, in between the second code area, the number of character is 150, the interval corresponding different language form of different coding wherein, browser client can be language form corresponding between the first code area by the source language type identification of current web page content of pages.
Further alternative, browser client can obtain the lang value of the current web page page from the script of current web page, wherein lang value is used to indicate the source language type of current web page content of pages, browser client can be according to the lang value of the current web page page, the source language type of identification current web page content of pages, if the lang value for example getting is " en ", the source language type that browser client can be identified current web page content of pages is for English; If the lang value getting is " zh-CN ", the source language type that browser client can be identified current web page content of pages is for Chinese.
Preferably, browser client can judge whether to exist the lang value of the current web page page, if there is the lang value of the current web page page, browsing client can be according to the lang value of the current web page page, the source language type of identification current web page content of pages; If there is not the lang value of the current web page page, browser client can obtain the text node of current web page content of pages from the script of current web page, determine between the code area under character corresponding with text node in the script of current web page, statistics belongs to the number of the character between above-mentioned each code area, and is language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, can on the current web page page, show translation prompting message, wherein translate prompting message and can whether carry out mouse-over translation for prompting, if user selects mouse-over translation according to translation prompting message, browser client can receive the mouse-over interpretive order of user's input, and the hovering position that obtains mouse pointer according to mouse-over interpretive order; If user selects full text translation according to translation prompting message, browser client can receive the full text translation instruction of user's input, and obtain current web page content of pages according to full text translation instruction, the translation of current web page content of pages is provided, and wherein the translation of current web page content of pages is translated and is obtained current web page content of pages according to the source language type of current web page content of pages and predetermined target language type.
As a kind of optional embodiment, after browser client obtains the hovering position of mouse pointer in the current web page page, can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the step corresponding to the text node of hovering position; If the lasting duration that the hovering position of mouse pointer remains unchanged is less than Preset Time threshold value, the hovering position of ignoring the mouse pointer getting, for example Preset Time threshold value can be 500ms, browser client can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position.The embodiment of the present invention can be when mouse continuous moving, only obtain and continue the position that duration reaches the mouse pointer of Preset Time threshold value, avoids the translation that provides unnecessary, can promote the performance of Webpage.
S102 according to the hovering position of mouse pointer, obtains in current web page content of pages the text node corresponding to hovering position from the script of current web page.
Browser client gets behind the hovering position of mouse pointer, can be according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position.Concrete, browser client can, according to the coordinate of mouse pointer, obtain the text node with mouse pointer in the current web page page with same coordinate from the script of current web page.
S103 according to the text node obtaining, obtains text message corresponding with text node in current web page content of pages from the script of current web page.
After browser client obtains in current web page content of pages the text node corresponding to hovering position from the script of current web page, can be according to the text node obtaining, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, text information can be a word, one group of phrase, or one section of word etc.Optionally, browser client gets after text message, can in terminal interface, highlight text information, such as marking text information by forms such as highlighted or color of objects.
S104, provides the translation of text message, and wherein, translation is translated and obtained text message according to the source language type of current web page content of pages and predetermined target language type.
Browser client gets after text message, and the translation of text message can be provided, and wherein, translation is translated and obtained text message according to the source language type of current web page content of pages and predetermined target language type.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, the source language type of identification current web page content of pages, browser client can be translated text message according to the source language type of identification and predetermined target language type, obtain the translation of text message, the translation of the described text message of acquisition is provided.If the source language type such as browser client identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, text information translation can be become to Chinese, and this translation is provided, if the source language type of browser client identification current web page content of pages is Chinese, predetermined target language type is English, text information translation can be become to English, and provide this translation, and for example, user can arrange the corresponding relation of text message and translation, for example user can submit to target language type to confirm instruction to browser client for text information, browser client can be confirmed instruction according to target language type, the text message that is the source language type of current web page content of pages by language form is translated into the translation that language form is target language type, and provide this translation, wherein target language type can be other language forms beyond the source language type of current web page content of pages.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, the source language type of identification current web page content of pages, and according to the source language type of identification and predetermined target language type, current web page content of pages is translated, obtain the translation of current web page content of pages, browser client can extract the translation of text message from the translation of current web page content of pages, and the translation of the text message of said extracted is provided.
As a kind of optional embodiment, before browser client provides the translation of text message, can the text message corresponding from the text node obtaining, filter out the text message of user's content visible, and then provide the translation of the text message of the user's content visible filtering out, wherein user's content visible can comprise for being presented at the element on terminal interface, be style in current web page script, other elements beyond the element such as script or iframe, style element is for controlling the style of the current web page page, script element is for controlling the logic of the current web page page, iframe is for controlling the element of the current web page page.In prior art, the region that does not show text message in the Webpage that terminal interface shows, from user's angle, can't see text message, but may there is text message in the mode of hiding in this region in fact, in the embodiment of the present invention, browser client filters out the text message of user's content visible from text message corresponding to the text node that obtains, and then provide the translation of the text message of the user's content visible filtering out, there is the region of text message in the mode that mouse pointer moves to hide, browser client can not obtain the text message in this region, avoid the translation of the text message that mode that browser client provides to hide exists, promote interface processing effect.
As a kind of optional embodiment, in browser client, can be provided with translation expansion, by translation, expand to carry out the method that the embodiment of the present invention provides, so, browser client can normally carry out the functions such as browsing of webpage, by translation expansion, carries out the translation of web page contents, translation can not take the resource of browser client, the translation of web page contents can either be provided, not affect again the normal performance of browser client, effectively promote user and experience.
Concrete, browser client can move translation expansion, so that the hovering position that obtains mouse pointer in the current web page page is carried out in translation expansion, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, according to the text node obtaining, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, the step of the translation of text message is provided, browser client can also receive the translation that the text message providing is provided in translation, on the current web page page, on the precalculated position corresponding with text message, suspend and show the translation of text message.Wherein translation expansion can comprise plug-in unit etc., such as Kingsoft Powerword, Kingsoft FastAIT etc., the embodiment of the present invention is expanded the hovering position that obtains mouse pointer in the current web page page by translation, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, the translation of the text message that text node is corresponding is provided, browser client only need receive the translation that translation expansion provides, and show this translation, for example suspend and show this translation, can promote the performance of Webpage.
As a kind of optional embodiment, browser client can be sent to server by source language type and the text message of current web page content of pages, so that server is according to the source language type of current web page content of pages, text message is translated, and reception server is according to the translation of the translation result generation of text message.If the source language type such as browser client identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, server can, according to the source language type of current web page content of pages and predetermined target language type, become Chinese by text information translation, if the homepages language type of the browser client identification current web page page is Chinese, server can be according to the homepages language type of the current web page page and predetermined target language type, text information translation is become to English, and for example, user can arrange the corresponding relation of text message and translation, for example user can submit to target language type to confirm instruction to browser client for text information, browser client can confirm that instruction obtains target language type according to target language type, by the source language type of current web page content of pages, target language type and text message are sent to server, so that the text message that server is the source language type of current web page content of pages by language form is translated into the translation that language form is target language type, wherein target language type can be other language forms beyond the source language type of current web page content of pages.
As a kind of optional embodiment, browser client suspends on can precalculated position corresponding with text message on the current web page page and shows this translation, the effect schematic diagram that the mouse pointer hovering shown in Figure 10 of take is translated is example, the text message that browser client gets is " 26 Ways to Trim Your Household Costs, Room by Room ", browser client suspends on can precalculated position corresponding with text message on the current web page page and shows this translation, for example " 26 methods are cut down your Family cost, room is to another room ", so that the quick viewing textual information of user and translation.
In the interpretation method of the Webpage content shown in Fig. 1, browser client is according to the hovering position of mouse pointer in the current web page page, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, the translation of text message is provided, wherein translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type, can in the current web page page, realize mouse pointer hovering translation, do not need to open in addition translation software or dictionary web sites, simple operation, translation efficiency is higher.
Refer to Fig. 2, Fig. 2 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, second aspect provides, and the interpretation method of the Webpage content in the embodiment of the present invention can comprise as shown in the figure:
S201 obtains the text node of current web page content of pages from the script of current web page.
Browser client can obtain the text node of current web page content of pages from the script of current web page.
In optional embodiment, before browser client obtains the text node of current web page content of pages from the script of current web page, can judge the lang value that whether has the current web page page in the script of current web page, if there is the lang value of the current web page page, browser client can be according to the lang value of the current web page page, the source language type of identification current web page content of pages; If there is not the lang value of the current web page page, browser client can obtain the text node of current web page content of pages.Wherein lang value is used to indicate the source language type of current web page content of pages, browser client can be according to the lang value of the current web page page, the source language type of identification current web page content of pages, if the lang value for example getting is " en ", the source language type that browser client can be identified current web page content of pages is for English; If the lang value getting is " zh-CN ", the source language type that browser client can be identified current web page content of pages is for Chinese.
S202, determines between the code area under character corresponding with text node in the script of current web page.
After browser client gets the text node of current web page content of pages, can be according to the text node obtaining, determine between the code area under character corresponding with text node in the script of current web page, the interval corresponding different language form of different coding wherein, for example browser client can determine that the character A that text node is corresponding belongs between the first code area, character B belongs between the second code area, and character C belongs between the first code area etc.
S203, statistics belongs to the number of the character between each code area.
After browser client is determined between the code area under character corresponding with text node in the script of current web page, can add up the number that belongs to the character between each code area, for example browser client is determined and is comprised between the first code area and between the second code area between the code area under character corresponding with text node in the script of current web page, browser client can be added up respectively the number that belongs to the character between the first code area and between the second code area, the number that wherein belongs to the character between the first code area is 200, the number that belongs to the character between the second code area is 150.
S204 is language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages.
Browser client can be language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages, for example to belong to the number of the character between the first code area be 200 for browser client statistics, the number that belongs to the character between the second code area is 150, and browser client can be language form corresponding between the first code area by the source language type identification of current web page content of pages.
As a kind of optional embodiment, after the source language type of browser client identification current web page content of pages, can to current web page content of pages, translate according to the source language type of identification and predetermined target language type, obtain the translation of current web page content of pages, source language type such as browser client identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, current web page content of pages can be translated into Chinese, if the source language type of browser client identification current web page content of pages is Chinese, predetermined target language type is English, current web page content of pages can be translated into English, and for example, user can arrange the corresponding relation of Webpage content and translation, for example user can submit to target language type to confirm instruction to browser client for current web page content of pages, browser client can be confirmed instruction according to target language type, according to source language type and the target language type of current web page content of pages, current web page content of pages is translated, obtain the translation of current web page content of pages, wherein target language type can be other language forms beyond the source language type of current web page content of pages.The embodiment of the present invention can be translated current web page content of pages in real time, so that user is need to browse the translation of the text message that the text node of mouse pointer hovering position is corresponding time, browser client can directly extract the translation of text message from the translation of current web page content of pages, and translation efficiency is higher.
S205, the hovering position that obtains mouse pointer in the current web page page.
Browser client can obtain the hovering position of mouse pointer in the current web page page.Concrete, after the source language type of browser client identification current web page content of pages, can on the current web page page, show translation prompting message, wherein translate prompting message and whether carry out mouse-over translation for prompting, if user selects mouse-over translation according to translation prompting message, browser client can receive the mouse-over interpretive order of user's input, and the hovering position that obtains mouse pointer according to mouse-over interpretive order; If user selects full text translation according to translation prompting message, browser client can receive the full text translation instruction of user's input, and obtain current web page content of pages according to full text translation instruction, according to the source language type of current web page content of pages and predetermined target language type, current web page content of pages is translated, and the translation of current web page content of pages is provided.
As a kind of optional embodiment, if after the source language type of browser client identification current web page content of pages, according to the source language type of identification and predetermined target language type, current web page content of pages is translated, obtain the translation of current web page content of pages, after browser client receives the full text translation instruction of user's input, can be according to the translation of full text translation instruction fetch current web page content of pages, and the translation of extraction is provided.
As a kind of optional embodiment, after browser client obtains the hovering position of mouse pointer in the current web page page, can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the step corresponding to the text node of hovering position; If the lasting duration that the hovering position of mouse pointer remains unchanged is less than Preset Time threshold value, the hovering position of ignoring the mouse pointer getting, for example Preset Time threshold value can be 500ms, browser client can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position.The embodiment of the present invention can be when mouse continuous moving, only obtain and continue the position that duration reaches the mouse pointer of Preset Time threshold value, avoids the translation that provides unnecessary, can promote the performance of Webpage.
S206 according to the hovering position of mouse pointer, obtains in current web page content of pages the text node corresponding to hovering position from the script of current web page.
Browser client gets behind the hovering position of mouse pointer, can be according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position.Concrete, browser client can, according to the coordinate of mouse pointer, obtain the text node with mouse pointer in the current web page page with same coordinate from the script of current web page.
S207 according to the text node obtaining, obtains text message corresponding with text node in current web page content of pages from the script of current web page.
After browser client obtains in current web page content of pages the text node corresponding to hovering position from the script of current web page, can be according to the text node obtaining, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, text information can be a word, one group of phrase, or one section of word etc.Optionally, browser client gets after text message, can in terminal interface, highlight text information, such as marking text information by forms such as highlighted or color of objects.
S208, provides the translation of text message, and wherein, translation is translated and obtained text message according to the source language type of current web page content of pages and predetermined target language type.
Browser client gets after text message, and the translation of text message can be provided, and wherein, translation is translated and obtained text message according to the source language type of current web page content of pages and predetermined target language type.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, the source language type of identification current web page content of pages, browser client can be translated text message according to the source language type of identification and predetermined target language type, obtain the translation of text message, the translation of the described text message of acquisition is provided.If the source language type such as browser client identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, text information translation can be become to Chinese, and this translation is provided, if the source language type of browser client identification current web page content of pages is Chinese, predetermined target language type is English, text information translation can be become to English, and provide this translation, and for example, user can arrange the corresponding relation of text message and translation, for example user can submit to target language type to confirm instruction to browser client for text information, browser client can be confirmed instruction according to target language type, the text message that is the source language type of current web page content of pages by language form is translated into the translation that language form is target language type, and provide this translation, wherein target language type can be other language forms beyond the source language type of current web page content of pages.
As a kind of optional embodiment, before browser client obtains the hovering position of mouse pointer in the current web page page, the source language type of identification current web page content of pages, and according to the source language type of identification and predetermined target language type, current web page content of pages is translated, obtain the translation of current web page content of pages, browser client can extract the translation of text message from the translation of current web page content of pages, and the translation of the text message of said extracted is provided.
As a kind of optional embodiment, before browser client provides the translation of text message, can the text message corresponding from the text node obtaining, filter out the text message of user's content visible, and then provide the translation of the text message of the user's content visible filtering out, wherein user's content visible can comprise for being presented at the element on terminal interface, be style in current web page script, other elements beyond the element such as script or iframe, style element is for controlling the style of the current web page page, script element is for controlling the logic of the current web page page, iframe is for controlling the element of the current web page page.In prior art, the region that does not show text message in the Webpage that terminal interface shows, from user's angle, can't see text message, but may there is text message in the mode of hiding in this region in fact, in the embodiment of the present invention, browser client filters out the text message of user's content visible from text message corresponding to the text node that obtains, and then provide the translation of the text message of the user's content visible filtering out, there is the region of text message in the mode that mouse pointer moves to hide, browser client can not obtain the text message in this region, avoid the translation of the text message that mode that browser client provides to hide exists, promote interface processing effect.
As a kind of optional embodiment, browser client suspends on can precalculated position corresponding with text message on the current web page page and shows this translation, the effect schematic diagram that the mouse pointer hovering shown in Figure 10 of take is translated is example, the text message that browser client gets is " 26 Ways to Trim Your Household Costs, Room by Room ", browser client suspends on can precalculated position corresponding with text message on the current web page page and shows this translation, for example " 26 methods are cut down your Family cost, room is to another room ", so that the quick viewing textual information of user and translation.
In the interpretation method of the Webpage content shown in Fig. 2, browser client obtains the text node of current web page content of pages from the script of current web page, determine between the code area under character corresponding with text node in the script of current web page, statistics belongs to the number of the character between each code area, and be language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages, according to the hovering position of mouse pointer in the current web page page, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, the translation of text message is provided, wherein translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type, can in the current web page page, realize mouse pointer hovering translation, simple operation, translation efficiency is higher.
Refer to Fig. 3, Fig. 3 is the schematic flow sheet of the interpretation method of a kind of Webpage content that in the embodiment of the present invention, the third aspect provides, in the present embodiment, translation expansion is installed in browser client, the interpretation method of the Webpage content in the embodiment of the present invention can comprise as shown in the figure:
S301, the source language type of translation expansion identification current web page content of pages.
Translation expansion can be identified the source language type of current web page content of pages, wherein translation expansion can comprise plug-in unit etc., the source language type of Webpage content can comprise Chinese, English, Japanese, Korean or German etc., for example in current web page content of pages, half or text message over half are English, and can to identify the source language type of current web page content of pages be English in translation expansion.Concrete, translation expansion can be obtained the text node of current web page content of pages from the script of current web page, determine between the code area under character corresponding with text node in the script of current web page, statistics belongs to the number of the character between each code area, and be language form corresponding between the code area that character number is maximum by the source language type identification of current web page content of pages, optionally, translation expansion also can be obtained the lang value of the current web page page, wherein Lang value is used to indicate the source language type of current web page content of pages, translation expansion can be according to the lang value of the current web page page, the source language type of identification current web page content of pages.
Further alternative, after the source language type of translation expansion identification current web page content of pages, can to current web page content of pages, translate according to the source language type of identification and predetermined target language type, obtain the translation of current web page content of pages, source language type such as translation expansion identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, current web page content of pages can be translated into Chinese, if the source language type of translation expansion identification current web page content of pages is Chinese, predetermined target language type is English, current web page content of pages can be translated into English, and for example, user can arrange the corresponding relation of Webpage content and translation, for example user can submit to target language type to confirm instruction to translation expansion for current web page content of pages, translation expansion can be confirmed instruction according to target language type, according to source language type and the target language type of current web page content of pages, current web page content of pages is translated, obtain the translation of current web page content of pages, wherein target language type can be other language forms beyond the source language type of current web page content of pages.The embodiment of the present invention can be translated current web page content of pages in real time, so that user is need to browse the translation of the text message that the text node of mouse pointer hovering position is corresponding time, translation expansion can directly be extracted the translation of text message from the translation of current web page content of pages, and translation efficiency is higher.
S302, translation expansion shows translation prompting message on the current web page page.
Before the hovering position of mouse pointer in the current web page page is obtained in translation expansion, can on the current web page page, show translation prompting message, wherein translate prompting message and whether carry out mouse-over translation for prompting.
S303, translation expansion receives user according to the mouse-over interpretive order of translation prompting message input.
Translation expansion can receive user according to the mouse-over interpretive order of translation prompting message input.Concrete, if user selects mouse-over translation according to translation prompting message, translation expansion can receive the mouse-over interpretive order of user's input, and the hovering position that obtains mouse pointer according to mouse-over interpretive order; If user selects full text translation according to translation prompting message, translation expansion can receive the full text translation instruction of user's input, and obtain current web page content of pages according to full text translation instruction, the translation of current web page content of pages is provided, and wherein the translation of current web page content of pages is translated and is obtained current web page content of pages according to the source language type of current web page content of pages and predetermined target language type.
As a kind of optional embodiment, if after the source language type of translation expansion identification current web page content of pages, according to the source language type of identification and predetermined target language type, current web page content of pages is translated, obtain the translation of current web page content of pages, after translation expansion receives the full text translation instruction of user's input, can be according to the translation of full text translation instruction fetch current web page content of pages, and the translation of extraction is provided.
S304, translation expansion, according to mouse-over interpretive order, is obtained the hovering position of mouse pointer.
Translation expansion can be obtained the hovering position of mouse pointer according to mouse-over interpretive order, and wherein the hovering position of mouse pointer can comprise the coordinate of mouse pointer.
S305, the lasting duration that the hovering position of translation expansion judgement mouse pointer remains unchanged reaches Preset Time threshold value.
Translation expansion gets behind the hovering position of mouse pointer, can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches Preset Time threshold value, further perform step S306; If the lasting duration that the hovering position of mouse pointer remains unchanged is less than Preset Time threshold value, the hovering position of ignoring the mouse pointer getting, for example Preset Time threshold value can be 500ms, translation expansion can judge whether the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, if the lasting duration that the hovering position of mouse pointer remains unchanged reaches 500ms, according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position.The embodiment of the present invention can only be obtained and continue the position that duration reaches the mouse pointer of Preset Time threshold value when mouse continuous moving, avoids generating unnecessary translation, can promote the performance of Webpage.
S306, translation expansion is according to the hovering position of mouse pointer, obtains in current web page content of pages the text node corresponding to hovering position from the script of current web page.
When the lasting duration that the hovering position of translation expansion judgement mouse pointer remains unchanged reaches Preset Time threshold value, can be according to the hovering position of mouse pointer, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, concrete, translation expansion can, according to the coordinate of mouse pointer, be searched the text node with mouse pointer with same coordinate in the current web page page.
S307, translation expansion, according to the text node obtaining, is obtained text message corresponding with text node in current web page content of pages from the script of current web page.
Translation expansion is obtained in current web page content of pages after the text node corresponding to hovering position from the script of current web page, can be according to the text node obtaining, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, text information can be a word, one group of phrase, or one section of word etc.Optionally, translation expansion gets after text message, can in terminal interface, highlight text information, such as marking text information by forms such as highlighted or color of objects.
S308, translation expansion provides the translation of text message, and wherein, translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type.
Translation expansion gets after text message, and the translation of text message can be provided, and wherein, translation is translated and obtained text message according to the source language type of current web page content of pages and predetermined target language type.
As a kind of optional embodiment, before the hovering position of mouse pointer in the current web page page is obtained in translation expansion, the source language type of identification current web page content of pages, translation expansion can be translated text message according to the source language type of identification and predetermined target language type, obtain the translation of text message, the translation of the described text message of acquisition is provided.If the source language type such as translation expansion identification current web page content of pages is the non-Chinese language such as English, Japanese or Korean, predetermined target language type is Chinese, text information translation can be become to Chinese, and this translation is provided, if the source language type of translation expansion identification current web page content of pages is Chinese, predetermined target language type is English, text information translation can be become to English, and provide this translation, and for example, user can arrange the corresponding relation of text message and translation, for example user can submit to target language type to confirm instruction to browser client for text information, translation expansion can be confirmed instruction according to target language type, the text message that is the source language type of current web page content of pages by language form is translated into the translation that language form is target language type, and provide this translation, wherein target language type can be other language forms beyond the source language type of current web page content of pages.
As a kind of optional embodiment, before the hovering position of mouse pointer in the current web page page is obtained in translation expansion, the source language type of identification current web page content of pages, and according to the source language type of identification and predetermined target language type, current web page content of pages is translated, obtain the translation of current web page content of pages, translation expansion can be extracted the translation of text message from the translation of current web page content of pages, and the translation of the text message of said extracted is provided.
As a kind of optional embodiment, before translation expansion provides the translation of text message, can the text message corresponding from the text node obtaining, filter out the text message of user's content visible, and then provide the translation of the text message of the user's content visible filtering out, wherein user's content visible can comprise for being presented at the element on terminal interface, be style in current web page script, other elements beyond the element such as script or iframe, style element is for controlling the style of the current web page page, script element is for controlling the logic of the current web page page, iframe is for controlling the element of the current web page page.In prior art, the region that does not show text message in the Webpage that terminal interface shows, from user's angle, can't see text message, but may there is text message in the mode of hiding in this region in fact, in the embodiment of the present invention, translation expansion filters out the text message of user's content visible from text message corresponding to the text node that obtains, and then provide the translation of the text message of the user's content visible filtering out, there is the region of text message in the mode that mouse pointer moves to hide, translation expansion can not obtained the text message in this region, the translation of the text message that the mode of avoiding translation expansion to provide to hide exists, promote interface processing effect.
S309, the translation providing is provided to browser client in translation expansion.
After translation expansion provides the translation of text message, can send the translation providing to browser client.
S310, browser client suspends on the precalculated position corresponding with text message and shows the translation of text message on the current web page page.
Browser client suspends on can precalculated position corresponding with text message on the current web page page and shows the translation of text message, the effect schematic diagram that the mouse pointer hovering shown in Figure 10 of take is translated is example, the text message that browser client gets is " 26 Ways to Trim Your Household Costs, Room by Room ", browser client suspends on can precalculated position corresponding with text message on the current web page page and shows this translation, for example " 26 methods are cut down your Family cost, room is to another room ", so that the quick viewing textual information of user and translation.
In the interpretation method of the Webpage content shown in Fig. 3, translation expansion is according to the mouse-over interpretive order of user's input, obtain the hovering position of mouse pointer, when the lasting duration that the hovering position of judgement mouse pointer remains unchanged reaches Preset Time threshold value, from the script of current web page, obtain in current web page content of pages the text node corresponding to hovering position, from the script of current web page, obtain text message corresponding with text node in current web page content of pages, translation expansion provides the translation of text message, the translation providing is provided to browser client, browser client suspends on can precalculated position corresponding with text message on the current web page page and shows the translation of text message, the embodiment of the present invention can realize mouse pointer hovering translation in the current web page page, simple operation, translation efficiency is higher.
Refer to Fig. 4, Fig. 4 is the structural representation of the translating equipment of a kind of Webpage content of providing in the embodiment of the present invention, the translating equipment 400 of the Webpage content in the embodiment of the present invention can be applied to browser client as shown in the figure, the translating equipment 400 of Webpage content at least can comprise that pointer position acquiring unit 401, text node acquiring unit 402, text message acquiring unit 403 and translation provide unit 404, wherein:
Pointer position acquiring unit 401, for obtaining the hovering position of described current web page page mouse pointer.
Text node acquiring unit 402 for according to the hovering position of described mouse pointer, obtains in current web page content of pages the text node corresponding to described hovering position from the script of described current web page.Concrete, text node acquiring unit 402 can, according to the coordinate of mouse pointer, be searched the text node with mouse pointer with same coordinate in current web page content of pages.
Text message acquiring unit 403, text node for obtaining described in basis obtains text message corresponding with described text node in described current web page content of pages from the script of described current web page, and text information can be a word, one group of phrase, or one section of word etc.Optionally, text message acquiring unit 403 gets after text message, can in terminal interface, highlight text information, such as marking text information by forms such as highlighted or color of objects.
Translation provides unit 404, and for the translation of described text message is provided, wherein, described translation is translated and obtained described text message according to the source language type of described current web page content of pages and predetermined target language type.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Language form recognition unit 405, for identifying the source language type of described current web page content of pages, wherein the source language type of Webpage content can comprise Chinese, English, Japanese, Korean or German etc.
The translation in the embodiment of the present invention provides unit 404 as shown in Figure 5, further to comprise:
Translation module 501, for according to the source language type of described identification and described predetermined target language type, described text message being translated, obtains the translation of described text message.
The first translation provides module 502, for the translation of the described text message of described acquisition is provided.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Language form recognition unit 405, for identifying the source language type of described current web page content of pages.
Translation unit 406, for according to the source language type of described identification and described predetermined target language type, described current web page content of pages being translated, obtains the translation of described current web page content of pages.
The translation in the embodiment of the present invention provides unit 404 as shown in Figure 6, further to comprise:
Translation extraction module 601, extracts the translation of described text message for the translation from described current web page content of pages.
The second translation provides module 602, for the translation of the described text message of described extraction is provided.
As a kind of optional embodiment, the language form recognition unit 405 in the embodiment of the present invention can as shown in Figure 7, further comprise:
Text node acquisition module 701, obtains the text node of described current web page content of pages for the script from described current web page.
Between code area, determination module 702, for between the code area under the script of the definite current web page character corresponding with text node, for example between code area, determination module 702 determines that character A corresponding to text node belongs between the first code area, character B belongs between the second code area, and character C belongs between the first code area etc.
Character number statistical module 703, for adding up the number that belongs to the character between described each code area, if comprise between the first code area and between the second code area between the code area under the character that between code area, the definite text node of determination module 702 is corresponding, character number statistical module 703 can be added up respectively the number that belongs to the character between the first code area and between the second code area, the number that for example belongs to the character between the first code area is 200, and the number that belongs to the character between the second code area is 150.
The first identification module 704, for being language form corresponding between the code area that character number is maximum by the source language type identification of described current web page content of pages, for example the first identification module 704 can be language form corresponding between the first code area by the source language type identification of current web page content of pages.
As a kind of optional embodiment, the language form recognition unit 405 in the embodiment of the present invention can as shown in Figure 8, further comprise:
Acquisition module 801, obtains the lang value of the described current web page page for the script from described current web page, wherein Lang value is used to indicate the source language type of current web page content of pages.
The second identification module 802, for according to the lang value of the described current web page page, identifies the source language type of described current web page content of pages.If the lang value that for example acquisition module 801 gets is " en ", the homepages language type that the second identification module 802 can be identified the current web page page is for English; If the lang value that acquisition module 801 gets is " zh-CN ", the homepages language type that the second identification module 802 can be identified the current web page page is for Chinese.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Text message filter element 407, for filtering out the text message of user's content visible from described text message corresponding to described text node obtaining.
Further, translation provides unit 404, for the translation of the text message of user's content visible of filtering out described in providing.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Prompting message display unit 408, for show translation prompting message on the described current web page page, whether described translation prompting message carries out mouse-over translation for prompting.
Further, pointer position acquiring unit 401, if for receiving user according to the mouse-over interpretive order of described translation prompting message input, according to described mouse-over interpretive order, obtain the hovering position of mouse pointer described in the described current web page page.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Judging unit 409, for judging whether the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value, if the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value, trigger text node acquiring unit 402 according to the hovering position of described mouse pointer, from the script of described current web page, obtain in described current web page content of pages the text node corresponding to described hovering position.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention is set to be arranged on the translation expansion in described browser client 900, and described translation expansion comprises that described pointer position acquiring unit 401, described text node acquiring unit 402, described text message acquiring unit 403, described translation provide unit 404;
The described translation expansion of described browser client 900 operation, thereby by described pointer position acquiring unit 401, obtain the hovering position of mouse pointer in the current web page page, by described text node acquiring unit 402 according to the hovering position of described mouse pointer, from the script of described current web page, obtain in current web page content of pages the text node corresponding to described hovering position, by the text node obtaining described in described text message acquiring unit 403 bases, from the script of described current web page, obtain text message corresponding with described text node in described current web page content of pages, by described translation, provide unit 404 that the translation of described text message is provided.
Described browser client 900 can as shown in Figure 9, comprise:
Translation receiving element 901, provides the translation of the described text message that unit 404 provides for receiving described translation.
Display unit 902, for showing the translation of described text message on precalculated position corresponding with described text message on the described current web page page.
As a kind of optional embodiment, the translating equipment 400 of the Webpage content in the embodiment of the present invention can also comprise:
Display unit 410 after providing the translation that unit 404 provides text message, suspends and shows the translation of described text message on the precalculated position corresponding with described text message for translation on the described current web page page.
In the translating equipment of the Webpage content shown in Fig. 4, text node acquiring unit 402 obtains the text node of the hovering position of the mouse pointer getting corresponding to pointer position acquiring unit 401 in current web page content of pages from the script of current web page, text message acquiring unit 403 obtains text message corresponding with text node in current web page content of pages from the script of current web page, translation provides unit 404 that the translation of text message is provided, wherein translation is translated and is obtained text message according to the source language type of current web page content of pages and predetermined target language type, can in the current web page page, realize mouse pointer hovering translation, simple operation, translation efficiency is higher.
The embodiment of the present invention also provides a kind of browser client, the translating equipment that can comprise the Webpage content shown in Fig. 4~Fig. 8, wherein, this browser client can comprise web browser or electronic magazine client etc., and this browser client may operate in the terminals such as smart mobile phone, panel computer, personal computer or notebook computer.
In the description of this instructions, the description of reference term " embodiment ", " some embodiment ", " example ", " concrete example " or " some examples " etc. means to be contained at least one embodiment of the present invention or example in conjunction with specific features, structure, material or the feature of this embodiment or example description.In this manual, to the schematic statement of above-mentioned term, not must be for identical embodiment or example.And, the specific features of description, structure, material or feature can one or more embodiment in office or example in suitable mode combination.In addition,, not conflicting in the situation that, those skilled in the art can carry out combination and combination by the feature of the different embodiment that describe in this instructions or example and different embodiment or example.
In addition, term " first ", " second " be only for describing object, and can not be interpreted as indication or hint relative importance or the implicit quantity that indicates indicated technical characterictic.Thus, at least one this feature can be expressed or impliedly be comprised to the feature that is limited with " first ", " second ".In description of the invention, the implication of " a plurality of " is at least two, for example two, and three etc., unless otherwise expressly limited specifically.
In process flow diagram or any process of otherwise describing at this or method describe and can be understood to, represent to comprise one or more for realizing module, fragment or the part of code of executable instruction of the step of specific logical function or process, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can be not according to order shown or that discuss, comprise according to related function by the mode of basic while or by contrary order, carry out function, this should be understood by embodiments of the invention person of ordinary skill in the field.
The logic and/or the step that in process flow diagram, represent or otherwise describe at this, for example, can be considered to for realizing the program listing of the executable instruction of logic function, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise that the system of processor or other can and carry out the system of instruction from instruction execution system, device or equipment instruction fetch), use, or use in conjunction with these instruction execution systems, device or equipment.With regard to this instructions, " computer-readable medium " can be anyly can comprise, storage, communication, propagation or transmission procedure be for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically of computer-readable medium (non-exhaustive list) comprises following: the electrical connection section (electronic installation) with one or more wirings, portable computer diskette box (magnetic device), random access memory (RAM), ROM (read-only memory) (ROM), the erasable ROM (read-only memory) (EPROM or flash memory) of editing, fiber device, and portable optic disk ROM (read-only memory) (CDROM).In addition, computer-readable medium can be even paper or other the suitable medium that can print described program thereon, because can be for example by paper or other media be carried out to optical scanning, then edit, decipher or process in electronics mode and obtain described program with other suitable methods if desired, be then stored in computer memory.
Should be appreciated that each several part of the present invention can realize with hardware, software, firmware or their combination.In the above-described embodiment, a plurality of steps or method can realize with being stored in storer and by software or the firmware of suitable instruction execution system execution.For example, if realized with hardware, the same in another embodiment, can realize by any one in following technology well known in the art or their combination: have for data-signal being realized to the discrete logic of the logic gates of logic function, the special IC with suitable combinational logic gate circuit, programmable gate array (PGA), field programmable gate array (FPGA) etc.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is to come the hardware that instruction is relevant to complete by program, described program can be stored in a kind of computer-readable recording medium, this program, when carrying out, comprises step of embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, can be also that the independent physics of unit exists, and also can be integrated in a module two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and also can adopt the form of software function module to realize.If described integrated module usings that the form of software function module realizes and during as production marketing independently or use, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.Although illustrated and described embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, modification, replacement and modification.

Claims (19)

1. an interpretation method for Webpage content, is characterized in that, is applied to browser client, and described method comprises:
Obtain the hovering position of mouse pointer in the current web page page;
According to the hovering position of described mouse pointer, from the script of described current web page, obtain in current web page content of pages the text node corresponding to described hovering position;
According to the described text node obtaining, from the script of described current web page, obtain text message corresponding with described text node in described current web page content of pages;
The translation of described text message is provided, and wherein, described translation is translated and is obtained described text message according to the source language type of described current web page content of pages and predetermined target language type.
2. the method for claim 1, is characterized in that, described in obtain before the hovering position of mouse pointer in the current web page page, described method also comprises:
Identify the source language type of described current web page content of pages;
The described translation of described text message that provides comprises:
According to the source language type of described identification and described predetermined target language type, described text message is translated, obtained the translation of described text message;
The translation of the described text message of described acquisition is provided.
3. the method for claim 1, is characterized in that, described obtain the described current web page page in before the hovering position of mouse pointer, described method also comprises:
Identify the source language type of described current web page content of pages;
According to the source language type of described identification and described predetermined target language type, described current web page content of pages is translated, obtained the translation of described current web page content of pages;
The described translation of described text message that provides comprises:
From the translation of described current web page content of pages, extract the translation of described text message;
The translation of the described text message of described extraction is provided.
4. method as claimed in claim 2 or claim 3, is characterized in that, the source language type of the described current web page content of pages of described identification comprises:
From the script of described current web page, obtain the text node of described current web page content of pages;
Determine between the code area under character corresponding with described text node in the script of described current web page;
Statistics belongs to the number of the character between code area described in each;
By the source language type identification of described current web page content of pages, be language form corresponding between the code area that character number is maximum;
Or
From the script of described current web page, obtain the lang value of the described current web page page;
According to the lang value of the described current web page page, identify the source language type of described current web page content of pages.
5. the method for claim 1, it is characterized in that, the text node obtaining described in described basis, from the script of described current web page, obtain after text message corresponding with described text node in described current web page content of pages, before the described translation that described text message is provided, described method also comprises:
From text message corresponding to the described described text node obtaining, filter out the text message of user's content visible;
The described translation of described text message that provides comprises:
The translation of the text message of the user's content visible filtering out described in providing.
6. the method for claim 1, is characterized in that, described in obtain before the hovering position of mouse pointer in the described current web page page, described method also comprises:
On the described current web page page, show translation prompting message, whether described translation prompting message carries out mouse-over translation for prompting;
The described hovering position that obtains mouse pointer in the described current web page page comprises:
If receive user according to the mouse-over interpretive order of described translation prompting message input, according to described mouse-over interpretive order, obtain the hovering position of mouse pointer described in the described current web page page.
7. the method for claim 1, it is characterized in that, behind the described hovering position that obtains mouse pointer in the described current web page page, described obtaining from the script of described current web page in described current web page content of pages before the text node corresponding to described hovering position, described method also comprises:
Judge whether the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value;
If the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value, trigger describedly according to the hovering position of described mouse pointer, from the script of described current web page, obtain in described current web page content of pages the step corresponding to the text node of described hovering position.
8. the method for claim 1, is characterized in that, is provided with translation expansion in described browser client, and described method also comprises:
Move described translation expansion, so that the hovering position that obtains mouse pointer in the described current web page page described in described translation expansion execution, according to the hovering position of described mouse pointer, from the script of described current web page, obtain in described current web page content of pages the text node corresponding to described hovering position, according to the described text node obtaining, from the script of described current web page, obtain text message corresponding with described text node in described current web page content of pages, the step of the translation of described text message is provided;
Receive the translation of the described text message that described translation expansion provides, on the described current web page page, on the precalculated position corresponding with described text message, show the translation of described text message.
9. the method as described in claim 1-7 any one, is characterized in that, described in the translation of described text message is provided after, described method also comprises:
On the described current web page page, on the precalculated position corresponding with described text message, suspend and show the translation of described text message.
10. a translating equipment for Webpage content, is characterized in that, is applied to browser client, comprising:
Pointer position acquiring unit, for obtaining the hovering position of current web page page mouse pointer;
Text node acquiring unit for according to the hovering position of described mouse pointer, obtains in current web page content of pages the text node corresponding to described hovering position from the script of described current web page;
Text message acquiring unit for the text node obtaining described in basis, obtains text message corresponding with described text node in described current web page content of pages from the script of described current web page;
Translation provides unit, and for the translation of described text message is provided, wherein, described translation is translated and obtained described text message according to the source language type of described current web page content of pages and predetermined target language type.
11. devices as claimed in claim 10, is characterized in that, described device also comprises:
Language form recognition unit, for identifying the source language type of described current web page content of pages;
Described translation provides unit to comprise:
Translation module, for according to the source language type of described identification and described predetermined target language type, described text message being translated, obtains the translation of described text message;
The first translation provides module, for the translation of the described text message of described acquisition is provided.
12. devices as claimed in claim 10, is characterized in that, described device also comprises:
Language form recognition unit, for identifying the source language type of described current web page content of pages;
Translation unit, for according to the source language type of described identification and described predetermined target language type, described current web page content of pages being translated, obtains the translation of described current web page content of pages;
Described translation provides unit to comprise:
Translation extraction module, extracts the translation of described text message for the translation from described current web page content of pages;
The second translation provides module, for the translation of the described text message of described extraction is provided.
13. devices as described in claim 11 or 12, is characterized in that, described language form recognition unit comprises:
Text node acquisition module, obtains the text node of described current web page content of pages for the script from described current web page;
Determination module between code area, between the code area under the script of the definite described current web page character corresponding with described text node;
Character number statistical module, for adding up the number that belongs to the character between code area described in each;
The first identification module, for by the source language type identification of described current web page content of pages being language form corresponding between the code area that character number is maximum;
Or
Described language form recognition unit comprises:
Acquisition module, obtains the lang value of the described current web page page for the script from described current web page;
The second identification module, for according to the lang value of the described current web page page, identifies the homepages language type of the described current web page page.
14. devices as claimed in claim 10, is characterized in that, described device also comprises:
Text message filter element, for filtering out the text message of user's content visible from described text message corresponding to described text node obtaining;
Described translation provides unit, for the translation of the text message of user's content visible of filtering out described in providing.
15. devices as claimed in claim 10, is characterized in that, described device also comprises:
Prompting message display unit, for show translation prompting message on the described current web page page, whether described translation prompting message carries out mouse-over translation for prompting;
Described pointer position acquiring unit, if for receiving user according to the mouse-over interpretive order of described translation prompting message input, according to described mouse-over interpretive order, obtain the hovering position of mouse pointer described in the described current web page page.
16. devices as claimed in claim 10, is characterized in that, described device also comprises:
Judging unit, for judging whether the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value, if the lasting duration that the hovering position of described mouse pointer remains unchanged reaches Preset Time threshold value, trigger described text node acquiring unit according to the hovering position of described mouse pointer, from the script of described current web page, obtain in described current web page content of pages the text node corresponding to described hovering position.
17. devices as claimed in claim 10, it is characterized in that, described device is set to be arranged on the translation expansion in described browser client, and described translation expansion comprises that described pointer position acquiring unit, described text node acquiring unit, described text message acquiring unit, described translation provide unit;
Described browser client moves described translation expansion, thereby by described pointer position acquiring unit, obtain the hovering position of mouse pointer in the current web page page, by described text node acquiring unit according to the hovering position of described mouse pointer, from the script of described current web page, obtain in current web page content of pages the text node corresponding to described hovering position, by the text node obtaining described in described text message acquiring unit basis, from the script of described current web page, obtain text message corresponding with described text node in described current web page content of pages, by described translation, provide unit that the translation of described text message is provided,
Described browser client comprises:
Translation receiving element, provides the translation of the described text message that unit provides for receiving described translation;
Display unit, for showing the translation of described text message on precalculated position corresponding with described text message on the described current web page page.
18. devices as described in claim 10-16 any one, is characterized in that, described device also comprises:
Display unit, shows the translation of described text message for suspending on precalculated position corresponding with described text message on the described current web page page.
19. 1 kinds of browser clients, is characterized in that, described browser client comprises the translating equipment of the Webpage content as described in claim 10~18 any one.
CN201410438229.3A 2014-08-29 2014-08-29 Method and device for translating webpage content and client Pending CN104199917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410438229.3A CN104199917A (en) 2014-08-29 2014-08-29 Method and device for translating webpage content and client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410438229.3A CN104199917A (en) 2014-08-29 2014-08-29 Method and device for translating webpage content and client

Publications (1)

Publication Number Publication Date
CN104199917A true CN104199917A (en) 2014-12-10

Family

ID=52085210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410438229.3A Pending CN104199917A (en) 2014-08-29 2014-08-29 Method and device for translating webpage content and client

Country Status (1)

Country Link
CN (1) CN104199917A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636326A (en) * 2014-12-30 2015-05-20 小米科技有限责任公司 Text message translation method and device
CN105760542A (en) * 2016-03-15 2016-07-13 腾讯科技(深圳)有限公司 Display control method, terminal and server
CN105808704A (en) * 2016-03-04 2016-07-27 北京奇虎科技有限公司 Evaluation and presentation method and device for encyclopedic entry content
CN109074326A (en) * 2016-04-04 2018-12-21 沃文技术株式会社 translation system
CN109062871A (en) * 2018-07-03 2018-12-21 北京明略软件系统有限公司 Text labeling method and device and computer readable storage medium
CN111680521A (en) * 2020-05-19 2020-09-18 北京搜狗科技发展有限公司 Translation processing method and device and translation processing device
CN114154092A (en) * 2021-11-18 2022-03-08 网易有道信息技术(江苏)有限公司 Method for translating web pages and related product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091509A1 (en) * 2001-01-02 2002-07-11 Yacov Zoarez Method and system for translating text
CN101470705A (en) * 2007-12-29 2009-07-01 英业达股份有限公司 Dynamic web page translation system and method
CN101625679A (en) * 2008-07-11 2010-01-13 英业达股份有限公司 System and method for displaying instant translation
CN103412857A (en) * 2013-09-04 2013-11-27 广东全通教育股份有限公司 System and method for realizing Chinese-English translation of webpage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020091509A1 (en) * 2001-01-02 2002-07-11 Yacov Zoarez Method and system for translating text
CN101470705A (en) * 2007-12-29 2009-07-01 英业达股份有限公司 Dynamic web page translation system and method
CN101625679A (en) * 2008-07-11 2010-01-13 英业达股份有限公司 System and method for displaying instant translation
CN103412857A (en) * 2013-09-04 2013-11-27 广东全通教育股份有限公司 System and method for realizing Chinese-English translation of webpage

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104636326A (en) * 2014-12-30 2015-05-20 小米科技有限责任公司 Text message translation method and device
CN105808704A (en) * 2016-03-04 2016-07-27 北京奇虎科技有限公司 Evaluation and presentation method and device for encyclopedic entry content
CN105760542A (en) * 2016-03-15 2016-07-13 腾讯科技(深圳)有限公司 Display control method, terminal and server
CN109074326A (en) * 2016-04-04 2018-12-21 沃文技术株式会社 translation system
CN109074326B (en) * 2016-04-04 2022-02-18 沃文技术株式会社 Translation system
CN109062871A (en) * 2018-07-03 2018-12-21 北京明略软件系统有限公司 Text labeling method and device and computer readable storage medium
CN109062871B (en) * 2018-07-03 2022-05-13 北京明略软件系统有限公司 Text labeling method and device and computer readable storage medium
CN111680521A (en) * 2020-05-19 2020-09-18 北京搜狗科技发展有限公司 Translation processing method and device and translation processing device
CN114154092A (en) * 2021-11-18 2022-03-08 网易有道信息技术(江苏)有限公司 Method for translating web pages and related product

Similar Documents

Publication Publication Date Title
CN109801347B (en) Method, device, equipment and medium for generating editable image template
CN104199917A (en) Method and device for translating webpage content and client
CN104412212A (en) Input method editor
CN110090444B (en) Game behavior record creating method and device, storage medium and electronic equipment
CN102830928A (en) Method and device for acquiring text inquiry result and mobile equipment
CN103098001B (en) A kind of disposal route of user interface and electronic equipment
CN104331474A (en) Page processing method and device
CN104020950A (en) Input method based on touch screen and input device with touch screen
CN103984709A (en) Method and device for carrying out search on any interface
CN104133884A (en) Webpage displaying method and device
CN109145272B (en) Text rendering and layout method, device, equipment and storage medium
CN105335383B (en) Input information processing method and device
CN103729122A (en) Method and device for unlocking mobile terminal
CN105786309A (en) Text selection method and device
CN104142774A (en) Page content processing method and page content processing device
CN104267922A (en) Information processing method and electronic equipment
CN103500158A (en) Method and device for annotating electronic document
CN103399766A (en) Method and device for updating input method system
CN103076955A (en) Method, device and terminal for adjusting characters of application
JP7369229B2 (en) How to change the skin of the mini program page, devices and electronic devices
CN104182266B (en) A kind of application installation method and device
CN105283882A (en) Production method for portable data carriers
CN111401323A (en) Character translation method, device, storage medium and electronic equipment
CN102982217A (en) Processing method and device of screen print
CN104267867A (en) Content input method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20141210