Machine translation method and electronic device
By implementing automatic scrolling screenshots and translations on electronic devices, the problem of cumbersome operations when viewing foreign news is solved, and the user experience and device intelligence are improved.
Patent Information
- Application Number
- CN202080066200.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-09-20
- Filing Date
- 2020-09-18
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-09-18
AI Technical Summary
In the prior art, users need to frequently take screenshots and translate when viewing foreign news, which is complicated to operate, poor user experience and low efficiency.
Provides a method of machine translation. By displaying a user interface on the touch screen of an electronic device, detecting user operations, and automatically performing scrolling screenshots and translations. Users can obtain multi-screen translation content by triggering scroll translation operations.
It reduces the cumbersome operations of users when viewing translations, improves the intelligence of electronic devices, improves the user experience, and realizes the function of quickly obtaining multi-screen translation content.
Smart Images

Figure CN114503116B_ABST
Abstract
Description
[0001] This application claims the priority of a Chinese patent application with the application number 201910895234.X, titled "Method and Electronic Device for Machine Translation", which was filed with the Chinese Patent Office on September 20, 2019, and the entire content of which is incorporated herein by reference. Technical Field
[0002] This application relates to the field of artificial intelligence, and more particularly, to a method and an electronic device for machine translation. Background Art
[0003] Text translation is currently widely used in various electronic devices such as mobile phones, tablet computers, and personal computers (PCs), providing convenient translation services for users.
[0004] Among text translations, there is a translation method based on a single picture. When a user takes a photo of a page of a foreign language book or wants to translate the content of the current page while viewing a foreign language news application (APP), the user needs to take a screenshot of the current page content and then input the obtained picture in the translation APP to obtain the translation result. If the user is viewing a relatively long news post, the user needs to continuously take screenshots in the news APP and then switch to the translation APP to input the corresponding pictures to obtain the translation result. Repeating this process can complete the reading of a foreign language news post. This method brings cumbersome operations to users, with a poor user experience and low efficiency. Summary of the Invention
[0005] This application provides a method and an electronic device for machine translation, which relate to the fields of artificial intelligence, natural language processing, and machine translation, and help to improve the intelligence level and user experience of the electronic device.
[0006] In a first aspect, a machine translation method is provided. The method is applied to an electronic device with a touch screen. The method includes: the electronic device displays a first user interface on the touch screen. The first user interface includes first content, and the language of the first content is a first language; the electronic device detects a first operation on the first user interface. The first operation includes a user operation for triggering scrolling translation; the electronic device responds to the first operation and starts scrolling screenshot from a first position of the first user interface; during the process of scrolling screenshot, when a second operation of the user is detected on a second user interface, or when the second user interface scrolls to an end position, the electronic device stops scrolling screenshot at a second position of the second user interface. The electronic device obtains a first picture, and the first picture is a picture corresponding to second content. The second content includes the content from the first position to the second position, and the language of the second content is the first language; the electronic device automatically obtains a translation result of the second content according to the first picture, and the language of the translation result of the second content is a second language; after automatically obtaining a part or all of the translation result of the second content, the electronic device automatically displays a third user interface. The third user interface includes a part or all of the translation result of the second content.
[0007] In the embodiments of the present application, when a user hopes to view the translated content corresponding to the original content on the electronic device, the user can trigger a user operation for scrolling translation to enable the electronic device to first perform scrolling screenshot, and then obtain the translated content corresponding to the original content obtained by the scrolling screenshot. This can avoid the cumbersome operations of the user when viewing the translation. One scrolling translation can obtain the translated content of multiple screens, which is convenient for the user to browse, helps to improve the intelligence level of the electronic device, and also helps to improve the user experience of the user when viewing the translation.
[0008] In combination with the first aspect, in some implementations of the first aspect, the method further includes: The electronic device detects a third operation on a fourth user interface, the fourth user interface including an end part of the translation result of the second content, and the third operation includes a user operation triggered by the user to perform scrolling translation; In response to the third operation, the electronic device automatically displays a fifth user interface and starts scrolling and capturing a screen from a third position of the fifth user interface, the fifth user interface including third content, the third position being associated with the first picture, and the language of the third content being the first language; During the process of scrolling and capturing the screen, when a fourth operation of the user is detected on a sixth user interface, or when the end position is scrolled to, the scrolling and capturing of the screen stops at a fourth position on the sixth user interface, and the electronic device obtains a second picture, the second picture being a picture corresponding to fourth content, the fourth content including the content from the third position to the fourth position, and the language of the fourth content being the first language; The electronic device automatically obtains a translation result of the fourth content according to the second picture, and the language of the translation result of the fourth content is the second language; After automatically obtaining a part or all of the translation result of the fourth content, the electronic device automatically displays a seventh user interface, the seventh user interface including a part or all of the translation result of the fourth content.
[0009] In the embodiments of the present application, when the user hopes to view more translated content after the first scrolling translation, the user can trigger the scrolling translation again, which can avoid the cumbersome operations of the user when viewing the translation. One scrolling translation can obtain the translated content of multiple screens, which is convenient for the user to browse, helps to improve the intelligence level of the electronic device, and also helps to improve the user experience of the user when viewing the translation.
[0010] In combination with the first aspect, in some implementations of the first aspect, the method further includes: The electronic device detects a fifth operation on an eighth user interface, the eighth user interface including an end part of the translation result of the second content, and the fifth operation includes a user operation triggered by the user to perform continued translation; In response to the fifth operation, the electronic device automatically obtains a translation result of fifth content, the fifth content including a part or all of the other content except the second content in all the content corresponding to the first language, and the language of the translation result of the fifth content is the second language; After automatically obtaining a part or all of the translation result of the fifth content, the electronic device automatically displays a ninth user interface or displays a ninth user interface after receiving a sliding operation of the user, and the ninth user interface includes a part or all of the translation result of the fifth content.
[0011] In the embodiments of the present application, when the user hopes to view more translated content after the first scroll translation, the user can trigger continued translation. The electronic device can jump to the original text interface to automatically obtain more original text content for translation to obtain more translated content; alternatively, the electronic device does not need to jump to the original text interface, but automatically loads more translated content in the background, so as to display more translated content to the user for convenient browsing.
[0012] In combination with the first aspect, in some implementation manners of the first aspect, the method further includes: in response to the fifth operation, automatically taking a screenshot to obtain a third picture, where the third picture is a picture corresponding to the fifth content.
[0013] In some possible implementation manners, the automatic screenshot may be a screenshot or a scrolling screenshot.
[0014] In combination with the first aspect, in some implementation manners of the first aspect, the automatically obtaining the translation result of the fifth content includes: the electronic device sending the third picture or a picture corresponding to a part of the third picture to the server; the electronic device receiving the translation result of the third picture or the picture corresponding to a part of the third picture returned by the server.
[0015] In the embodiments of the present application, after obtaining the third picture, the electronic device sends the third picture to the server, or sends a picture corresponding to a part of the third picture to the server. The server translates the original text content displayed on the third picture or the original text content displayed on the picture corresponding to a part of the third picture to obtain a translation result; the server may send the translation result to the electronic device, so that the electronic device displays the translation result to the user. The third picture or the picture corresponding to a part of the third picture may include pictures of multiple screens. Then, compared with the prior art where only one screen of picture can be sent each time, the translation efficiency can be improved, thereby enhancing the user experience when the user browses the translated text.
[0016] In combination with the first aspect, in some implementation manners of the first aspect, the automatically taking a screenshot to obtain the third picture includes automatically intercepting the content of one screen or multiple screens to obtain the third picture, and the automatic screenshot process is visible or invisible to the user.
[0017] In some possible implementation manners, the electronic device can take a screenshot to intercept the content of one screen.
[0018] In some possible implementation manners, the electronic device can also take a scrolling screenshot to intercept the content of multiple screens.
[0019] In the embodiments of the present application, the automatic screenshot process may be invisible to the user. Then, after the user obtains the translation for the first time through full-screen translation or scroll translation, if the user wants to view more translations, the user can directly trigger continuous translation to obtain more translations. There is no need to jump to the process of displaying the original text screenshot or scrolling screenshot. The user can directly view more translations based on the previous translation, which can further improve the user experience when the user browses the translations.
[0020] In combination with the first aspect, in some implementation manners of the first aspect, before automatically obtaining the translation result of the second content, the method further includes: the electronic device automatically divides the first picture into multiple pictures; wherein, the third position is related to a specific position in the last picture among the multiple pictures, and the specific position is: the starting position or the ending position or the middle position or the position at a predetermined ratio of the last picture; or, the starting position of the last paragraph or the starting position of the last n lines in the last picture, where n is a positive integer and n is greater than or equal to 1.
[0021] In the embodiments of the present application, the electronic device starts a long screenshot on the page currently displaying the first language (which can also be referred to as the original text), automatically scrolls down, and stops the long screenshot when the electronic device detects that the user can click on the screen; secondly, the text data translated into the second language (which can also be referred to as the translation) is displayed on the new page, and the user can slide up and down to view; then, the user can directly select to view the following content on the translation page (a scroll translation button is provided on this page for the user to click). After the user clicks the scroll translation button again, it will jump to the original text page, and jump to the vicinity of the position where the long screenshot stopped last time on the original text (the electronic device remembers this position). The electronic device can start scrolling screenshot and translation again from the vicinity of the position where the long screenshot stopped last time (or the first several lines before this position. By retaining some redundancy of the content, the user can recall where they read last time). This method is not limited to browser client translation based on web pages, and can also be used in non-browser scenarios such as third-party information APPs, greatly expanding the applicable scenarios and at the same time ensuring the coherence of the user reading experience.
[0022] In combination with the first aspect, in some implementation manners of the first aspect, automatically obtaining the translation result of the second content includes: the electronic device sends the multiple pictures to the server; the electronic device receives the translation result of each picture in the multiple pictures from the server; the electronic device forms a part of the translation result of the second content by using the translation results of some pictures in the multiple pictures, or forms the translation result of the second content by using the translation results of all the pictures in the multiple pictures.
[0023] In an embodiment of the present application, after obtaining the first picture, the electronic device can split the first picture into multiple pictures and send them to the server for translation; the server can send the translation results of the multiple pictures to the electronic device, so that the electronic device can display the translation results to the user. The first picture can include multiple pictures. Compared with the prior art where only one screen of pictures can be sent each time, the translation efficiency can be improved, thereby enhancing the user experience when the user views the translation.
[0024] In combination with the first aspect, in some implementation manners of the first aspect, the association between the third position and the first picture includes: the third position is related to a specific position in the first picture, and the specific position is: the end position or the middle position or a position at a predetermined ratio of the first picture; or, the starting position of the last paragraph or the starting position of the last n lines in the first picture, where n is a positive integer and n is greater than or equal to 1.
[0025] In an embodiment of the present application, the electronic device can split the first picture or can also not switch the first picture. The starting position of the second scroll screen capture can be related to the first picture.
[0026] In combination with the first aspect, in some implementation manners of the first aspect, the association between the third position and the first picture includes: the third position is related to the second content, where the third position is related to the end position or the middle position or a position at a predetermined ratio of the second content; or, the third position is related to the starting position of the last paragraph or the starting position of the last n lines in the second content, where n is a positive integer and n is greater than or equal to 1.
[0027] In an embodiment of the present application, the electronic device can split the first picture or can also not switch the first picture. The starting position of the second scroll screen capture can be related to the second content displayed on the first picture.
[0028] In combination with the first aspect, in some implementation manners of the first aspect, the automatic obtaining of the translation result of the second content includes: sending the picture corresponding to the first picture or a part of the first picture to the server; receiving the translation result of the picture corresponding to the first picture or a part of the first picture returned by the server.
[0029] In combination with the first aspect, in some implementation manners of the first aspect, the translation result of the second content includes the content obtained by translating the text content obtained after performing optical character recognition (OCR) on the first picture from the first language to the second language.
[0030] In the embodiments of the present application, the electronic device can use OCR to determine whether text or a picture will be truncated. If the mobile phone determines that the text or picture will be truncated at the splitting position, the splitting position can be moved up to the position of the blank line. The electronic device sends the text content obtained through OCR to the server, and the server can translate the corresponding text content.
[0031] In combination with the first aspect, in some implementation manners of the first aspect, automatically obtaining the translation result of the second content includes: the electronic device sending the picture corresponding to the first picture or a part of the first picture to the server; the electronic device receiving the translation result of the picture corresponding to the first picture or a part of the first picture returned by the server.
[0032] In combination with the first aspect, in some implementation manners of the first aspect, the translation result of the second content includes the content obtained by translating the text content obtained after performing optical character recognition (OCR) text recognition on the first picture from the first language to the second language.
[0033] In the embodiments of the present application, the electronic device can use OCR to determine whether text or a picture will be truncated. If the mobile phone determines that the text or picture will be truncated at the splitting position, the splitting position can be moved up to the position of the blank line.
[0034] It should be understood that in the embodiments of the present application, OCR text recognition can be performed by the electronic device, and text translation can be performed by the server; or, OCR text recognition and text translation can be completed by the server; or, OCR text recognition and text translation can also be completed together by the same or different servers.
[0035] In combination with the first aspect, in some implementation manners of the first aspect, the method further includes: displaying a first prompt message at or near the third position, where the first prompt message is used to prompt the user of the starting position of the scrolling screenshot; and / or, displaying a second prompt message at or near the second position, where the second prompt message is used to prompt the user that the user last read up to the second position.
[0036] By displaying the first prompt message and / or the second prompt message, before reading the translation of the second scrolling screenshot, the user can become familiar with the content of the original text in the second scrolling screenshot again, which has a certain effect of evoking memory and assisting continuous reading for the user.
[0037] In combination with the first aspect, in some implementation manners of the first aspect, the first operation includes the user clicking a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0038] In combination with the first aspect, in certain implementations of the first aspect, the third operation includes the user clicking on a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0039] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: after receiving a sliding operation of the user on the third user interface, displaying a tenth user interface, where the tenth user interface includes subsequent translation results associated with the translation results included on the third user interface.
[0040] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: before detecting the third operation, the method further includes: displaying a control on the fourth user interface that can trigger scrolling translation.
[0041] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: before detecting the fifth operation, the method further includes: displaying a control on the eighth user interface that can trigger continued translation.
[0042] In combination with the first aspect, in certain implementations of the first aspect, the detecting a first operation on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, displaying a plurality of function controls, where the plurality of function controls includes a first control that can trigger scrolling translation; detecting that the user clicks on the first control or the user inputs a voice command that can trigger the scrolling translation function.
[0043] In combination with the first aspect, in certain implementations of the first aspect, the second content includes a part or all of the other content in the entire content corresponding to the first content and the first language except the first content.
[0044] In combination with the first aspect, in certain implementations of the first aspect, the third content includes a part of the other content in the entire content corresponding to the first language except the second content, and the fourth content includes a part or all of the other content in the entire content corresponding to the first language except the second content.
[0045] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: after receiving a sliding operation of the user on the ninth user interface, displaying an eleventh user interface, where the eleventh user interface includes subsequent translation results associated with the translation results included on the ninth user interface.
[0046] Second aspect, a machine translation method is provided. The method is applied to an electronic device with a touch screen, and the method includes: the electronic device displays a first user interface on the touch screen, the first user interface includes first content, and the language of the first content is a first language; the electronic device detects a first operation of the user on the first user interface, the first operation includes a user operation for triggering full-screen translation; the electronic device, in response to the first operation, obtains a first picture obtained by taking a screenshot of the first user interface; the electronic device automatically obtains a translation result of the first content according to the first picture, and the language of the translation result of the first content is a second language; after the electronic device automatically obtains the translation result of the first content, it automatically displays a second user interface, and the second user interface includes part or all of the translation result of the first content; the electronic device detects a second operation of the user on the second user interface, the second operation includes a user operation for triggering scrolling translation; the electronic device, in response to the second operation, automatically displays a third user interface and starts scrolling and taking screenshots from a first position of the third user interface, the third user interface includes second content, the first position is associated with the first picture, and the language of the second content is the first language; during the process of scrolling and taking screenshots, when a third operation of the user is detected on a fourth user interface, or when the fourth user interface scrolls to an end position, stop scrolling and taking screenshots at a second position on the fourth interface, and the electronic device obtains a second picture, the second picture is a picture corresponding to third content, the third content includes the content from the first position to the second position, and the language of the third content is the first language; the electronic device automatically obtains a translation result of the third content according to the second picture, and the language of the translation result of the third content is the second language; after the electronic device automatically obtains part or all of the translation result of the third content, it automatically displays a fifth user interface, and the fifth user interface includes part or all of the translation result of the third content.
[0047] In the embodiments of the present application, a process of first performing full-screen translation and then performing scrolling translation is provided. That is to say, the user can first perform full-screen translation, and a control for scrolling translation can be displayed on the translation interface of the full-screen translation. Subsequently, the user can perform scrolling translation. In this way, after the user first performs full-screen translation, the user can first determine whether he is interested in the original content. If interested, the user can subsequently perform scrolling translation to view more translation content; if not interested in the original content, the user can stop reading the current original text and then search for the original text he is interested in.
[0048] In some possible implementation manners, the second content and the first content may be the same; or, the second content includes a part of the first content.
[0049] In combination with the second aspect, in certain implementations of the second aspect, before automatically obtaining the translation result of the third content, the method further includes: the electronic device automatically splitting the second picture into multiple pictures; the electronic device sending the multiple pictures to the server; the electronic device receiving the translation results of each of the multiple pictures from the server; the electronic device forming a part of the translation result of the third content with the translation results of some of the multiple pictures, or forming the translation result of the third content with the translation results of all of the multiple pictures.
[0050] In combination with the second aspect, in certain implementations of the second aspect, the translation result of the third content includes the content obtained by translating the text content obtained after performing OCR text recognition on the second picture from the first language to the second language.
[0051] In the embodiments of the present application, the electronic device can use OCR to determine whether text or a picture will be truncated. If the mobile phone determines that the splitting position will truncate text or a picture, it can move the splitting position up to the position of a blank line. The electronic device sends the text content obtained by OCR to the server, and the server can translate the corresponding text content.
[0052] In combination with the second aspect, in certain implementations of the second aspect, the method further includes: the electronic device displaying a first prompt message at or near the first position, the first prompt message being used to prompt the user of the starting position of the scrolling screenshot; and / or, the electronic device displaying a second prompt message at the end position of the first picture, the second prompt message being used to prompt the user that the last reading reached the end position.
[0053] In the embodiments of the present application, by displaying the first prompt message and / or the second prompt message, before reading the translation of the second scrolling screenshot, the user can become familiar with the content of the original text in the second scrolling screenshot again, which has a certain role in evoking memories and assisting continuous reading for the user.
[0054] In combination with the second aspect, in certain implementations of the second aspect, the second operation includes the user clicking a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0055] In combination with the second aspect, in certain implementations of the second aspect, the first position is associated with the first picture, including: the first position is related to a specific position in the first picture, where the specific position is: the end position or the middle position or the position of a predetermined ratio of the first picture; or, the starting position of the last paragraph or the starting position of the last n lines in the first picture, n is a positive integer, and n is greater than or equal to 1.
[0056] In connection with the second aspect, in some implementations of the second aspect, the first position is associated with the first picture, including: the first position is related to the end position or the middle position or the position of a predetermined ratio of the first content; or, the first position is related to the start position of the last paragraph or the start position of the last n lines in the first content, where n is a positive integer and n is greater than or equal to 1.
[0057] In the embodiments of the present application, the electronic device can start scrolling screenshot and translation from a certain position on the first picture obtained from the previous screenshot (or several lines before this position, by retaining some content redundancy to enable the user to recall where they left off last time). This method is not limited to web browser client translation and can also be used in non-browser scenarios such as third-party news APPs, greatly expanding the applicable scenarios while also ensuring the coherence of the user reading experience.
[0058] In connection with the second aspect, in some implementations of the second aspect, the method further includes: after receiving a sliding operation of the user on the fifth user interface, the electronic device displays a sixth user interface, and the sixth user interface includes subsequent translation results associated with the translation results included on the fifth user interface.
[0059] In connection with the second aspect, in some implementations of the second aspect, before detecting a second operation of the user on the second user interface, the method further includes: the electronic device displays a control on the second user interface that can trigger scrolling translation.
[0060] In connection with the second aspect, in some implementations of the second aspect, detecting a first operation of the user on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, the electronic device displays a plurality of function controls, and the plurality of function controls include a first control that can trigger full-screen translation; the electronic device detects that the user clicks the first control or the user inputs a voice command that can trigger the full-screen translation function.
[0061] In connection with the second aspect, in some implementations of the second aspect, automatically obtaining the translation result of the second content includes: the electronic device sends the second picture or the picture corresponding to a part of the second picture to the server; the electronic device receives the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
[0062] In a third aspect, a machine translation method is provided. The method is applied to an electronic device with a touch screen, and the method includes: the electronic device displays a first user interface on the touch screen, and the first user interface includes first content, and the language of the first content is a first language; the electronic device detects a first operation of the user on the first user interface, and the first operation includes a user operation for triggering full-screen translation; the electronic device takes a screenshot of the first user interface in response to the first operation to obtain a first picture; the electronic device automatically obtains a translation result of the first content according to the first picture, and the language of the translation result of the first content is a second language; after the electronic device automatically obtains the translation result of the first content, the electronic device automatically displays a second user interface, and the second user interface includes a part or all of the translation result of the first content; the electronic device detects a second operation of the user on the second user interface, and the second operation includes a user operation for triggering continued translation; in response to the second operation, a translation result of second content is automatically obtained, and the second content includes a part or all of the other content except the first content in all the content corresponding to the first language, and the language of the translation result of the second content is the second language; after automatically obtaining a part or all of the translation result of the second content, the electronic device automatically displays a third user interface or displays the third user interface after receiving a swipe operation of the user, and the third user interface includes a part or all of the translation result of the second content.
[0063] In the embodiments of the present application, after the electronic device performs a full-screen translation once, the electronic device can provide a control for continued translation to the user. When the electronic device detects that the user clicks the control for continued translation, it can directly load all or a part of the translation corresponding to the remaining original text in the background. In this way, the electronic device does not need to jump to the original text interface for scrolling screenshots, which can further improve the user experience when the user reads the translation.
[0064] In combination with the third aspect, in some implementation manners of the third aspect, the method further includes: taking a screenshot automatically to obtain a second picture in response to the second operation, and the second picture is a picture corresponding to the second content; the automatically obtaining the translation result of the second content includes: automatically obtaining the translation result of the second content according to the second picture.
[0065] In combination with the third aspect, in some implementation manners of the third aspect, the automatically obtaining the translation result of the second content includes: the electronic device sends the second picture or a picture corresponding to a part of the second picture to the server; the electronic device receives the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
[0066] In combination with the third aspect, in some implementation manners of the third aspect, the automatic screenshot to obtain the second picture includes: the electronic device automatically intercepts the content of one or more screens to obtain the second picture, and the automatic screenshot process is visible or invisible to the user.
[0067] In the embodiments of the present application, after the user triggers the operation of scrolling screenshot, the electronic device can directly perform screenshot without jumping to the original text interface, but can automatically load a part or all of the translations corresponding to the remaining original text in the background, avoiding the impact on the user caused by the jump between the original text and the translation.
[0068] In combination with the third aspect, in some implementation manners of the third aspect, the automatic obtaining of the translation result of the second content includes: the electronic device automatically slices the second picture into multiple pictures; the electronic device sends the multiple pictures to the server; the electronic device receives the translation results of each picture in the multiple pictures from the server; the electronic device forms a part of the translation result of the second content by using the translation results of some pictures in the multiple pictures, or forms the translation result of the second content by using the translation results of all pictures in the multiple pictures.
[0069] In combination with the third aspect, in some implementation manners of the third aspect, the second operation includes the user clicking on a first control that can trigger the continue translation function or the user inputting a voice command that can trigger the continue translation function.
[0070] In combination with the third aspect, in some implementation manners of the third aspect, the method further includes: after receiving a sliding operation of the user on the third user interface, the electronic device displays a fourth user interface, and the fourth user interface includes subsequent translation results associated with the translation results included on the third user interface.
[0071] In combination with the third aspect, in some implementation manners of the third aspect, before detecting a first operation of the user on the first user interface, the method further includes: the electronic device displays a control on the first user interface that can trigger full-screen translation.
[0072] In combination with the third aspect, in some implementation manners of the third aspect, before detecting a second operation of the user on the second user interface, the method further includes: displaying a control on the second user interface that can trigger continue translation.
[0073] In combination with the third aspect, in some implementation manners of the third aspect, detecting a first operation of the user on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, displaying a plurality of function controls, the plurality of function controls including a first control that can trigger full-screen translation; detecting that the user clicks on the first control or the user inputs a voice command that can trigger the full-screen translation function.
[0074] Fourthly, a device is provided. The device is included in an electronic device and has a function of implementing the behaviors of the electronic device in the above aspects and possible implementation manners of the above aspects. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions.
[0075] Fifthly, an electronic device is provided, including: a touch screen; one or more processors; a memory; and one or more computer programs. Among them, the one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed by the electronic device, the electronic device is caused to execute the machine translation method in any possible implementation of the first aspect, the second aspect, or the third aspect above.
[0076] Sixthly, a computer storage medium is provided by this technical solution, including computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute the machine translation method in any possible implementation of any aspect above.
[0077] Seventhly, a computer program product is provided by this technical solution. When the computer program product runs on an electronic device, the electronic device is caused to execute the machine translation method in any possible design of any aspect above.
[0078] Eighthly, a chip system is provided by this technical solution. The chip system includes at least one processor. When program instructions are executed in the at least one processor, the functions of any possible method in the first aspect above are implemented on the electronic device. Description of the Drawings
[0079] Figure 1 is a schematic structural diagram of the electronic device provided by the embodiment of the present application.
[0080] Figure 2 is a software structure block diagram of the electronic device provided by the embodiment of the present application.
[0081] Figure 3 is a group of GUIs provided by the embodiment of the present application.
[0082] Figure 4 is another group of GUIs provided by the embodiment of the present application.
[0083] Figure 5 is another group of GUIs provided by the embodiment of the present application.
[0084] Figure 6 is another group of GUIs provided by the embodiment of the present application.
[0085] Figure 7It is another group of GUIs provided by the embodiments of the present application.
[0086] Figure 8 It is another group of GUIs provided by the embodiments of the present application.
[0087] Figure 9 It is another group of GUIs provided by the embodiments of the present application.
[0088] Figure 10 It is another group of GUIs provided by the embodiments of the present application.
[0089] Figure 11 It is a schematic flowchart of the method for machine translation provided by the embodiments of the present application.
[0090] Figure 12 It is a schematic flowchart of the method for machine translation provided by the embodiments of the present application.
[0091] Figure 13 It is a schematic flowchart of the method for machine translation provided by the embodiments of the present application.
[0092] Figure 14 It is a schematic flowchart of the method for machine translation provided by the embodiments of the present application. Detailed implementation manners
[0093] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are also intended to include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one" and "one or more" mean one, two, or more than two. The term "and / or" is used to describe the association relationship of associated objects and indicates that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after.
[0094] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized. The terms "comprising", "including", "having" and their variants mean "including but not limited to", unless otherwise specifically emphasized.
[0095] Embodiments of an electronic device, a user interface for such an electronic device, and for using such an electronic device are described below. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or music player functions, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication functions (such as a smart watch), etc. Exemplary embodiments of the portable electronic device include, but are not limited to, portable electronic devices equipped with or other operating systems. The above portable electronic device may also be other portable electronic devices, such as a laptop computer, etc. It should also be understood that in other some embodiments, the above electronic device may not be a portable electronic device, but a desktop computer.
[0096] Exemplarily, Figure 1 A schematic structural diagram of an electronic device 100 is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a compass 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0097] It can be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those illustrated, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0098] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent components or integrated in one or more processors. In some embodiments, the electronic device 101 may also include one or more processors 110. Among them, the controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions. In some other embodiments, a memory may also be provided in the processor 110 for storing instructions and data. Exemplarily, the memory in the processor 110 may be a cache memory. This memory may store the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the electronic device 101 in processing data or executing instructions.
[0099] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a USB interface, etc. Among them, the USB interface 130 is an interface that conforms to the USB standard specification, and specifically may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 101, and can also be used to transfer data between the electronic device 101 and peripheral devices. The USB interface 130 can also be used to connect headphones to play audio through the headphones.
[0100] It can be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods in the above embodiments.
[0101] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module 140 may receive the charging input of the wired charger through the USB interface 130. In some embodiments of wireless charging, the charging management module 140 may receive the wireless charging input through the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also supply power to the electronic device through the power management module 141.
[0102] The power management module 141 is used to connect to the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives inputs from the battery 142 and / or the charging management module 140 and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, the wireless communication module 160, etc. The power management module 141 can also be used to monitor parameters such as the battery capacity, the number of battery cycles, and the battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be disposed in the processor 110. In some other embodiments, the power management module 141 and the charging management module 140 can also be disposed in the same device.
[0103] The wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0104] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: The antenna 1 can be multiplexed as the diversity antenna of the wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0105] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least some functional modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 can be disposed in the same device.
[0106] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite systems (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 may also receive signals to be sent from the processor 110, perform frequency modulation and amplification on them, and convert them into electromagnetic waves through the antenna 2 for radiation.
[0107] The electronic device 100 realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to execute mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0108] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel may adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or more display screens 194.
[0109] In some embodiments of the present application, when the display panel adopts materials such as OLED, AMOLED, FLED, etc., the above Figure 1The display screen 194 therein can be bent. Here, the fact that the above-mentioned display screen 194 can be bent means that the display screen can be bent to any angle at any part and can be maintained at that angle. For example, the display screen 194 can be folded in half left and right from the middle. It can also be folded in half up and down from the middle.
[0110] The display screen 194 of the electronic device 100 can be a flexible screen. Currently, flexible screens have attracted much attention due to their unique characteristics and great potential. Compared with traditional screens, flexible screens have the characteristics of strong flexibility and bendability, can provide users with new interaction methods based on the bendable characteristics, and can meet users' more demands for electronic devices. For an electronic device configured with a foldable display screen, the foldable display screen on the electronic device can be switched between a small screen in the folded state and a large screen in the unfolded state at any time. Therefore, users are using the split-screen function on electronic devices configured with foldable display screens more and more frequently.
[0111] The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, etc.
[0112] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0113] The camera 193 is used to capture static images or videos. An object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into a standard RGB, YUV, etc. format image signal. In some embodiments, the electronic device 100 can include one or more cameras 193.
[0114] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0115] A video codec is used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0116] The NPU is a neural-network (NN) computing processor. By learning from the structure of biological neural networks, such as the transmission pattern between human brain neurons, it can quickly process input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 100 can be realized, such as image recognition, face recognition, speech recognition, text understanding, etc.
[0117] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve the data storage function. For example, files such as music and videos are saved in the external memory card.
[0118] The internal memory 121 can be used to store one or more computer programs, and the one or more computer programs include instructions. The processor 110 can execute the instructions stored in the internal memory 121, so that the electronic device 101 executes the machine translation method provided in some embodiments of the present application, as well as various applications and data processing. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store the operating system; the program storage area can also store one or more applications (such as a gallery, contacts, etc.). The data storage area can store the data created during the use of the electronic device 101 (such as photos, contacts, etc.). In addition, the internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 110 can execute the instructions stored in the internal memory 121 and / or the instructions stored in the memory provided in the processor 110, so that the electronic device 101 executes the machine translation method provided in the embodiments of the present application, as well as other applications and data processing. The electronic device 100 can achieve audio functions through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, and the application processor, etc. Such as music playback, recording, etc.
[0119] The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
[0120] Among them, the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.
[0121] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., X, Y, and Z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0122] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0123] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the sensed ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance during photography. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touch.
[0124] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint answering calls, etc.
[0125] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 utilizes the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor near the temperature sensor 180J in order to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent abnormal shutdown of the electronic device 100 caused by low temperature. In some other embodiments, when the temperature is lower than yet another threshold, the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0126] The touch sensor 180K, also known as the "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen". The touch sensor 180K is used to detect touch operations acting thereon or nearby. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a different position from the display screen 194.
[0127] Figure 2 It is a software structure block diagram of the electronic device 100 in the embodiments of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom are the application layer, the application framework layer, the Android runtime and the system libraries, and the kernel layer. The application layer can include a series of application packages.
[0128] As Figure 2 shown, the application packages can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0129] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0130] Such as Figure 2 shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0131] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, a locked screen, take a screenshot, etc.
[0132] The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc.
[0133] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.
[0134] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including connection, disconnection, etc.).
[0135] The resource manager provides various resources for applications, such as localized strings, icons, pictures, layout files, video files, etc.
[0136] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform that the download is completed, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or a scroll bar text, such as the notification of a background-running application, and can also be a notification that appears on the screen in the form of a dialogue window. For example, prompt text information in the status bar, emit a prompt sound, the electronic device vibrates, the indicator light flashes, etc.
[0137] The system library may include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing library (e.g., OpenGL ES), 2D graphics engine (e.g., SGL), etc.
[0138] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
[0139] The media library supports the playback and recording of multiple common audio and video formats, as well as static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG, etc.
[0140] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.
[0141] The 2D graphics engine is the drawing engine for 2D drawing.
[0142] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.
[0143] Before introducing the method of machine translation in the embodiments of the present application, several concepts related to the embodiments of the present application are introduced first.
[0144] Full-screen screenshot: Perform a "snapshot" operation on the content displayed on the current electronic device to form a picture with the same length and width as the screen and the same content. For example, on an iPhone, pressing the Home key and the power key simultaneously for a short time can take a full-screen screenshot, or on a model without a Home key, pressing the volume up key and the power key simultaneously for a short time can trigger it. Another example is that on a Huawei mobile phone, it can be triggered by double-tapping the screen with a knuckle. Other manufacturers may also have other ways to start a full-screen screenshot.
[0145] Long screenshot: After being triggered by a certain interaction method on the content displayed on the electronic device, a picture with a length exceeding the screen height is generated, and the content is a long picture that is continuously intercepted downward from the current display position for more than one screen. For example, on a Huawei mobile phone, it means drawing an "S" on the screen with a knuckle to start and clicking to stop. Other manufacturers may also have other ways to start a long screenshot.
[0146] For ease of understanding, the following embodiments of the present application will use a mobile phone with Figure 1 and Figure 2 the structure shown as an example, and in combination with the accompanying drawings, the method of machine translation provided in the embodiments of the present application will be specifically described.
[0147] Figure 3 A set of graphical user interfaces (GUI) of the mobile phone is shown, where from Figure 3 (a) in Figure 3 to (m) in
[0148] Refer to Figure 3 the GUI shown in (a) of [[REF]], which is the desktop of a mobile phone. The desktop of the mobile phone includes 3 desktop pages, and each desktop page includes one or more icons of applications (Application, APP). Among them, the currently displayed desktop page of the mobile phone is the second desktop page 301, and this desktop page includes the icon of Alipay, the icon of the task card store, the icon of Weibo, the icon of English Reading 302, the icon of WeChat, the icon of the card pack, the icon of Settings, and the icon of the camera. When the mobile phone detects the operation of the user clicking on the icon 302, it can display the GUI as shown in Figure 3 (b) of [[REF]].
[0149] Refer to Figure 3 the GUI shown in (b) of [[REF]], which is the display interface of the English Reading APP. The display interface includes multiple English short passages. Among them, there is an English short passage 303 with the title "A family of four was on a camping trip in Canada. Then a wolf attacked while they were sleeping", an English short passage with the title "Draft law seeks strict action against throwing objects from buildings", and an English short passage with the title "71-Year-Old Grandma Sets New Half Marathon World Record in Ohio". When the mobile phone detects the operation of the user clicking on the English short passage 303, it can display the GUI as shown in Figure 3 (c) of [[REF]].
[0150] Refer to Figure 3 the GUI shown in (c) of [[REF]], which is the display interface of the English short passage 303. Among them, the user can read the original text of the English short passage by swiping up and down on the screen. Refer to Figure 3 as shown in (c) of [[REF]], when the mobile phone detects the operation of the user pressing the interface with two fingers, the mobile phone can display the GUI as shown in Figure 3 (d) of [[REF]].
[0151] Refer to Figure 3The GUI shown in (d), which is the display interface of intelligent text recognition. When the mobile phone detects the operation of the user pressing the screen with two fingers, the mobile phone can automatically pop up a reminder box 304, which can be the display interface of intelligent text recognition. The mobile phone can automatically identify the word segmentation in the English short text, for example, word segmentation such as "wolf", "It", "was", "Something", "out", and "a", etc. The reminder box 304 can also include controls such as search, copy, map, share, and full-screen translation. When the mobile phone detects the operation of the user clicking the control 305, it can display the GUI as shown in Figure 3 in (e).
[0152] In the embodiments of the present application, the mobile phone can have the intelligent text recognition function. Among them, the intelligent text recognition function can include that after the mobile phone detects that two fingers press on the text, the mobile phone can automatically extract the text content of the pressed area and analyze the keywords, etc.; it can also include that after the mobile phone detects that two fingers press on the picture, the mobile phone extracts the picture content of the pressed area and analyzes the items in the picture.
[0153] It should be understood that in the embodiments of the present application, full-screen translation can also be understood as translating the original text displayed on the current screen, or translating the content of one screen displayed after taking a screenshot or screen capture of the current screen. When the mobile phone detects that the user clicks the control 305, the mobile phone can automatically translate the original text on the screen as shown in Figure 3 in (c).
[0154] See Figure 3 the GUI shown in (e), which is the loading interface of full-screen translation. Among them, the mobile phone defaults to translating the English on the current screen into Chinese. When the mobile phone finishes translating the content displayed on the current screen, it can automatically display the GUI as shown in Figure 3 in (f).
[0155] See Figure 3 the GUI shown in (f), which is the translation text interface of full-screen translation. The mobile phone translates the English short text displayed in Figure 3 in (c) into the corresponding Chinese. The user can also click on the translation language on this translation text interface. For example, when the user clicks "Chinese", multiple other foreign languages can be displayed, and the user can select other translation languages. This translation text interface also includes a control 306 for scrolling screen translation and a control for copying the translation text. When the mobile phone detects the operation of the user clicking the control 306, it can display the GUI as shown in Figure 3 in (g).
[0156] It should be understood that in the embodiments of the present application, scroll screen translation can also be referred to as long screenshot translation. The difference from full screen translation is that for scroll screen translation, the mobile phone can first take a long screenshot of the original text content, and then automatically translate the content on the long screenshot (which can be the content of multiple screens), while full screen translation can only translate the content currently displayed in the original text (the content of one screen) as shown in (c) in Figure 3 .
[0157] Refer to Figure 3 for the GUI shown in (g). This GUI is the scroll display interface of the long screenshot. As Figure 3 shown in (g), a reminder box 307 can be included on the scroll display interface of this long screenshot. The reminder box 307 can remind the user in text "Scrolling screenshot in progress.. Click on the scrolling area to complete the screenshot". The mobile phone can automatically scroll the screen downwards. Exemplarily, from Figure 3 in (g) to Figure 3 in (h), and then to Figure 3 in (i) are all the processes of the mobile phone automatically scrolling down.
[0158] Refer to Figure 3 for the GUI shown in (i). When the mobile phone scrolls to the bottom (or the end) of the English short passage during the scrolling screenshot, the mobile phone can automatically complete the automatic screenshot. At this time, the starting position of the long screenshot can be the beginning of the English short passage as shown in (c) in Figure 3 , and the end position of the long screenshot can be the end of the English short passage. When the mobile phone completes the long screenshot, the mobile phone can automatically display the interface as shown in (j) in Figure 3 .
[0159] Refer to Figure 3 for the GUI shown in (j). This GUI is the loading interface for scroll screen translation. The mobile phone can translate the English on the long screenshot into the corresponding Chinese. When the translation is completed, the mobile phone can automatically display the GUI as shown in (k) in Figure 3 .
[0160] Refer to Figure 3 for the GUI shown in (k). This GUI is the translation text interface for scroll screen translation. The mobile phone has translated the English short passage on the long screenshot into the corresponding Chinese. After the mobile phone detects the user's upward sliding operation on the screen, the mobile phone can scroll and display the translation content. During the process of scrolling and displaying the translation content, a scroll bar 308 can also appear on the translation text interface for scroll screen translation. When the mobile phone scrolls down to display the translation content, the scroll bar 308 can also slide down correspondingly. The position of the scroll bar 308 can correspond to the position of the translation on the current interface in the entire translation.
[0161] From Figure 3 in (k) toFigure 3 Among them, (m) is the process of the mobile phone scrolling to display the change process of the translated content. The user can view the corresponding translation by swiping up or down.
[0162] In one embodiment, when the user finishes viewing the translation corresponding to the long screenshot, the user can click on the control 309 to exit the translation interface of the scrolling translation. In the embodiment of the present application, when the mobile phone detects the operation of the user clicking on the control 309, the original text interface can be displayed, and the original text interface can be the original text content display interface when the electronic device starts to perform the scrolling screenshot. Exemplarily, when the mobile phone detects the operation of the user clicking on the control 309, the GUI shown in Figure 3 (c) can be displayed.
[0163] It should be understood that the above Figure 3 (i) is described by taking the example that the long screenshot automatically stops after scrolling to the end of the English short passage in the scrolling screenshot. It can also be that before the mobile phone screen automatically scrolls to the end of the English short passage, the mobile phone automatically stops the long screenshot after detecting the user's click operation on the screen. The corresponding process can be referred to Figure 4 the GUI in.
[0164] It should also be understood that the control 306 for scrolling translation can continue to be displayed on the translation interface in the above Figure 3 (k) to (i). It can also be that after the mobile phone determines that the entire content of the English short passage has been translated (or, the mobile phone determines that the long screenshot automatically stops after scrolling to the end of the English short passage), the control 306 for scrolling translation can be not displayed on the translation interface.
[0165] The above combines Figure 3 (a) to (i) to introduce the process that the user first performs full-screen translation and then scrolling translation after opening the English short passage. That is to say, the user can first perform full-screen translation, and the control for scrolling translation can be displayed on the translation interface of the full-screen translation. Subsequently, the user can perform scrolling translation. In this way, after the user first performs full-screen translation, the user can first determine whether they are interested in the original text content. If interested, the user can subsequently perform scrolling translation to view more translated content; if not interested in the original text content, then the user can stop reading the current original text and then search for the original text they are interested in.
[0166] Next, another group of GUIs provided by the embodiments of the present application will be introduced in combination with Figure 4 .
[0167] Refer to the GUI shown in Figure 4 (a). This GUI is the display interface of intelligent screen recognition. Among them, the user can read the original text of the English short passage by swiping up and down on the screen. Refer to Figure 4As shown in (a) in [reference], when the mobile phone detects the operation of the user pressing the interface with two fingers, the mobile phone can display the GUI as shown in Figure 4 (b) in [reference].
[0168] See Figure 4 (b) in [reference]. This GUI is another display interface of the intelligent screen recognition. Compared with Figure 3 (d) in [reference], Figure 4 (b) in [reference] includes two controls, namely full-screen translation and scrolling translation, on the intelligent screen recognition interface. The user can choose full-screen translation, that is, translate the original text content (one screen of content) on the interface shown in Figure 4 (a) in [reference]; or the user can choose scrolling translation, that is, first take a long screenshot and translate the original text content (which can be multiple screens of content) displayed on the long screenshot. When the mobile phone detects the operation of the user clicking on control 401, it displays the GUI as shown in Figure 4 (c) in [reference].
[0169] See Figure 4 (c) in [reference]. This GUI is the scrolling display interface of the long screenshot. As shown in Figure 4 (c) in [reference], the scrolling display interface of this long screenshot may include a reminder box 402. The reminder box 402 can remind the user in words "Scrolling screenshot in progress.. Click on the scrolling area to complete the screenshot". The mobile phone can automatically scroll the screen downwards. Exemplarily, from Figure 4 (c) to Figure 4 (d) in [reference] are all the processes of the automatic downward scrolling of the English short text.
[0170] See Figure 4 (d) in [reference]. This GUI is another display interface of the scrolling of the long screenshot. When the mobile phone detects the click action of the user on the screen, the mobile phone can complete the long screenshot operation. The mobile phone can automatically display the GUI as shown in Figure 4 (e) in [reference].
[0171] See Figure 4 (e) in [reference]. This GUI is the loading interface of the scrolling translation. The mobile phone can translate the English on the long screenshot into the corresponding Chinese. When the translation is completed, the mobile phone can automatically display the GUI as shown in Figure 4 (f) in [reference].
[0172] See Figure 4 (f) in [reference]. This GUI is the translation text interface of the scrolling translation. The mobile phone has translated the English short text on the long screenshot into the corresponding Chinese. When the mobile phone detects the operation of the user swiping up or down on the screen, the mobile phone can scroll and display the translation content.
[0173] FromFigure 4 from (f) to Figure 4 The process of changing the GUI shown in (g) in [] is the process for the user to view the translated text corresponding to the multi-screen content obtained from the first long screenshot. After the user finishes viewing, if they want to continue viewing the translated text corresponding to the remaining original text, they can click the scroll translation control 403. When the mobile phone detects the operation of the user clicking the control 403, it can display as Figure 4 the GUI shown in (h) in [].
[0174] See Figure 4 the GUI shown in (h) in [], which is another display interface for scrolling screenshots. The mobile phone can start a long screenshot from "Feesaid he immediately...rocks at it" (the last paragraph of the first long screenshot).
[0175] See Figure 4 the GUI shown in (i) in [], when the mobile phone detects the click operation of the user on the screen, it can complete the scroll translation. The last paragraph of the long screenshot is Figure 4 "Incidents like these are extremely...in Ontario" shown in (i) in [].
[0176] It should be understood that Figure 4 from (c) to Figure 4 in (d) in [] can be the process of the first long screenshot, Figure 4 from (h) to (i) in [] can be the process of the second long screenshot.
[0177] In one embodiment, when the mobile phone performs the next long screenshot, the starting point of the next long screenshot can be the last paragraph of the previous long screenshot, as shown in Figure 4 (h) in [], the starting point of the second long screenshot can be the last paragraph of the first long screenshot.
[0178] In one embodiment, when the mobile phone performs the next long screenshot, the starting point of the next long screenshot can be the last two paragraphs of the previous long screenshot, and so on.
[0179] Exemplarily, the mobile phone can also start a long screenshot from "The screams were so...situation,"...in the back hip area" (the penultimate paragraph of the first long screenshot).
[0180] In one embodiment, when the mobile phone performs the next long screenshot, the starting point of the next long screenshot can be the last screen content of the previous long screenshot.
[0181] It should be understood that after a mobile phone takes a long screenshot, if the content of the long screenshot exceeds the size of one screen, the mobile phone can split the content of the long screenshot into multiple screens of content.
[0182] Exemplarily, the mobile phone can split the long picture generated by the long screenshot according to the relationship between the height of the picture and the height of the mobile phone screen. At the splitting position, optical character recognition (OCR) is used to determine whether text or pictures will be truncated. If the mobile phone determines that the text or pictures will be truncated at the splitting position, the splitting position can be moved up to the blank line position to obtain several pictures with a height slightly less than or equal to the screen height. Then, the next time the rolling screen translation is performed, the long screenshot can start from the last picture (or the content of the last screen) among the multiple pictures (or the content of multiple screens) obtained from the previous long screenshot. Alternatively, after analyzing the last picture (or the content of the last screen) obtained from the previous long screenshot, the mobile phone can extract the content of the last paragraph or the last few paragraphs in the last picture as the starting point of the long screenshot for the next rolling screen translation.
[0183] The advantage of doing this is that the user's reading experience starts from the last picture (or the content of the last screen) of the previous translation or the last few paragraphs of the last picture (or the content of the last screen), which has a certain role in evoking the user's memory and assisting continuous reading.
[0184] See Figure 4 the GUI shown in (i) of Figure 4 When the mobile phone detects a click operation by the user on the screen, it can automatically display the GUI shown in (j) of
[0185] See Figure 4 the GUI shown in (j) of Figure 4 This GUI is another loading interface for the rolling screen translation. The mobile phone can translate the English on the long screenshot into the corresponding Chinese. When the translation is completed, the mobile phone can automatically display the GUI shown in (k) of
[0186] See Figure 4 the GUI shown in (k) of
[0187] From Figure 4 the (k) in Figure 4The process of the GUI change shown in (1) in [Figure] is the process for the user to view the translated text corresponding to the multi-screen content obtained from the second long screenshot. After the user finishes viewing, if they want to continue viewing the translated text corresponding to the remaining original text, they can click the scroll screen translation control 403, and the mobile phone can perform the third scroll screen translation. The process of the third scroll screen translation can refer to the process of the second scroll screen translation above. For the sake of brevity, it will not be elaborated here.
[0188] An embodiment of the present application provides a machine translation method. First, the mobile phone starts a long screenshot on the page currently displaying the first language (also known as the original text), automatically scrolls down, and stops the long screenshot when the mobile phone detects that the user can click on the screen. Secondly, the text data translated into the second language (also known as the translated text) is displayed on the new page, and the user can slide up and down to view it. Then, the user can directly select to continue viewing the following content on the translated text page (a scroll screen translation button is provided on this page for the user to click). After the user clicks the scroll screen translation button again, they will jump to the original text page and jump to the position where the long screenshot stopped last time on the original text (the mobile phone remembers this position). The mobile phone can start a long screenshot and translation again from the position where the long screenshot stopped last time (or several lines before this position, by retaining some redundancy of the content, so that the user can recall where they read last time), and repeat the above process until the end of the article. This method is not limited to translation based on a web browser client and can also be used in non-browser scenarios such as third-party information APPs, greatly expanding the applicable scenarios and at the same time ensuring the coherence of the user reading experience.
[0189] In the embodiment of the present application, when the user triggers an operation to translate the original text, the electronic device can display the entrances for full-screen translation and scroll screen translation, providing the user with multiple translation methods, facilitating the user's selection, and enhancing the user experience when the user translates the original text.
[0190] Above Figure 3 and Figure 4 In the two groups of GUIs shown above, it is the process of triggering a long screenshot after clicking the scroll screen translation control, and then translating one or more pictures obtained from the long screenshot. The following combines Figure 5 to introduce the process of first performing a long screenshot operation and then triggering the translation of the long screenshot picture on the processing interface of the obtained long screenshot picture.
[0191] Figure 5 Shows another group of GUIs provided by the embodiment of the present application.
[0192] See Figure 5 the GUI shown in (a) in [Figure]. This GUI is the display interface of the English short passage 303. When the mobile phone detects that the user draws an "S" on this interface with a knuckle, the mobile phone can start the long screenshot operation and automatically display as Figure 5 the GUI shown in (b) in [Figure].
[0193] See Figure 5 the GUI shown in (b) of Figure 5 which is a scrolling display interface for a long screenshot. As shown in (b) of Figure 5 it may include a reminder box 501 on the scrolling display interface of the long screenshot. The reminder box 501 may remind the user in text that "scrolling screenshot in progress.. click on the scrolling area to complete the screenshot". The mobile phone can automatically scroll the screen downwards. Exemplarily, from Figure 5 (b) to
[0194] See Figure 5 the GUI shown in (c) of Figure 5 which is another display interface for the scrolling of a long screenshot. When the mobile phone detects a click action by the user on the screen, the mobile phone can complete the long screenshot operation. The mobile phone can automatically display the GUI shown in (d) of
[0195] See Figure 5 the GUI shown in (d) of Figure 5 which is a processing interface for the picture obtained by long screenshot. The processing interface includes the processing methods for the picture obtained by long screenshot, where the processing methods include sharing, editing, deleting, and translating. The user can share the picture obtained by long screenshot with other users by clicking on share; the user can also edit the picture obtained by long screenshot by clicking on edit, for example, the picture can be edited such as brightness, exposure, and cropping, etc.; the user can also delete the picture obtained by long screenshot by clicking on delete. When the mobile phone detects the operation of the user clicking on the translation corresponding control 502, the mobile phone can display the GUI shown in (e) of
[0196] It should be understood that the difference from (d) of the above Figure 4 and Figure 4 (i) of Figure 4 is that in (d) of Figure 4 and (i) of Figure 5 translation is automatically performed after the scrolling screenshot (or long screenshot) ends, that is, when the mobile phone detects the user clicking on the scrolling translation control, it can automatically trigger two actions: scrolling screenshot (or long screenshot) and machine translation. While for (d) of
[0197] See Figure 5The GUI shown in (e) of [reference], which is the translation loading interface of the picture obtained by long screenshot. The mobile phone can translate the English on the picture obtained by long screenshot into the corresponding Chinese. When the translation is completed, the mobile phone can automatically display the GUI shown in (f) of Figure 5 of [reference].
[0198] See Figure 5 The GUI shown in (f) of [reference], which is the translation interface of the picture obtained by long screenshot. The mobile phone has translated the English short passage on the picture obtained by long screenshot into the corresponding Chinese. After the mobile phone detects the operation of the user swiping up or down on the screen, the mobile phone can scroll and display the translation content.
[0199] In one embodiment, if the user hopes to continue viewing the translation corresponding to the remaining content of the English short passage, the user can click on the scroll screen translation control 503 shown in (f) of Figure 5 of [reference], then the mobile phone can continue the process of scroll screen translation, and the process of scroll screen translation can refer to the above Figure 3 or Figure 4 of the GUI in [reference].
[0200] Figure 6 Shows another group of GUIs provided by the embodiments of the present application.
[0201] See Figure 6 The GUI shown in (a) of [reference], which is the display interface of the English short passage 303. When the mobile phone detects the pressing operation of the user on the word "family" on this interface, it can automatically display the GUI shown in (b) of Figure 6 of [reference].
[0202] See Figure 6 The GUI shown in (b) of [reference], which is another display interface of the English short passage 303. A reminder box 601 can automatically pop up on this display interface. Among them, the reminder box 601 includes copy, share, select all, web search, search, and control 602.
[0203] See Figure 6 The GUI shown in (c) of [reference], which is another display interface of the English short passage 303. After the mobile phone detects the operation of the user clicking on the control 602, a reminder box 603 can automatically pop up. Among them, the reminder box 603 includes scroll screen translation and full screen translation.
[0204] See Figure 6 The GUI shown in (d) of [reference], which is another display interface of the English short passage 303. After the mobile phone detects the operation of the user clicking on the scroll screen translation control 604, scroll screen translation can be performed, and the subsequent GUI display can refer to Figure 4 from (c) to (g) of [reference]. For the sake of brevity, it will not be elaborated here.
[0205] Figure 7 Another group of GUIs provided by the embodiments of the present application is shown.
[0206] Refer to Figure 7 the GUI shown in (a) in , which is the display interface of the English short passage 303. When the mobile phone detects a pressing operation by the user on the word "family" on this interface, it can automatically display a GUI as shown in Figure 7 (b) in .
[0207] Refer to Figure 7 the GUI shown in (b) in , which is another display interface of the English short passage 303. On this display interface, the mobile phone can automatically select the word "family" and automatically pop up a reminder box 701. Among them, the reminder box 701 includes functions such as copy, share, select all, web search, and search, etc. When the mobile phone detects that the user clicks and slides the cursor 701 to the right, the mobile phone can select more words and display a GUI as shown in Figure 7 (c) in .
[0208] Refer to Figure 7 the GUI shown in (c) in , which is another display interface of the English short passage 303. On this display interface, the mobile phone can automatically select multiple words "family was fast asleep" according to the user's sliding operation and automatically add a function option of scrolling screen translation in the reminder box 701.
[0209] Refer to Figure 7 the GUI shown in (d) in . After the mobile phone detects the operation of the user clicking on the scrolling screen translation control 702, it can perform scrolling screen translation. The subsequent GUI display can refer to Figure 4 (c) to (g) in . For the sake of brevity, it will not be elaborated here.
[0210] In the embodiments of the present application, in order to increase the prompt for the user, when the mobile phone performs the next scrolling screen translation (or, long screenshot translation), it can also add a prompt for the starting position of the screenshot and the position where the user last read on the GUI.
[0211] Figure 8 Another group of GUIs provided by the embodiments of the present application is shown.
[0212] Refer to Figure 8The GUI shown in (a) therein, which can be the translation interface for the first scrolling translation. The mobile phone has translated the English short passage on the picture obtained from the first long screenshot into the corresponding Chinese. When the mobile phone detects an upward or downward sliding operation of the user on the screen, the mobile phone can scroll and display the translation content. When the mobile phone detects an operation of the user clicking on the control 801 in this translation interface, it can display the GUI shown in Figure 8 as shown in (b) therein.
[0213] See Figure 8 the GUI shown in (b) therein, which can be the display interface for the second scrolling translation. Two reminder messages for the user can be included in this display interface. One reminder message is that before the paragraph "Fee said he immediately... rocks at it", the mobile phone can remind the user of "the starting position of this screenshot", and after this paragraph, remind the user of "the last position read here".
[0214] See Figure 8 the GUI shown in (c) therein, which is another display interface for the second scrolling screenshot. When the mobile phone detects a click operation of the user on the screen, the mobile phone can complete the second scrolling screenshot and display the GUI shown in Figure 8 as shown in (d) therein.
[0215] See Figure 8 the GUI shown in (d) therein, which is the translation loading interface for the second scrolling screenshot. The above reminder messages can also be displayed on this loading interface, so that before reading the translation of the second scrolling screenshot, the user can also view the starting point of this scrolling screenshot and the position of the original text read last time. The advantage of doing this is that before reading the translation of the second scrolling screenshot, the user can become familiar with the content of the original text in the second scrolling screenshot again, which has a certain role in memory recall and assisting continuous reading for the user.
[0216] See Figure 8 the GUI shown in (e) therein, which is the translation display interface for the second scrolling screenshot. The above reminder messages can also be displayed on this translation display interface.
[0217] In one embodiment, the mobile phone can display only one of the above two reminder messages.
[0218] Exemplarily, in Figure 8 (b), (d) and (e) therein, only the reminder message "the last position read here" can be displayed.
[0219] Exemplarily, in Figure 8 (b), (d) and (e) therein, only the reminder message "the starting position of this screenshot" can be displayed.
[0220] Figure 9 Another set of GUIs provided by the embodiments of the present application is shown.
[0221] Refer to Figure 9 the GUI shown in (a) therein. This GUI can be the translation interface for the first scroll screen translation. When the mobile phone detects an operation of the user clicking on the control 901 in this translation interface, it can display the GUI as shown in Figure 9 (b) therein.
[0222] Refer to Figure 9 the GUI shown in (b) therein. This GUI can be the display interface for the second scroll screen translation. Compared with Figure 4 (h) therein, the second scroll screen capture does not contain any content from the previous scroll screen capture. That is to say, the second scroll screen capture can not contain any redundant original text content.
[0223] Refer to Figure 9 the GUI shown in (c) therein. This GUI is another display interface for the second scroll screen capture. When the mobile phone detects an operation of the user clicking on the screen, the mobile phone can complete the second scroll screen capture and display the GUI as shown in Figure 9 (d) therein.
[0224] Refer to Figure 9 the GUI shown in (d) therein. This GUI is the translation loading interface for the second scroll screen capture.
[0225] Refer to Figure 9 the GUI shown in (e) therein. This GUI is the translation display interface for the second scroll screen capture. The translated content displayed on this translation display interface also does not contain the translated content of the first scroll screen capture.
[0226] From Figure 9 (e) to Figure 9 (f) therein is the process of the mobile phone scrolling and displaying the translated content. When the mobile phone detects an operation of the user swiping up or down, the mobile phone can scroll and display the translated content.
[0227] The above Figures 3 to 9In the GUI shown, when the next scrolling translation is performed after the first full-screen translation is completed, the electronic device needs to switch back to the display interface of the original text for scrolling translation, and then switch back to the translation interface, so that the user can view the desired translation content. In the embodiments of the present application, after the electronic device performs a full-screen translation or a scrolling translation, if it detects an operation of the user clicking on the control for scrolling translation, it can also not switch back to the original text interface, but can directly load the remaining original text in the background, take a scrolling screenshot of the remaining original text, and obtain a part or all of the translation of the remaining original text. The user can continue to read the subsequent translation in the translation interface without having to jump between multiple interfaces, improving the user's reading continuity experience.
[0228] Figure 10 Another set of GUIs provided by the embodiments of the present application is shown.
[0229] See Figure 10 the GUI shown in (a) in, which is the translation display interface after the user performs the first scrolling translation for the first time. The user can view the translation content of the first scrolling translation by swiping up with a finger.
[0230] Exemplarily, Figure 10 (a) in can be the GUI obtained according to (a) to Figure 4 (f) in the above Figure 4 (f) in.
[0231] See Figure 10 the GUI shown in (b) in, which is the translation display interface after the user performs the first scrolling translation for the first time. It can be seen that the ending paragraph of the first scrolling translation is "Needless to say... throw stones at him." When the mobile phone detects the operation of the user clicking on the control 1001, the mobile phone can display as shown in Figure 10 the GUI shown in (c) in.
[0232] See Figure 10 (c) to Figure 10 (c) in the GUI shown in (c) in, which is another translation display interface. When the mobile phone detects the operation of the user clicking on the control 1001, the mobile phone can automatically load the translation corresponding to the remaining original text in the background and display it to the user.
[0233] It should be understood that when the user clicks on the control 1001, the mobile phone can translate all the remaining original text and present the translation corresponding to all the remaining original text to the user. When displaying all the remaining translation content to the user, the continue translation control 1001 and the copy translation control may not be displayed on the translation display interface.
[0234] In one embodiment, after the user clicks on control 1001 on the mobile phone, the mobile phone can also prompt the user to select a percentage of the remaining original text to be translated. For example, the mobile phone can prompt the user to select 20%, 40%, 60%, 80%, or 100% of the remaining original text. When the mobile phone detects that the user clicks on a certain percentage, the mobile phone can take a screenshot of the remaining original text according to that percentage, and then obtain the translation of the content corresponding to the screenshot to present to the user.
[0235] In one embodiment, after the user clicks on control 1001 on the mobile phone, the mobile phone can automatically capture one or more screens of the remaining original text, and then obtain the translation of the content corresponding to the screenshot to present to the user. For example, it can be defaulted that when the user clicks on control 1001 once, the mobile phone automatically captures two screens of the remaining original text.
[0236] In one embodiment, the user can click on the control for continuing translation on the translation interface obtained after the first full-screen translation, and then the mobile phone can automatically present the translation of all the remaining original text to the user. Specifically, in this case, after the user clicks on the control for continuing translation, the mobile phone can automatically perform a scrolling screenshot of the remaining original text. The content captured can include all of the remaining original text, and this scrolling screenshot process can be visible or invisible to the user. Exemplarily, as shown in (f) of Figure 3 , after the user clicks on control 306 (which can be referred to as "scroll screen translation" or "continue translation"), instead of switching to the interface shown in (g) of Figure 3 to perform a scrolling screenshot, it can directly display the translation interface shown in (k) to Figure 3 (m) of Figure 3 . On the GUI shown in (k) to Figure 3 (m) of Figure 3 , the scrolling screenshot control and the copy translation control can also not be displayed.
[0237] In the above Figure 10 GUI shown in (a) to (e), if the user wants to view more translations, then after the mobile phone detects that the user clicks on the continue translation control, the electronic device can take a screenshot (which can be a full-screen screenshot or a long screenshot) in the background and then automatically obtain the translation results of more original text and present them to the user, avoiding the need to jump back and forth between the original text and the translation, which can further enhance the user experience when the user views the translation.
[0238] The above introduced the GUI of the machine translation process provided by the embodiments of the present application in combination with the Figures 3 to 10 GUI. Next, another machine translation method provided by the embodiments of the present application will be introduced in combination with Figure 11 .
[0239] Figure 11The figure shows a schematic flowchart of the machine translation method 1100 provided by an embodiment of the present application. As Figure 11 described, the execution subject of the method 1100 can be a mobile phone. The method includes:
[0240] S1101, when the mobile phone detects an operation of pressing with both hands on the original text display interface, it starts the intelligent screen recognition.
[0241] Exemplarily, as shown in (a) of Figure 4 , after the mobile phone detects an operation of pressing with two fingers on the display interface of an English short passage, it starts the intelligent screen recognition. Among them, the intelligent screen recognition may include a full-screen translation function option and a scrolling translation function option (the function option can also be called a control).
[0242] S1102, when the mobile phone detects that the user clicks the scrolling translation operation, the mobile phone starts to automatically scroll the screen.
[0243] Exemplarily, as shown in (b) of Figure 4 , when the mobile phone detects that the user clicks the operation of control 401, the mobile phone can start the scrolling translation.
[0244] When the user presses the screen with two fingers while reading the original text, an entrance for scrolling translation will appear. After clicking, the long screenshot operation is started, and the screen content automatically slides up at a certain rate and rhythm. The user can be prompted above to click to stop the screenshot, or the screenshot will automatically stop when reaching the end of the article.
[0245] Exemplarily, as shown in (c) to Figure 4 (d) of Figure 4 is the process of the mobile phone automatically scrolling the screen.
[0246] S1103, when the mobile phone detects that the user clicks a certain position on the screen, or when the mobile phone detects that the original text automatically slides to the bottom of the page, the mobile phone can stop the scrolling screenshot.
[0247] Exemplarily, as shown in (d) of Figure 4 , when the mobile phone detects that the user clicks a certain position on the screen, the mobile phone can stop the scrolling screenshot.
[0248] S1104, obtain the long picture obtained by the long screenshot.
[0249] S1105, crop the long picture obtained by the long screenshot to obtain multiple small pictures with a height less than or equal to a preset height. Each cropped small picture can be sent to the cloud for translation.
[0250] In one embodiment, the preset height is the height of the mobile phone screen.
[0251] In one embodiment, the preset height is a preset value less than the height of the mobile phone screen.
[0252] Exemplarily, the mobile phone can split the long picture generated by the long screenshot according to the relationship between the picture height and the mobile phone screen height, and use OCR at the split position to determine whether the text or picture will be truncated. If it is found that the text or picture will be truncated at the split position, the split position is moved up to the blank line position to obtain several pictures with a height slightly less than or equal to the screen height.
[0253] During the splitting process, the generated multiple small pictures can be numbered in the original text order, and each generated small picture is sent to the translation cloud for translation.
[0254] It should be understood that when the mobile phone splits the long picture into multiple small pictures, each small picture can be numbered in the original text order, or, it can also be understood that the mobile phone adds tag information to each small picture and sends these small pictures to the translation cloud for translation.
[0255] S1106, the mobile phone obtains the translation result of each small picture from the cloud.
[0256] S1107, the mobile phone determines whether each small picture is translated successfully.
[0257] It should be understood that when the mobile phone determines whether each small picture is translated successfully, it can be judged according to the success or failure flag bit saved by the interface of each small picture translation.
[0258] S1108, if the received small picture is translated successfully, then the mobile phone renders and saves the translation result corresponding to the small picture.
[0259] S1109, if the received small picture is translated failed, then the mobile phone saves the original text corresponding to the small picture as the translation result.
[0260] S1110, the mobile phone determines whether it has received the translation results of all small pictures.
[0261] S1111, if the mobile phone has received the translation results of all small pictures, then the mobile phone can continue to determine whether the number of pictures translated successfully among all small pictures is less than a preset threshold.
[0262] If the mobile phone has not received the translation results of all small pictures, then the mobile phone can continue to execute S1106.
[0263] S1112, if the mobile phone determines that the number of pictures translated successfully among all small pictures is less than a preset threshold, then the mobile phone can use a list view to display all the translation results.
[0264] S1113. If the mobile phone determines that the number of successfully translated pictures among all small pictures is greater than or equal to a preset threshold, the mobile phone can prompt the user that the translation has failed and prompt the user whether to re - translate.
[0265] In one embodiment, after the mobile phone receives the translation result returned by the cloud, it determines whether the returned result is successfully translated. If it is successful, the translation result is rendered and saved; if it fails, the original text is saved as the translation result. When the mobile phone receives the translation results of all small pictures, it calculates whether the proportion of pages with translation failures exceeds a set threshold (for example, the proportion of the total number of failed pages is greater than or equal to 60%). If so, it prompts the user to retry (this situation has a relatively low probability); if it is successful, it sorts and displays according to the page coding order or label (i.e., the original text order) returned, and the displayed content of the translation starts from the first small picture in the long picture.
[0266] Exemplarily, the mobile phone slices the long picture obtained from the long screenshot into 10 small pictures, numbers each small picture in order and sends them to the cloud. The mobile phone obtains the translation results of the 10 small pictures from the cloud. Among them, 8 small pictures are successfully translated and 2 small pictures are translated failed. Then the mobile phone can also determine that this scrolling translation is successful. When the mobile phone displays the translation results, it can splice the translation results of these 10 small pictures according to the numbers. Among them, the original text can be displayed at the positions of the 2 small pictures with translation failures, and the corresponding translations can be displayed at the positions of the other 8 successfully translated small pictures.
[0267] It should be understood that when the mobile phone sends multiple small pictures to the cloud in S1106, it can send them to the cloud in order, but when obtaining the translation results of multiple small pictures from the cloud, it may not obtain the translation results of each small picture in the same order as the sending order. Since the content of each small picture is different, the time taken by the cloud for translation processing of each small picture is also different. Therefore, the mobile phone may not receive the translation results of each small picture in the order of sending. Since each small picture is numbered or tagged, the mobile phone can splice the translation results of multiple small pictures according to the numbers or tags when receiving the translation results of multiple small pictures.
[0268] S1114. When the mobile phone detects that the user indicates re - translation, it can re - execute the translation process from S1106.
[0269] S1115. The mobile phone determines whether the user continues the long - screenshot operation.
[0270] When the mobile phone detects that the user continues to click the scrolling translation operation on the translation result interface, it can execute S1105 - S1114 again.
[0271] It should be understood that when the mobile phone executes S1102 - S1114 again, it can automatically jump to the last small picture of the long picture obtained in the previous long screenshot to start the next scrolling translation, or it can automatically jump to the last small picture of the long picture obtained in the previous long screenshot and start a long screenshot from the last paragraph or the last few paragraphs of the last small picture.
[0272] After reading the translation content of the first long screenshot, the user can choose to continue reading the following content, that is, continue to use the scrolling translation function; or return from the translation result page to exit. If returning to exit, it will return to the original content of the last small picture where the previous long screenshot stopped, or the position of the last paragraph or the last few paragraphs of the last small picture; if continuing to use the scrolling translation (that is, the user wants to continue reading the subsequent content), the original content of the last small picture where the previous long screenshot stopped will be displayed, or the original content of the last paragraph or the last few paragraphs in the last small picture where the previous long screenshot stopped will be displayed, and at the same time, a new long screenshot operation will be started to enter a new round of loop until the end of the article.
[0273] In one embodiment, if continuing to read the subsequent content from the translation result page of the current long screenshot, it is necessary to return to the original content of the last small picture when the current long screenshot stopped, and start the next scrolling translation operation from the content of this small picture. The advantage of doing this is that the user's reading experience starts from the last page of the previous translation, which has a certain effect of evoking memory and assisting continuous reading. If the current long screenshot stops because it has scrolled to the end of the article, then on the translation result page, the scrolling translation entry that can be clicked continuously will be hidden.
[0274] S1116, when the mobile phone detects that the user exits the translation result interface of the long screenshot, the mobile phone can display the last small picture of the long picture obtained in the previous long screenshot.
[0275] In one embodiment, the mobile phone can also start to display from the last paragraph or the last few paragraphs of the last small picture of the long picture obtained in the previous long screenshot.
[0276] The machine translation method in the embodiments of the present application has a wider application range compared to the web page translation based on the browser. It is not limited to the user having to use the browser to view news. Especially when used on a mobile phone, many users view third-party information apps such as NetEase News, Toutiao, etc. The web page full-text translation method based on the browser cannot be used in the scenario of third-party apps, while the machine translation method provided in this embodiment can be applied.
[0277] Similarly, the translation based on a single picture is cumbersome to use. When viewing the translated content of multiple screens, the user needs to click the translation button once for each screen, which is cumbersome and time-consuming, and will interrupt the user's reading continuity. However, for the machine translation method provided in this embodiment, the user only needs to click the translation button once, and then trigger the scrolling translation on the previous translation result page to read the translations of the subsequent content.
[0278] The machine translation method in the embodiments of the present application can reduce the cumbersome operations of the user when viewing the translation corresponding to the original text, improve the intelligence level of the electronic device, and help to enhance the user experience of the user during the process of viewing the translation.
[0279] Combined with the above embodiments and related drawings, the embodiments of the present application provide a machine translation method, which can be implemented in an electronic device with a touch screen (such as a mobile phone, a tablet computer, etc.) as shown in Figure 1 , Figure 2 . As shown in Figure 12 , the method may include the following steps:
[0280] S1201, the electronic device displays a first user interface on the touch screen, the first user interface includes first content, and the language of the first content is a first language.
[0281] Exemplarily, the first user interface may be the GUI shown in (a) in Figure 4 .
[0282] S1202, the electronic device detects a first operation on the first user interface, and the first operation includes a user operation for triggering scrolling translation.
[0283] Exemplarily, as shown in the GUI in (b) in Figure 4 , the first operation may be the operation of the user clicking on the control 401; alternatively, the first operation may also be the voice command input by the user for triggering the scrolling translation function.
[0284] S1203, in response to the first operation, the electronic device starts scrolling and taking screenshots from a first position of the first user interface.
[0285] Exemplarily, as shown in the GUI in (c) in Figure 4 , the first position may be the starting position of the English short passage 303. For example, start scrolling and taking screenshots from the title "A family... were sleeping".
[0286] S1204. During the process of scrolling screenshot, when a second operation of the user is detected on the second user interface, or when the second user interface scrolls to the end position, stop scrolling the screenshot at the second position on the second user interface. The electronic device obtains a first picture, which is a picture corresponding to the second content. The second content includes the content from the first position to the second position, and the language of the second content is the first language.
[0287] Exemplarily, as Figure 4 shown in (d) of [reference], the content displayed on the second user interface is from "I don’t think... she wrote" to "Fee said... rocks at it." When the user operates on the mobile phone at any position on the second user interface, the mobile phone can stop scrolling the screenshot at the end position of the last paragraph on the second user interface. As Figure 4 shown in (d) of [reference], the second position can be the end position of the paragraph "Fee said... rocks at it."
[0288] In one embodiment, when the end position of the second user interface is not a complete paragraph, the second position can also be the end position of the last line of the paragraph displayed on the second user interface.
[0289] In one embodiment, if the end position of the second user interface is a picture or a part of a picture, the second position can be the end position of the paragraph above the picture or the part of the picture.
[0290] S1205. The electronic device automatically obtains the translation result of the second content according to the first picture, and the language of the translation result of the second content is the second language.
[0291] Exemplarily, after the mobile phone obtains the first picture, it can process the first picture according to the method in the above method 1100. For example, the mobile phone can make a cut according to the relationship between the height of the first picture and the height of the mobile phone screen, cut the first picture into multiple pictures, and then send them to the server for translation; the mobile phone can receive the translation result of each picture in the multiple pictures sent by the server, and form the translation result of the second content by the translation results of each picture.
[0292] Exemplarily, the translation result of the second content can be from the translated title "A family of four... attacked them" to the translation of the last paragraph before the second position "Fee said that he immediately regretted... threw stones at him."
[0293] S1206. After automatically obtaining part or all of the translation result of the second content, the electronic device automatically displays a third user interface, which includes part or all of the translation result of the second content.
[0294] In the embodiments of the present application, the translation result of the second content obtained by the mobile phone may be all the translation results of the second content, that is, the mobile phone obtains the translation results of multiple pictures, and the translation result of each picture is successful; or, it may also be part of the translation result of the second content. For example, after receiving multiple pictures, the server may not successfully translate a certain picture. Then, the mobile phone can also display a part of the successfully translated text, and for that picture that has not been successfully translated, the mobile phone can form the translation result of the second content by combining the corresponding original text on that picture and the translation content corresponding to other pictures.
[0295] Exemplarily, the third user interface may be the GUI shown in (f) of Figure 4 . Part of the second content may be displayed on this GUI. For example, it displays "A family of four... attacked them" to "The Canadian national park... bit into Matthew's arms of them".
[0296] After the electronic device detects an upward sliding operation by the user on the third user interface, it can display the remaining part of the translation result of the second content. As shown in (g) of Figure 4 , after the mobile phone detects an upward sliding operation by the user on the touch screen, it can display the remaining translation result (from "She wrote... this fear" to "Fei said... threw stones at him.").
[0297] In one embodiment, the method 1200 further includes:
[0298] The electronic device detects a third operation on a fourth user interface, which includes the ending part of the translation result of the second content, and the third operation includes a user operation triggered by the user to perform scroll translation.
[0299] Exemplarily, the fourth user interface may be the GUI shown in (g) of Figure 4 . The ending part of the translation result of the second content is included on this GUI, and the ending part may be "Fei said that he immediately regretted... threw stones at him.". The third operation may be an operation where the user clicks on the scroll translation control 403.
[0300] In response to the third operation, the electronic device automatically displays a fifth user interface and starts scrolling and taking screenshots from the third position of the fifth user interface. The fifth user interface includes third content, the third position is associated with the second position, and the language of the third content is the first language.
[0301] Exemplarily, the fifth user interface may be the GUI shown in (h) of Figure 4 , and the third content may be the English content from "Fee said... rocks at it" to "It could... she wrote." The GUI shows that the mobile phone starts scrolling and taking screenshots from the paragraph "Fee said... rocks at it."
[0302] During the process of scrolling and taking screenshots, when a fourth operation of the user is detected on the sixth user interface, or when scrolling reaches the end position, the scrolling and taking screenshots stop at the fourth position on the sixth user interface, and the electronic device obtains a second picture, which is a picture corresponding to the fourth content. The fourth content includes the content from the third position to the fourth position, and the language of the fourth content is the first language.
[0303] Exemplarily, the sixth user interface may be the GUI shown in (i) of Figure 4 . When the mobile phone detects any operation of the user on this GUI, the mobile phone can stop scrolling and taking screenshots. The fourth position may be the end position "Incidents like these... and one in Ontario." of the last paragraph in the GUI shown in (i) of Figure 4 . Then the fourth content included in the second picture may be the English content from "Fee said... rocks at it" to "Incidents like these... and one in Ontario."
[0304] The electronic device automatically obtains the translation result of the fourth content according to the second picture, and the language of the translation result of the fourth content is the second language.
[0305] Exemplarily, the electronic device may cut the second picture into multiple pictures and send them to the server for translation; and obtain the translation results of the multiple pictures from the server. The electronic device may compose the translation results of the multiple pictures into the translation result of the fourth content.
[0306] After automatically obtaining part or all of the translation result of the fourth content, the electronic device automatically displays a seventh user interface, which includes part or all of the translation result of the fourth content.
[0307] Exemplarily, the seventh user interface may be the GUI shown in (k) of Figure 4 , and a part of the translation result of the fourth content is included on this GUI. For example, the translation result shown on this GUI is from "Fee said... threw rocks at him" to "She wrote... sitting here."
[0308] After the electronic device detects an upward sliding operation of the user on the seventh user interface, the remaining part of the translation result of the fourth content can be displayed. As Figure 4 shown in (1) of , after the mobile phone detects an upward sliding operation of the user on the touch screen, the remaining translation result (from "Elisa Rispoli has no... request" to "such a time... in British Columbia") can be displayed.
[0309] In one embodiment, the method 1200 further includes:
[0310] The electronic device detects a fifth operation on the eighth user interface, and the eighth user interface includes an ending part of the translation result of the second content. The fifth operation includes a user operation triggered by the user to continue translation.
[0311] Exemplarily, the eighth user interface can be the GUI shown in (b) of . The GUI can be obtained through full-screen translation or through scrolling translation. The GUI can include an ending part of the translation result of the second content, and the ending part can be "Needless to say, he immediately regretted... throwing stones at him." The fifth operation can be an operation where the user clicks the continue translation control 1001. Figure 10 In response to the fifth operation, the electronic device automatically obtains the translation result of the fifth content. The fifth content includes a part or all of the other content except the second content in all the content corresponding to the first language. The language of the translation result of the fifth content is the second language.
[0312] Exemplarily, when the mobile phone detects an operation where the user clicks the control 1001, the mobile phone can obtain the translation result of the original text content except the original text from "A family... were sleeping" to "Fee said... rocks at it." That is, the mobile phone can automatically obtain the translation result from "Meanwhile... to safety" to the ending position of the English short passage 303 "2019 Cable... All rights Reserved."
[0313]
[0314] Exemplarily, after the mobile phone detects the operation of the user clicking on the control 1001, a third picture can be obtained. The content from "Meanwhile... to safety" to the end position of the English short text 303, "2019 Cable... All rights Reserved.", is included in the third picture. The mobile phone can split the third picture into multiple pictures, and then send the multiple pictures to the server for translation and obtain the translation results of each picture sent by the server. The mobile phone can combine the translation results of the multiple pictures into the translation result of the fifth content.
[0315] Exemplarily, the fifth content may also include a part of other content other than the second content. For example, after the electronic device detects the operation of the user clicking on the control 1001, it can split the other content other than the second content into multiple parts, and the second content can be the content of the first part among the multiple parts.
[0316] Exemplarily, the fifth content may also include a part of the content that has been read before.
[0317] After automatically obtaining a part or all of the translation result of the fifth content, the electronic device automatically displays the ninth user interface or displays the ninth user interface after receiving the user's sliding operation. A part or all of the translation result of the fifth content is included on the ninth user interface.
[0318] Exemplarily, as Figure 10 shown in (c) of, the GUI includes a part of the translation result of the fifth content, such as from "Meanwhile... escape to a safe place" to "Rispolis... in his hand".
[0319] In one embodiment, the method 1200 further includes: in response to the fifth operation, the electronic device automatically takes a screenshot to obtain a third picture, and the third picture includes the fifth content.
[0320] Exemplarily, the electronic device can obtain the third picture by taking a screenshot or a scrolling screenshot.
[0321] After the electronic device obtains the third picture, it can send the third picture or the picture corresponding to a part of the third picture to the server; the electronic device receives the translation result corresponding to the third picture or the picture corresponding to a part of the third picture returned by the server.
[0322] In one embodiment, the electronic device automatically taking a screenshot to obtain a third picture can be that the electronic device captures the content of one screen or multiple screens to obtain the third picture, and the process of the automatic screenshot is visible or invisible to the user.
[0323] Exemplarily, as Figure 10in (b) to Figure 10 during the process of (c), the process of automatically taking screenshots is invisible to the user; for another example, Figure 4 in (g) to Figure 4 during the process of (k), the process of automatically taking screenshots is visible to the user.
[0324] In one embodiment, after automatically obtaining the translation result of the fifth content, the electronic device can continue to display the third user interface. However, when the user swipes up on the touch screen, the mobile phone can display a part or all of the translation result of the fifth content.
[0325] In one embodiment, before automatically obtaining the translation result of the second content, the method further includes: the electronic device automatically divides the first picture into multiple pictures; wherein, the third position is related to a specific position in the last picture of the multiple pictures, and the specific position is: the starting position or the ending position or the middle position or the position at a predetermined ratio of the last picture; or, the starting position of the last paragraph or the starting position of the last n lines in the last picture, where n is a positive integer and n is greater than or equal to 1.
[0326] Exemplarily, the first picture includes the original text from "A family...were sleeping" to "Fee said...rocks at it.", and the mobile phone can divide the first picture into multiple pictures. For example, after division, two pictures are obtained. The first picture includes the original text from "A family...were sleeping" to "The family was...clamped onto Matthew’s arms."; the second picture includes the original text from "I don’t...she wrote" to "Fee said...rocks at it.".
[0327] For example, the third position can be the starting position of the second picture, then Figure 4 the starting position of the scrolling screenshot shown in (h) can be "I don’t...she wrote".
[0328] For another example, the third position can be the middle position of the second picture, such as from "The wolf was...jumped into help.", then Figure 4 the starting position of the scrolling screenshot shown in (h) can be "The wolf was...jumped into help.".
[0329] For another example, the third position can be a position at a predetermined ratio. Exemplarily, it can be the two-thirds position of the second picture, such as starting a scrolling screenshot from the line "[the wolf]...in the back". Then Figure 4 the starting position of the scrolling screenshot shown in (h) of
[0330] can be "[the wolf]...in the back". Figure 4 The third position can also be the starting position of the last paragraph of the second picture. As shown in (h) of
[0331] it can start a scrolling screenshot from the last paragraph "Fee said...rocks at it." of the second picture.
[0332] In one embodiment, automatically obtaining the translation result of the second content includes: the electronic device sending the multiple pictures to the server; the electronic device receiving the translation result of each picture in the multiple pictures from the server; the electronic device forming a part of the translation result of the second content with the translation results of some of the multiple pictures, or forming the translation result of the second content with the translation results of all of the multiple pictures.
[0333] It should be understood that the process of the electronic device splitting the first picture and the second picture into multiple pictures, and the process of sending the multiple pictures to the server for translation and obtaining the translation result can refer to the description in the above method 1100. For the sake of brevity, it will not be elaborated here.
[0334] In one embodiment, the third position being associated with the first picture includes: the third position being related to a specific position in the first picture, the specific position being the end position or the middle position or a position at a predetermined ratio of the first picture; or, the starting position of the last paragraph or the starting position of the last n lines in the first picture, where n is a positive integer and n is greater than or equal to 1.
[0335] In one embodiment, the third position is related to the end position or the middle position or a position at a predetermined ratio of the second content; or, the third position is related to the starting position of the last paragraph or the starting position of the last n lines in the second content, where n is a positive integer and n is greater than or equal to 1.
[0336] In the embodiments of the present application, the electronic device may split the first picture into multiple pictures, and the third position may be related to the last picture of the multiple pictures or the last few pictures of the multiple pictures; alternatively, the electronic device may not split the first picture, and the third position may be related to a specific position of the first picture, or the third position may also be related to the second content displayed on the first picture.
[0337] In the embodiments of the present application, the electronic device jumps to the vicinity of the position where the long screenshot stopped last time (the electronic device has remembered this position), and the electronic device can start the scrolling screenshot again from the vicinity of the position where the long screenshot stopped last time (this position is associated with the first picture, and by retaining some redundant content, the user can recall where they last read) and send it to the server for translation. This method is not limited to web browser client translation, but can also be used in non-browser scenarios such as third-party information APPs, greatly expanding the applicable scenarios, and at the same time ensuring the coherence of the user reading experience.
[0338] In one embodiment, automatically obtaining the translation result of the second content includes: the electronic device sending the first picture or a picture corresponding to a part of the first picture to the server; the electronic device receiving the translation result of the first picture or the picture corresponding to a part of the first picture returned by the server.
[0339] Exemplarily, after obtaining the first picture, the electronic device may directly send the first picture to the server for translation without splitting; or, after the electronic device sends the first picture to the server, the server splits it into multiple pictures, translates the multiple pictures, and returns the translation result of each picture to the electronic device.
[0340] Exemplarily, the electronic device may also split the first picture into multiple pictures after obtaining the first picture, and send the first picture or the first few pictures of the multiple pictures to the server for translation; then obtain the translation result of the first picture or the first few pictures returned by the server.
[0341] In one embodiment, the translation result of the above second content includes the content obtained by translating the text content obtained after performing optical character recognition (OCR) on the first picture from the first language to the second language.
[0342] In one embodiment, the method further includes: displaying a first prompt message at or near the third position, the first prompt message being used to prompt the user of the starting position of the scrolling screenshot; and / or, displaying a second prompt message at or near the second position, the second prompt message being used to prompt the user that they last read up to the second position.
[0343] Exemplarily, such as Figure 8 For the GUI shown in (b) of [], a first prompt message may be included at the start position of "Fee said...rocks at it.", and the first prompt message may be "Start position of this screenshot". A second prompt message may be included at the end position of "Fee said...rocks at it.", and the second prompt message may be "Last read position".
[0344] In one embodiment, the first operation includes the user clicking a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0345] Exemplarily, the first operation may be the operation of the user clicking on control 401, or the first operation may also be the voice command "Scrolling translation" input by the user.
[0346] In one embodiment, the third operation includes the user clicking a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0347] Exemplarily, the third operation may be the operation of the user clicking on control 403, or the first operation may also be the voice command "Scrolling translation" input by the user.
[0348] In one embodiment, the method further includes: after receiving a sliding operation of the user on the third user interface, displaying a tenth user interface, and the tenth user interface includes subsequent translation results associated with the translation results included on the third user interface.
[0349] Exemplarily, such as Figure 10 As shown in (d) and (e) of [], when the mobile phone detects an upward sliding operation of the user, the mobile phone may display subsequent translation results.
[0350] In one embodiment, before detecting the third operation, the method further includes: displaying a control on the fourth user interface that can trigger scrolling translation.
[0351] Exemplarily, such as Figure 4 As shown in (g) of [], the mobile phone may display the control 403 through the display screen.
[0352] In one embodiment, before detecting the fifth operation, the method further includes: displaying a control on the eighth user interface that can trigger continued translation.
[0353] Exemplarily, such as Figure 10 As shown in (b) of [], the mobile phone may display the control 1001 through the display screen.
[0354] In one embodiment, detecting a first operation on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, the electronic device displays a plurality of function controls, and the plurality of function controls include a first control that can trigger scrolling translation; the electronic device detects that the user clicks the first control or the user inputs a voice command that can trigger the scrolling translation function.
[0355] Exemplarily, as Figure 4 In the GUI shown in (a) of [], after the mobile phone detects the operation of the user pressing with two fingers, it can display the GUI as shown in Figure 4 In (b) of [], and a plurality of function controls can be displayed on the GUI, and the plurality of function controls include control 401.
[0356] In one embodiment, the second content includes a part or all of the other content except the first content in all the content corresponding to the first content and the first language.
[0357] In one embodiment, the third content includes a part of the other content except the second content in all the content corresponding to the first language, and the fourth content includes a part or all of the other content except the second content in all the content corresponding to the first language.
[0358] In one embodiment, the third content may also include a part or all of the second content; the fourth content may also include a part or all of the second content.
[0359] In one embodiment, the method further includes: after receiving a sliding operation of the user on the ninth user interface, displaying an eleventh user interface, and the eleventh user interface includes subsequent translation results associated with the translation results included on the ninth user interface.
[0360] Exemplarily, as Figure 4 In the GUI shown in (k) of [], when the mobile phone detects the sliding operation of the user, subsequent translation results can be displayed.
[0361] Figure 13 shows a schematic flowchart of a machine translation method 1300 provided by an embodiment of the present application. As Figure 13 shown, the method 1300 includes:
[0362] S1301, the electronic device displays a first user interface on the touch screen, and the first user interface includes first content, and the language of the first content is a first language.
[0363] Exemplarily, the first user interface may be as Figure 3The GUI shown in (c), which includes the English content from the title "A family... were sleeping" to "The family was... clamped onto Matthew’s arms".
[0364] S1302, the electronic device detects a first operation of the user on the first user interface, and the first operation includes a user operation for triggering full-screen translation.
[0365] Exemplarily, refer to Figure 3 The GUI shown in (d). The first operation can be the operation of the user clicking on control 305. After the mobile phone detects the operation of the user clicking on control 305, it can first trigger the mobile phone to perform a screenshot operation.
[0366] S1303, in response to the first operation, the electronic device takes a screenshot of the first user interface to obtain a first picture.
[0367] Exemplarily, refer to Figure 3 The GUI shown in (d). The first picture can be obtained by the mobile phone taking a screenshot of the original text content displayed on the current screen, and the first picture shows the English content from the title "A family... were sleeping" to "The family was... clamped onto Matthew’s arms".
[0368] S1304, based on the first picture, the electronic device automatically obtains the translation result of the first content, and the language of the translation result of the first content is the second language.
[0369] Exemplarily, the electronic device can send the first picture to the server and receive the translation result of the first picture returned by the server.
[0370] The translation result of the above first content includes the content obtained after the text content obtained by performing optical character recognition (OCR) on the first picture is translated from the first language to the second language.
[0371] S1305, after automatically obtaining the translation result of the first content, the electronic device automatically displays a second user interface, and the second user interface includes a part or all of the translation result of the first content.
[0372] Exemplarily, the second user interface can be as Figure 3The GUI shown in (f) includes the translation result of the first content. The translation result of the first content is from the title "A family of four...attacked them" to "Canadian National Park...bite their Matthew's arms".
[0373] S1306: The electronic device detects a second operation of the user on the second user interface, where the second operation includes a user operation of triggering scrolling translation.
[0374] Exemplarily, the second user interface may include a control 306, and the second operation may be an operation of the user clicking the control 306. When the mobile phone detects the operation of the user clicking the control 306, the mobile phone may perform a scrolling translation operation.
[0375] S1307, in response to the second operation, the electronic device automatically displays a third user interface and starts scrolling screenshots from a first position of the third user interface, the third user interface includes second content, the first position is associated with the first picture, and the language of the second content is the first language.
[0376] For example, a mobile phone is Figure 3 After detecting the user clicking the control 306 on the GUI shown in (f) in FIG. 1 , the following may be automatically displayed: Figure 3 GUI shown in (g). Figure 3 The GUI shown in (g) is a display interface of scrolling screenshots, and the first position may be the starting position of the title “A family...were sleeping”.
[0377] S1308, during the scrolling screenshot process, when a third operation of the user is detected on the fourth user interface, or when the fourth user interface is scrolled to the end position, the scrolling screenshot is stopped at the second position of the fourth interface, and the electronic device obtains a second picture, which is a picture corresponding to the third content, and the third content includes content from the first position to the second position, and the language of the third content is the first language.
[0378] For example, Figure 3 (g) to Figure 3 As shown in (i), when scrolling to the end position, the electronic device can automatically stop scrolling and taking screenshots, and the second position can be the end position of "2019 Cable News...rights Reserved." When the electronic device stops scrolling and taking screenshots, a second picture can be obtained, and the second picture can display the original content from the starting position of the title "A family...were sleeping" to the end position of "2019 Cable News...rights Reserved."
[0379] S1309. The electronic device automatically obtains the translation result of the third content according to the second picture, and the language of the translation result of the third content is the second language.
[0380] Exemplarily, after obtaining the second picture by scrolling screenshot, the electronic device can continue to obtain the translation result of the third content on the second picture. For example, the electronic device can split the second picture into multiple pictures and send the multiple pictures to the server for translation; the electronic device receives the translation results of the multiple pictures returned by the server, and the translation results of the multiple pictures constitute the translation result of the third content.
[0381] S1310. After the electronic device automatically obtains a part or all of the translation result of the third content, it automatically displays a fifth user interface, and the fifth user interface includes a part or all of the translation result of the third content.
[0382] Exemplarily, the fifth user interface can be as shown in Figure 3 (k) shown in, Figure 3 (k) shown in the GUI includes a part of the translation result of the third content, for example, from the title "A family of four... attacked them" to "The Canadian national park... bit them in Matthew's arms".
[0383] In one embodiment, the method further includes: after receiving a sliding operation of the user on the fifth user interface, displaying a sixth user interface, and the sixth user interface includes subsequent translation results associated with the translation results included on the fifth user interface.
[0384] After the electronic device detects an operation of the user swiping up on the touch screen, the electronic device can display more translation content. Exemplarily, from Figure 3 (k) shown in to Figure 3 (m) shown in illustrates the process of displaying subsequent translations after the user swipes.
[0385] In one embodiment, the method further includes: before automatically obtaining the translation result of the third content, the method further includes: the electronic device automatically splits the second picture into multiple pictures; the electronic device sends the multiple pictures to the server; the electronic device receives the translation results of each picture in the multiple pictures by the server; the electronic device forms a part of the translation result of the third content from the translation results of some pictures in the multiple pictures, or forms the translation result of the third content from the translation results of all pictures in the multiple pictures.
[0386] In one embodiment, the translation result of the third content includes the content obtained by translating the text content obtained by performing OCR text recognition on the second picture from the first language to the second language.
[0387] It should be understood that the process of the electronic device splitting the second picture into multiple pictures can refer to the description in the above method 1100. For the sake of brevity, it will not be elaborated here.
[0388] In one embodiment, the method further includes: displaying first prompt information at or near the first position, where the first prompt information is used to prompt the user of the starting position of the scrolling screenshot; and / or, displaying second prompt information at the end position of the first picture, where the second prompt information is used to prompt the user that the last reading reached the end position.
[0389] It should be understood that the first prompt information and the second prompt information can refer to Figure 8 the shown GUI. When the mobile phone completes full-screen translation and performs scrolling translation, the first prompt information and / or the second prompt information can be displayed on the interface of the scrolling screenshot.
[0390] In one embodiment, the second operation includes the user clicking a first control that can trigger the scrolling translation function or the user inputting a voice command that can trigger the scrolling translation function.
[0391] Exemplarily, as Figure 3 shown in (f) of, the second operation can be the operation of the user clicking the control 306.
[0392] In one embodiment, the first position is associated with the first picture, including: the first position is related to a specific position in the first picture, where the specific position is: the end position or the middle position or the position of a predetermined ratio of the first picture; or, the starting position of the last paragraph or the starting position of the last n lines in the first picture, where n is a positive integer and n is greater than or equal to 1.
[0393] Exemplarily, as Figure 3 shown in (g) of, the scrolling screenshot can start from the paragraph "It was like...on Facebook".
[0394] Exemplarily, the position of the predetermined ratio can be two-thirds of the first picture. For example, the scrolling screenshot starts from the line "when theincident...Friday,".
[0395] In one embodiment, the first position is associated with the first picture and includes: the first position is related to the end position or the middle position or the position at a predetermined ratio of the first content; or, the first position is related to the start position of the last paragraph or the start position of the last n lines in the first content, where n is a positive integer and n is greater than or equal to 1.
[0396] Exemplarily, the scrolling screenshot can start from a certain line or a certain paragraph in the English content from the title "A family... were sleeping" to "The family was... clamped onto Matthew’s arms".
[0397] In one embodiment, before detecting the second operation of the user on the second user interface, the method further includes: displaying a control on the second user interface that can trigger scrolling translation.
[0398] Exemplarily, as Figure 3 shown in (f) of, a control 306 can be displayed on the GUI.
[0399] In one embodiment, detecting the first operation of the user on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, displaying a plurality of function controls, where the plurality of function controls include a first control that can trigger full-screen translation; detecting that the user clicks the first control or the user inputs a voice command that can trigger the full-screen translation function.
[0400] Exemplarily, before the user clicks the control 305, the user can perform a two-finger pressing operation on the GUI as shown in (c) of Figure 3 . After the mobile phone detects the two-finger pressing operation of the user, a plurality of controls can be displayed, and the control 305 is included in the plurality of controls.
[0401] In one embodiment, automatically obtaining the translation result of the second content includes: the electronic device sending the second picture or the picture corresponding to a part of the second picture to the server; the electronic device receiving the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
[0402] Figure 14 FIG. shows a schematic flowchart of a machine translation method 1400 provided by an embodiment of the present application. As Figure 14 shown, the method 1400 includes:
[0403] S1401, displaying a first user interface on the touch screen, where the first user interface includes first content, and the language of the first content is a first language.
[0404] S1402. Detect a first operation of the user on the first user interface, where the first operation includes a user operation for triggering full-screen translation.
[0405] S1403. In response to the first operation, take a screenshot of the first user interface to obtain a first picture.
[0406] S1404. According to the first picture, automatically obtain a translation result of the first content, where the language of the translation result of the first content is a second language.
[0407] S1405. After automatically obtaining the translation result of the first content, automatically display a second user interface, where the second user interface includes part or all of the translation result of the first content.
[0408] It should be understood that S1401 - S1405 can refer to the descriptions of the above S1301 - S1305. For the sake of brevity, they will not be elaborated here.
[0409] S1406. Detect a second operation of the user on the second user interface, where the second operation includes a user operation for triggering continued translation.
[0410] S1407. In response to the second operation, automatically obtain a translation result of a second content, where the second content includes part or all of the other content except the first content in all the content corresponding to the first language, and the language of the translation result of the second content is the second language.
[0411] S1408. After automatically obtaining part or all of the translation result of the second content, automatically display a third user interface or display the third user interface after receiving a sliding operation of the user, where the third user interface includes part or all of the translation result of the second content.
[0412] It should be understood that the process of S1406 - S1408 can refer to the relevant descriptions in the above method 1300. For the sake of brevity, they will not be elaborated here.
[0413] In the embodiments of the present application, after the electronic device performs a full-screen translation once, the electronic device can provide a control for continued translation to the user. When the electronic device detects that the user clicks the control for continued translation, it can directly load all or part of the translation corresponding to the remaining original text in the background. In this way, the electronic device does not need to jump to the original text interface for scrolling screenshots, which can further improve the user experience when the user reads the translation.
[0414] In one embodiment, in response to the second operation, the electronic device automatically takes a screenshot to obtain a second picture, which is the picture corresponding to the second content; the automatic obtaining of the translation result of the second content includes: automatically obtaining the translation result of the second content according to the second picture.
[0415] In one embodiment, the automatic obtaining of the translation result of the second content by the electronic device includes: sending the second picture or the picture corresponding to a part of the second picture to the server; receiving the translation result of the second picture or the picture corresponding to a part of the second picture returned by the server.
[0416] In one embodiment, the electronic device automatically taking a screenshot to obtain a second picture includes: the electronic device automatically intercepting the content of one or more screens to obtain the second picture, and the automatic screenshot process is visible or invisible to the user.
[0417] In one embodiment, the electronic device automatically obtaining the translation result of the second content includes: the electronic device automatically splitting the second picture into multiple pictures; the electronic device sending the multiple pictures to the server; the electronic device receiving the translation result of each picture in the multiple pictures from the server; the electronic device forming a part of the translation result of the second content with the translation results of some pictures in the multiple pictures, or forming the translation result of the second content with the translation results of all pictures in the multiple pictures.
[0418] It should be understood that the process from splitting to obtaining the translation result can refer to the above method 1100. For the sake of brevity, it will not be elaborated here.
[0419] In one embodiment, the second operation includes the user clicking on a first control that can trigger the continue translation function or the user inputting a voice command that can trigger the continue translation function.
[0420] In one embodiment, the method further includes: after receiving a sliding operation of the user on the third user interface, the electronic device displays a fourth user interface, and the fourth user interface includes subsequent translation results associated with the translation results included in the third user interface.
[0421] In one embodiment, before detecting the first operation of the user on the first user interface, the method further includes: the electronic device displays a control on the first user interface that can trigger full-screen translation.
[0422] In one embodiment, before detecting the second operation of the user on the second user interface, the method further includes: the electronic device displays a control on the second user interface that can trigger continue translation.
[0423] In one embodiment, detecting a first operation of a user on the first user interface includes: after detecting a multi-finger pressing operation of the user on the first user interface, the electronic device displays a plurality of function controls, and the plurality of function controls includes a first control that can trigger full-screen translation; detecting that the user clicks the first control or the user inputs a voice command that can trigger the full-screen translation function.
[0424] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0425] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be repeated here. The embodiments can refer to and combine with each other.
[0426] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division, and there can be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings, direct couplings, or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in an electrical, mechanical, or other form.
[0427] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0428] In addition, the functional units in each embodiment of this application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0429] When the above-mentioned function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical discs.
[0430] As described above, the foregoing is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.
Claims
1. An electronic device, characterized in that, Comprising: A touch screen; One or more processors; One or more memories; The one or more memories store one or more computer programs, the one or more computer programs comprising instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: Display a first user interface on the touch screen, the first user interface including first content, the language of the first content being a first language; Detect a first operation of the user on the first user interface, the first operation including a user operation for triggering full-screen translation; In response to the first operation: Obtain a first picture obtained by taking a screenshot of the first user interface; According to the first picture, obtain a translation result of the first content, the language of the translation result of the first content being a second language; And Display a second user interface, the second user interface including a part or all of the translation result of the first content; Detect a second operation of the user on the second user interface, the second operation including a user operation for triggering scrolling translation; In response to the second operation, display a third user interface and start scrolling and taking screenshots from a first position of the third user interface, the third user interface including second content, the first position being associated with the first picture or with the first content or with the first user interface, the language of the second content being the first language; During the process of scrolling and taking screenshots, when a third operation of the user is detected on a fourth user interface, or when the fourth user interface scrolls to an end position, stop scrolling and taking screenshots at a second position of the fourth user interface to obtain a second picture, the second picture being a picture corresponding to third content, the third content including the content from the first position to the second position, the language of the third content being the first language, the second position being the position corresponding to the third operation or the end position of the fourth user interface; According to the second picture, obtain a translation result of the third content, the language of the translation result of the third content being the second language; After obtaining a part or all of the translation result of the third content, display a fifth user interface, the fifth user interface including a part or all of the translation result of the third content.
2. The electronic device according to claim 1, wherein The first position being associated with the first picture includes: the first position being related to a preset position in the first picture, where the preset position is: The end position or the middle position or the position of a predetermined ratio of the first picture; or, The starting position of the last paragraph or the starting position of the last n lines in the first picture, n being a positive integer, n being greater than or equal to 1.
3. The electronic device according to claim 1 or 2, characterized in that, When the instructions are executed by the one or more processors, cause the electronic device to perform the following steps: Before obtaining the translation result of the third content, split the second picture into multiple pictures; Send the multiple pictures to a server; Receive the translation result of each picture in the multiple pictures from the server; The translation results of some of the multiple pictures form part of the translation result of the third content, or the translation results of all of the multiple pictures form the translation result of the third content.
4. The electronic device according to claim 1 or 2, characterized in that, When the instruction is executed by the one or more processors, the electronic device is caused to perform the following steps: Display a first prompt message at or near the first position, the first prompt message being used to prompt the user of the starting position of the scrolling screenshot; and / or Display a second prompt message at the end position of the first picture, the second prompt message being used to prompt the user that the last reading reached the end position.
5. The electronic device according to claim 1 or 2, characterized in that, When the instruction is executed by the one or more processors, the electronic device is caused to perform the following steps: After detecting a multi-finger pressing operation of the user on the first user interface, display a plurality of function controls, the plurality of function controls including a first control that can trigger full-screen translation; Detect that the user clicks the first control or the user inputs a voice instruction that can trigger the full-screen translation function.
6. An electronic device, characterized in that, Comprising: A touch screen; One or more processors; One or more memories; The one or more memories store one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the following steps: Display a first user interface on the touch screen, the first user interface including a first content, the language of the first content being a first language; Detect a first operation on the first user interface, the first operation including a user operation that triggers scrolling translation; In response to the first operation, start scrolling screenshot from a first position of the first user interface; During the scrolling screenshot process, when a second operation of the user is detected on a second user interface, or when the second user interface scrolls to an end position, stop the scrolling screenshot at a second position of the second user interface to obtain a first picture, the first picture being a picture corresponding to a second content, the second content including the content from the first position to the second position, the language of the second content being the first language; Obtain a translation result of the second content according to the first picture, the language of the translation result of the second content being a second language; After obtaining part or all of the translation result of the second content, display a third user interface, the third user interface including part or all of the translation result of the second content; Detect a third operation on a fourth user interface, the fourth user interface including an ending part of the translation result of the second content, the third operation including a user operation that triggers scrolling translation; In response to the third operation, display a fifth user interface and start scrolling screenshot from a third position of the fifth user interface, the fifth user interface including a third content, the third position being associated with the first picture or the second position or the second content or the second user interface, the language of the third content being the first language; During the process of scrolling screenshot, when a fourth operation of the user is detected on the sixth user interface, or when scrolling reaches the end position, stop scrolling screenshot at the fourth position on the sixth user interface to obtain a second picture, where the second picture is the picture corresponding to the fourth content, the fourth content includes the content from the third position to the fourth position, the language of the fourth content is the first language, and the fourth position is the position corresponding to the fourth operation or the end position of the sixth user interface; Obtain the translation result of the fourth content according to the second picture, where the language of the translation result of the fourth content is the second language; After obtaining a part or all of the translation result of the fourth content, display a seventh user interface, where the seventh user interface includes a part or all of the translation result of the fourth content; Wherein, before obtaining the translation result of the second content, the first picture is sliced into multiple pictures; Wherein, the third position is related to a preset position in the last picture among the multiple pictures, and the preset position is: The starting position or the ending position or the middle position or the position at a predetermined ratio of the last picture; or, The starting position of the last paragraph or the starting position of the last n lines in the last picture, where n is a positive integer and n is greater than or equal to 1.
7. The electronic device according to claim 6, wherein When the instruction is executed by the one or more processors, cause the electronic device to perform the following steps: Display a first prompt message at or near the third position, where the first prompt message is used to prompt the user of the starting position of scrolling screenshot; and / or, Display a second prompt message at or near the second position, where the second prompt message is used to prompt the user that the user last read up to the second position.
8. The electronic device according to claim 6, wherein When the instruction is executed by the one or more processors, cause the electronic device to perform the following steps: Detect a fifth operation on an eighth user interface, where the eighth user interface includes the ending part of the translation result of the second content, and the fifth operation includes a user operation triggered by the user to continue translation; In response to the fifth operation, obtain the translation result of the fifth content, where the fifth content includes a part or all of the other content except the second content in all the content corresponding to the first language, and the language of the translation result of the fifth content is the second language; After obtaining a part or all of the translation result of the fifth content, display a ninth user interface or display the ninth user interface after receiving a sliding operation of the user, where the ninth user interface includes a part or all of the translation result of the fifth content.
9. The electronic device according to any one of claims 6 to 8, characterized in that, When the instruction is executed by the one or more processors, cause the electronic device to perform the following steps: Before obtaining the translation result of the second content, slice the first picture into multiple pictures; Send the multiple pictures to the server; Receive the translation result of each picture in the multiple pictures from the server; The translation results of some of the multiple pictures form part of the translation result of the second content, or the translation results of all of the multiple pictures form the translation result of the second content.
10. An electronic device, characterized in that, Comprising: A touch screen; One or more processors; One or more memories; The one or more memories store one or more computer programs, and the one or more computer programs include instructions which, when executed by the one or more processors, cause the electronic device to perform the following steps: Display a first user interface on the touch screen, the first user interface including first content, and the language of the first content being a first language; Detect a first operation of the user on the first user interface, the first operation including a user operation for triggering full-screen translation; In response to the first operation: Take a screenshot of the first user interface to obtain a first picture; Obtain a translation result of the first content according to the first picture, and the language of the translation result of the first content being a second language; And Display a second user interface, the second user interface including part or all of the translation result of the first content; Detect a second operation of the user on the second user interface, the second operation including a user operation for triggering continued translation, and the second operation is used to trigger screenshot taking; In response to the second operation, obtain a translation result of second content, the second content including part or all of the other content except the first content among all the content corresponding to the first language, and the language of the translation result of the second content being the second language; After obtaining part or all of the translation result of the second content, display a third user interface or display the third user interface after receiving a swipe operation of the user, and the third user interface includes part or all of the translation result of the second content.
11. The electronic device according to claim 10, wherein When the instructions are executed by the one or more processors, cause the electronic device to perform the following steps: In response to the second operation, take a screenshot to obtain a second picture, the second picture being a picture corresponding to the second content, and the screenshot process is invisible to the user; Cut the second picture into multiple pictures; Send the multiple pictures to a server; Receive the translation result of each picture in the multiple pictures from the server; The translation results of some of the multiple pictures form part of the translation result of the second content, or the translation results of all of the multiple pictures form the translation result of the second content.
12. The electronic device according to claim 10 or 11, characterized in that, When the instructions are executed by the one or more processors, cause the electronic device to perform the following steps: After detecting a multi-finger pressing operation of the user on the first user interface, display a plurality of function controls, and the plurality of function controls include a first control capable of triggering full-screen translation; Detect that the user clicks the first control or the user inputs a voice command capable of triggering the full-screen translation function.
13. A method for machine translation, the method being applied to an electronic device with a touch screen, characterized in that, Comprising: Display a first user interface on the touch screen, the first user interface including first content, and the language of the first content being a first language; Detect a first operation of the user on the first user interface, where the first operation includes a user operation for the user to trigger full-screen translation; In response to the first operation: Obtain a first picture obtained by taking a screenshot of the first user interface; According to the first picture, obtain a translation result of the first content, where the language of the translation result of the first content is a second language; And Display a second user interface, where the second user interface includes a part or all of the translation result of the first content; Detect a second operation of the user on the second user interface, where the second operation includes a user operation for the user to trigger scrolling translation; In response to the second operation, display a third user interface and start scrolling screenshot from a first position of the third user interface. The third user interface includes second content, and the first position is associated with the first picture or the first content or the first user interface. The language of the second content is the first language; During the process of scrolling screenshot, when a third operation of the user is detected on a fourth user interface, or when the fourth user interface scrolls to an end position, stop scrolling screenshot at a second position of the fourth user interface to obtain a second picture. The second picture is a picture corresponding to third content, and the third content includes the content from the first position to the second position. The language of the third content is the first language, and the second position is the position corresponding to the third operation or the end position of the fourth user interface; According to the second picture, obtain a translation result of the third content, where the language of the translation result of the third content is the second language; After obtaining a part or all of the translation result of the third content, display a fifth user interface, where the fifth user interface includes a part or all of the translation result of the third content.
14. A method for machine translation, the method being applied to an electronic device having a touch screen, characterized in that, Include: Display a first user interface on the touch screen. The first user interface includes first content, and the language of the first content is a first language; Detect a first operation on the first user interface, where the first operation includes a user operation for the user to trigger scrolling translation; In response to the first operation, start scrolling screenshot from a first position of the first user interface; During the process of scrolling screenshot, when a second operation of the user is detected on a second user interface, or when the second user interface scrolls to an end position, stop scrolling screenshot at a second position of the second user interface to obtain a first picture. The first picture is a picture corresponding to second content, and the second content includes the content from the first position to the second position. The language of the second content is the first language; According to the first picture, obtain a translation result of the second content, where the language of the translation result of the second content is a second language; After obtaining a part or all of the translation result of the second content, display a third user interface, where the third user interface includes a part or all of the translation result of the second content; A third operation is detected on a fourth user interface, the fourth user interface including an ending part of a translation result of the second content, and the third operation includes a user operation triggered by the user to perform scrolling translation; In response to the third operation, a fifth user interface is displayed, and a scrolling screenshot is started from a third position of the fifth user interface. The fifth user interface includes third content, and the third position is associated with the first picture or the second position or the second content or the second user interface. The language of the third content is the first language; During the process of taking the scrolling screenshot, when a fourth operation of the user is detected on a sixth user interface, or when the end position is scrolled to, the scrolling screenshot stops at a fourth position of the sixth user interface, and a second picture is obtained. The second picture is a picture corresponding to fourth content, and the fourth content includes the content from the third position to the fourth position. The language of the fourth content is the first language, and the fourth position is the position corresponding to the fourth operation or the end position of the sixth user interface; According to the second picture, a translation result of the fourth content is obtained, and the language of the translation result of the fourth content is the second language; After obtaining a part or all of the translation result of the fourth content, a seventh user interface is displayed, and the seventh user interface includes a part or all of the translation result of the fourth content; Wherein, before obtaining the translation result of the second content, the first picture is sliced into multiple pictures; Wherein, the third position is related to a preset position in the last picture among the multiple pictures, and the preset position is: The starting position or the ending position or the middle position or the position at a predetermined ratio of the last picture; or, The starting position of the last paragraph or the starting position of the last n lines in the last picture, where n is a positive integer and n is greater than or equal to 1.
15. A method for machine translation, the method being applied to an electronic device having a touch screen, characterized in that, Including: A first user interface is displayed on the touch screen, and the first user interface includes first content, and the language of the first content is the first language; A first operation of the user is detected on the first user interface, and the first operation includes a user operation triggered by the user to perform full-screen translation; In response to the first operation: The first user interface is screenshot to obtain a first picture; According to the first picture, a translation result of the first content is obtained, and the language of the translation result of the first content is the second language; And A second user interface is displayed, and the second user interface includes a part or all of the translation result of the first content; A second operation of the user is detected on the second user interface, and the second operation includes a user operation triggered by the user to perform continuous translation, and the second operation is used to trigger screenshot; In response to the second operation, a translation result of second content is obtained. The second content includes a part or all of the other content except the first content among all the content corresponding to the first language, and the language of the translation result of the second content is the second language; After obtaining part or all of the translation result of the second content, display a third user interface or display the third user interface after receiving a sliding operation of the user, where the third user interface includes part or all of the translation result of the second content.
16. A computer-readable storage medium, characterized in that, It includes computer instructions, and when the computer instructions run on an electronic device, the electronic device is caused to execute the machine translation method according to any one of claims 13 to 15.
Citation Information
Patent Citations
Text message translation method and device
CN104636326A
Method and electronic device for rolling screen capture
CN109271081A
Screen interface long screenshot method, mobile terminal and computer readable storage medium
CN110209456A
Machine translation methods and electronic devices
CN110781688B