Translation method and device, computer equipment, storage medium and program product

By displaying the web page and translation function sidebars in parallel in the browser interface, providing web page and non-web page translation controls, the problem of single translation functions of existing browsers is solved, and efficient translation of web page and non-web page content in the same window is achieved. ability.

CN119201324APending Publication Date: 2024-12-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411369223.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-27
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

The translation function in existing browsers is single, resulting in low user efficiency and inability to translate web pages and non-web page content in the same window at the same time.

Method used

The sidebar of web pages and translation functions is displayed sidebar in parallel in the browser interface. The sidebar contains web page translation controls and non-web page translation controls. Users can translate web page content through web page translation controls and translate and display them through non-web page translation controls. Define content.

Benefits of technology

It expands the diversity of the browser's translation functions, allowing users to perform translation operations on web and non-web page content in one window, improving the efficiency of the translation function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201324A_ABST
    Figure CN119201324A_ABST
Patent Text Reader

Abstract

The invention discloses a translation method and device, computer equipment, a storage medium and a program product, and belongs to the technical field of UI interaction. The method comprises the following steps: displaying a webpage and a translation function sidebar in parallel in a browser interface; the translation function sidebar comprises a webpage translation control and a non-webpage translation control; in response to the fact that the webpage is displayed in the webpage and a first triggering operation on the webpage translation control is received, displaying a translation result of the webpage in the webpage; in response to the received second triggering operation on the non-webpage translation control, displaying translation information of the self-defined content in the translation function sidebar; the custom content is non-webpage content. According to the scheme, the diversity of the translation function based on the browser is expanded, and the efficiency of using the translation function based on the browser by the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of user interface (UI) interaction technology, and in particular to a translation method, apparatus, computer equipment, storage medium and program product. Background Art

[0002] With the continuous development of Internet technology, many browsers or plug-ins can now provide web-based translation functions.

[0003] In the related art, when a user browses a web page through a browser that supports the translation function, he clicks the extension function button provided by the browser and selects the translation function in the pop-up drop-down menu. At this time, the browser can translate the currently displayed web page and display the translated web page.

[0004] However, in the above solution, the browser-based translation function is relatively simple, resulting in low efficiency in users using the translation function. Summary of the invention

[0005] The present application provides a translation method, apparatus, computer device, storage medium and program product. The technical solution is as follows:

[0006] According to one aspect of the present application, a translation method is provided, the method comprising:

[0007] Displaying a web page and a translation function sidebar in parallel in a browser interface; the translation function sidebar includes a web page translation control and a non-web page translation control;

[0008] In response to a web page being displayed on the web page and receiving a first trigger operation on the web page translation control, displaying a translation result of the web page on the web page;

[0009] In response to receiving a second trigger operation on the non-webpage translation control, displaying translation information of custom content in the translation function sidebar; the custom content is non-webpage content.

[0010] According to another aspect of the present application, a translation device is provided, the device comprising:

[0011] An interface display module, used to display web pages and a translation function sidebar in parallel in a browser interface; the translation function sidebar includes a web page translation control and a non-web page translation control;

[0012] A webpage translation result display module, configured to display a translation result of the webpage in the webpage page in response to a webpage being displayed in the webpage page and receiving a first trigger operation on the webpage translation control;

[0013] The translation information display module is used to display the translation information of the custom content in the translation function sidebar in response to receiving a second trigger operation on the non-webpage translation control; the custom content is the non-webpage content.

[0014] According to another aspect of the present application, a computer device is provided, the computer device comprising: a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the translation method as described above.

[0015] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the translation method as described above.

[0016] According to another aspect of the present application, a computer program product is provided, which includes computer instructions stored in a computer-readable storage medium, and a processor obtains the computer instructions from the computer-readable storage medium, so that the processor loads and executes to implement the translation method as described above.

[0017] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:

[0018] An interactive solution for translation scenarios is provided. In the scenario of browsing web pages through a browser, the solution supports triggering and displaying translation functions for web pages and non-web page contents in the same window. Specifically, the web page and the translation function sidebar can be displayed simultaneously in the browser interface. Through the translation function sidebar, the translation of web pages in the web page can be triggered, and custom contents outside the web page can be set, and the translation information of the custom contents can be directly displayed in the translation function sidebar. Thus, when browsing a web page, the user can perform the operations of translating the web page and translating the custom contents outside the web page in parallel, thereby expanding the diversity of the browser-based translation function and improving the efficiency of the user's use of the browser-based translation function. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a structural block diagram of a computer system provided by an exemplary embodiment of the present application;

[0020] Figure 2 is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0021] Figure 3 is a flowchart of a translation method provided by an exemplary embodiment of the present application;

[0022] Figure 4 is a flowchart of a translation method provided by an exemplary embodiment of the present application;

[0023] Figure 5 is a flowchart of a translation method provided by an exemplary embodiment of the present application;

[0024] Figure 6 is a flowchart of a translation method provided by an exemplary embodiment of the present application;

[0025] Figure 7 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0026] Figure 8 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0027] Fig. 9 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0028] Fig.10 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0029] Fig.11 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0030] Fig.12 This is a schematic diagram of a browser interface involved in an embodiment of the present application;

[0031] Fig.13 is a schematic diagram of changes in the translation function sidebar involved in an embodiment of the present application;

[0032] Fig.14 This is a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application;

[0033] Fig.15 This is a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application;

[0034] Fig.16 This is a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application;

[0035] Figures 17 to 19 Schematic diagrams of three translation processes involved in the embodiments of the present application;

[0036] Fig. 20 is a structural block diagram of a translation device provided by an embodiment of the present application;

[0037] Fig.21 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0039] Figure 1 The following is a block diagram of a computer system provided by an exemplary embodiment of the present application. The computer system 100 includes: a terminal 110 and a server 120 .

[0040] The terminal 110 is installed and runs a client 111 having a browser. When the terminal 110 runs the client 111, the browser interface of the client 111 is displayed on the screen of the terminal 110. The user can trigger the display of a web page through the browser interface. In an embodiment of the present application, the browser can support a translation function, or the browser can install a translation plug-in with a translation function.

[0041] Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, the above terminal may be only one, or the above terminals may be 6, 8, or more. The embodiment of the present application does not limit the number of terminals and device types.

[0042] Figure 1 Only one terminal is shown, but in different embodiments, there may be multiple other terminals that can access the server 120. Optionally, there are one or more terminals 130 corresponding to the developer, and a development and editing platform for the browser or the translation plug-in in the browser is installed on the terminal 130. The developer can edit and update the client or translation plug-in of the browser on the terminal 130, and transmit the installation package of the updated client or translation plug-in to the server 120 via a wired or wireless network. The terminal 110 can download the client installation package from the server 120 to update the client or translation plug-in.

[0043] The terminal 110 and the terminal 130 may be connected to the server 120 via a wireless network or a wired network.

[0044] The server 120 includes at least one of a single server, multiple servers, a cloud computing platform, and a virtualization center. The server 120 is used to provide background services for a browser or plug-in client that supports the translation function. Optionally, the server 120 undertakes the main computing work and the terminal undertakes the secondary computing work; or, the server 120 undertakes the secondary computing work and the terminal undertakes the main computing work; or, a distributed computing architecture is used between the server 120 and the terminal for collaborative computing.

[0045] In an illustrative example, the server 120 includes a processor 122, a user account database 123, a translation service module 124, and a user-oriented input / output interface (I / O interface) 125. The processor 122 is used to load instructions stored in the server 120 and process data in the user account database 123 and the translation service module 124; the user account database 123 is used to store data of user accounts used by the terminal 110 and other terminals 130, such as user account avatars, user account nicknames, user account levels, etc.; the translation service module 124 is used to provide background translation services; and the user-oriented I / O interface 125 is used to establish communication and exchange data with the terminal 110 through a wireless network or a wired network.

[0046] Please refer to Figure 2 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application. Figure 2 As shown, the browser interface 200 may include a web page 210 and a translation function sidebar 220 displayed in columns. The web page 210 is used to display a web page, and the translation function sidebar 220 includes at least two translation areas, and the at least two translation areas include at least a web page translation area 221 and at least one non-web page translation area 222. The web page translation area 221 may include a web page translation control for triggering translation of a web page; the non-web page translation area 222 may include a non-web page translation control for triggering translation of non-web page custom content, and a control or element for displaying translation information of custom content.

[0047] Please refer to Figure 3 , which shows a flowchart of a translation method provided by an exemplary embodiment of the present application, the method is executed by a computer device, and the method is applied to Figure 1 Taking the terminal 110 as an example, the method may include the following steps.

[0048] Step 310: Displaying the web page and the translation function sidebar side by side in the browser interface; the translation function sidebar includes a web translation control and a non-web translation control.

[0049] A browser is an application used to retrieve, display and transmit web information resources. The web information resources can be marked by a Uniform Resource Identifier (URI), which is a web page, picture, video or other content that can be presented on a web page.

[0050] The above browser interface is the interface displayed when the browser client installed in the terminal is started.

[0051] In an embodiment of the present application, the browser interface may display a translation function sidebar under the trigger of the user during the process of displaying a web page. For example, the browser interface or the drop-down menu of the browser interface may include a trigger control / option corresponding to the translation function; the translation function may be a function of the browser itself, or a function provided by a translation plug-in installed in the browser. When the user triggers the above-mentioned trigger control / option, the browser interface may display a translation function sidebar in addition to the web page. In other words, the above-mentioned translation function sidebar will not cover the web page. Among them, the above-mentioned translation function sidebar may be at least one of the right sidebar, left sidebar, upper sidebar and lower sidebar of the browser interface.

[0052] The translation function sidebar is displayed in parallel or side by side with the web page, thereby allowing the user to perform translation-related operations in the translation function sidebar while browsing the web pages in the web page.

[0053] The translation function sidebar includes a webpage translation control, and the webpage translation area can be used to trigger the translation of webpages in the webpage page.

[0054] The translation function sidebar also includes a non-webpage translation control, and the non-webpage translation area can be used to trigger the translation of user-defined non-webpage content.

[0055] The above-mentioned non-webpage translation controls may include multiple ones, and different non-webpage translation controls may correspond to different types of non-webpage contents.

[0056] In a possible implementation, the browser interface may be Figure 2 In the browser interface 200, the web page can be Figure 2 In the web page 210, the translation function sidebar may be Figure 2 Translation function in the sidebar 220.

[0057] Step 320: In response to a web page being displayed on the web page and receiving a first trigger operation on a web page translation control, displaying a translation result of the web page on the web page.

[0058] In an embodiment of the present application, the web page opened or loaded by the browser can be displayed in the web page. Optionally, when the browser opens or loads multiple web pages at the same time, one of the web pages can be displayed in the web page, and the web page displayed in the web page can be switched.

[0059] Optionally, the translation function sidebar includes a web page translation area, which may include one or more controls or options related to web page translation, including a web page translation control. Users can use the web page translation control to trigger the translation of web pages in the web page. After the browser or translation plug-in completes the translation of the web page, the translation result of the web page, that is, the translated web page, can be directly displayed on the web page.

[0060] Step 330: In response to receiving a second trigger operation on a non-webpage translation control, display translation information of the custom content in a translation function sidebar; the custom content is non-webpage content.

[0061] The custom content refers to content specified by the user outside the web page displayed on the web page. The custom content may be of various types / formats, for example, the custom content may be any content containing text, such as a file, a picture, etc. The embodiment of the present application does not limit the type / format of the custom content.

[0062] Optionally, the above-mentioned translation function sidebar includes a non-web page translation area, and the non-web page translation area may include one or more controls or options related to the translation of custom content, including a non-web page translation control. In an embodiment of the present application, when a user needs to translate content other than a web page during the use of a browser, the custom content to be translated can be set in the non-web page translation area in the translation function sidebar and the non-web page translation control can be triggered. The browser or translation plug-in can translate the custom content and display the corresponding translation information in the translation function sidebar (such as in the non-web page translation area).

[0063] That is to say, in the solution shown in the embodiment of the present application, when the user is using the browser, the user can trigger the translation of various contents including web pages and non-web pages through the translation function sidebar in the browser interface.

[0064] The positions of the webpage translation area and the non-webpage translation area in the translation function sidebar can be fixed. That is, during the display of the translation function sidebar, the positions and sizes of the webpage translation area and the non-webpage translation area remain unchanged.

[0065] Alternatively, the positions of the webpage translation area and the non-webpage translation area in the translation function sidebar may also be dynamically divided; for example, during the display of the translation function sidebar, the position of the webpage translation area or the non-webpage translation area may change, and the size may also be enlarged or reduced. For example, when a user triggers the translation of a webpage through the webpage translation area, the webpage translation area is expanded or enlarged, and the non-webpage translation function sidebar may be reduced, collapsed or moved down; for another example, when a user sets custom content or triggers the translation of custom content through a non-webpage translation area, the non-webpage translation area may be expanded or enlarged, and correspondingly, the webpage translation area and other non-webpage translation areas may be collapsed or reduced.

[0066] In summary, the embodiment of the present application provides an interactive solution for translation scenarios, which supports the triggering and display of translation functions for web pages and non-web page content in the same window in the scenario of browsing web pages through a browser; specifically, the web page and the translation function sidebar can be displayed simultaneously in the browser interface, and through the translation function sidebar, the translation of the web page in the web page can be triggered, and the custom content outside the web page can be set, and the translation information of the custom content can be directly displayed in the translation function sidebar, so that the user can perform the operations of translating the web page and translating the custom content outside the web page in parallel when browsing a certain web page, thereby expanding the diversity of browser-based translation functions and improving the efficiency of users using the translation function based on the browser.

[0067] Based on the above Figure 3 In the solution shown in the embodiment shown, in a possible implementation manner, the translation information includes: at least one of a translation progress and a translation result.

[0068] In some embodiments, after the user sets custom content through the non-web page translation area, the browser or translation plug-in can display the translation progress in the translation function sidebar / non-web page translation area while translating the custom content, so that the user can intuitively understand the translation status of the custom content while browsing the web page.

[0069] In some embodiments, after the browser or translation plug-in completes the translation of the custom content set through the non-web page translation area, the translation results can be displayed in the translation function sidebar / non-web page translation area so that the user can intuitively understand the translation results of the custom content while browsing the web page.

[0070] In some embodiments, after a user sets custom content through a non-web page translation area, the translation progress can be displayed in the translation function sidebar / non-web page translation area during the process of the browser or translation plug-in translating the custom content. After the translation is completed, the translation progress in the translation function sidebar / non-web page translation area can be replaced by the translation result.

[0071] In an embodiment of the present application, after the user sets custom content and triggers the non-web page translation control in the translation function sidebar, the computer device can display at least one of the translation progress and translation results of the custom content by the browser or translation plug-in in the translation function sidebar / non-web page translation area. When translating custom content, the user does not need to trigger the translation of custom content outside the web page and check the translation status through other application interfaces other than the browser interface, or other pages in the browser. The user can browse the web page in the browser interface while checking the translation status of the custom content outside the web page, thereby ensuring the efficiency of the user using the translation function when browsing the web.

[0072] In a possible implementation, when the custom content includes a file, the translation information may include a translation progress.

[0073] Based on the solution shown in any one or more embodiments of the above embodiments of the present application, in a possible implementation method, please refer to Figure 4 , which shows a flowchart of a translation method provided by an exemplary embodiment of the present application, such as Figure 4 As shown, the above-mentioned custom content includes a translation source file in a specified file format; for example, the non-webpage translation area includes a translation sub-area in a specified file format; the above-mentioned step 330 can be implemented as the following steps 330a and 330b.

[0074] Step 330a: In response to the second trigger operation, during the process of translating the translation source file, the translation progress of the translation source file is displayed in the translation function sidebar.

[0075] The translation source file of the specified file format is the custom content to be translated, which is of file type.

[0076] Since the translation process of custom content of file type (i.e., the above-mentioned translation source file) is relatively complicated, for example, the translation system corresponding to the browser or translation plug-in needs to perform file parsing, text recognition and extraction, text translation, and generate translation result files on the above-mentioned translation source file, and the translation source file usually has a large amount of data, the translation process of the translation source file will be relatively long. In an embodiment of the present application, during the translation of the translation source file, the translation progress can be displayed in the above-mentioned translation function sidebar / translation sub-area.

[0077] Step 330b: In response to the translation of the translation source file being completed, displaying the translation result of the translation source file in the translation function sidebar.

[0078] In an embodiment of the present application, after the translation system completes the translation of the translation source file, the translation result file obtained by the translation can be fed back to the browser or the translation plug-in. The browser or the translation plug-in can display the corresponding translation result in the translation function sidebar / translation sub-area based on the translation result file, for example, using the translation result to replace the translation progress, so that the user can perform specified operations on the translation result file based on the translation result, such as previewing, viewing, editing the translation result file, etc.

[0079] In the scheme shown in the embodiment of the present application, for the translation source file of the specified file format whose translation time may be longer, during the translation process, the browser or translation plug-in can display the translation progress in the translation sub-area corresponding to the specified file format in the non-web page translation area, and after the translation is completed, display the translation result in the translation function sidebar / translation sub-area, so that the user can intuitively see the translation status of the translation source file, avoid the trouble of excessive translation time to the user, and thus improve the interactive effect of the user when using the translation function based on the browser.

[0080] For example, when the translation time of a source file is long, if the user cannot understand the translation progress, it is impossible to determine in time whether the source file has encountered translation problems, such as translation freeze, translation failure, etc., and it is also impossible to understand the remaining translation time required, which will cause trouble to the user. For example, when the translation process of the source file encounters a freeze, the user may have to wait for a long time, thereby wasting time, or it may cause the user to perform repeated translation trigger operations. For example, when the translation progress is normal, the user may reset the translation source file or re-trigger the translation of the translation source file because no feedback has been received for a long time; through the scheme shown in the embodiment of the present application, the user can intuitively see the translation progress and translation results of the source file in the translation function sidebar / translation sub-area, so as to understand the translation progress and results in time.

[0081] The above-mentioned specified file format may be one or more file formats preset by the developer.

[0082] Based on the scheme shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, the specified file format includes one or more of the following formats: Portable Document Format (PDF), presentation (Power Point, PPT), compressed file format, rich text format, plain text format, table format, and picture format.

[0083] In the manner shown in the embodiment of the present application, the browser or translation plug-in can perform translation on a variety of custom content through the translation function sidebar displayed in the browser interface, thereby ensuring the diversity of the translation function and further ensuring the efficiency and convenience of users in using the translation function.

[0084] Optionally, in the case where the designated file format includes multiple file formats, the non-webpage translation area may include multiple translation sub-areas, each translation sub-area may correspond to one or more file formats, and different translation sub-areas may correspond to different file formats. Accordingly, displaying the translation progress of the translation source file in the translation sub-area may refer to displaying the translation progress of the translation source file in the translation sub-area corresponding to the file format to which the translation source file belongs; displaying the translation result of the translation source file in the translation sub-area may refer to displaying the translation result of the translation source file in the translation sub-area corresponding to the file format to which the translation source file belongs.

[0085] Optionally, in the case that the above-mentioned non-web page translation area may include multiple translation sub-areas, in the translation sub-area corresponding to the file format to which the translation source file belongs, while displaying the translation progress / translation result of the translation source file, other translation sub-areas may be in a folded or hidden state, thereby providing the limited display area in the translation function sidebar to the translation progress or translation result, thereby ensuring the effective utilization of the translation function sidebar and the display effect of the translation progress / translation result.

[0086] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the above translation progress includes one or more of the following progress:

[0087] Upload the translation source file to the translation server;

[0088] The translation server translates the translation source file;

[0089] Download the translation result file corresponding to the translation source file from the translation server.

[0090] In the embodiment of the present application, after the user sets the translation source file to be translated, the browser or translation plug-in in the computer device can upload the translation source file to the server (for example, Figure 1 The server 120 in the translation function is used to translate the translation source file, and then returns the translation result file. Therefore, in the embodiment of the present application, the translation progress of the above-mentioned translation source file can be divided into three main steps: uploading, translating, and downloading, so that the user can intuitively understand the current translation progress in which stage, whether there is a freeze or interruption through the translation sub-area in the translation function sidebar; in the case of a freeze or interruption in the translation, the user can also independently judge at which stage the problem occurs according to the displayed translation progress, so as to select appropriate measures for subsequent translation. For example, if the translation progress is stuck in the upload or download stage for a long time, the user can check the network status. If it is stuck in the translation stage for a long time, the user can contact customer service or change the translation server, etc.

[0091] Based on the solutions shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation manner, the translation result includes at least one of an icon and a link of a translation result file corresponding to the translation source file.

[0092] In the embodiment of the present application, the icon of the translation result file corresponding to the above-mentioned translation source file may be an icon of the file type / file format to which the translation result file corresponding to the translation source file belongs.

[0093] Optionally, the above translation result may also include information such as the name and storage path of the above translation result file.

[0094] In an embodiment of the present application, the browser or translation plug-in can display at least one of the icon and link of the translation result file corresponding to the translation source file in the translation sub-area, so that the user can intuitively understand the type of the translation result file, thereby facilitating the user to make subsequent operation decisions, thereby improving the efficiency of the user in viewing the translation result file; for example, the user can choose different viewing methods according to the file type indicated by the icon of the translation result file. For example, when the icon of the above-mentioned translation result file is a PDF icon, the user can choose to open the PDF file, and when the icon of the above-mentioned translation result file is a picture icon, the user can choose to preview the picture.

[0095] The translation result file and the translation source file may be files in the same format, or the translation result file and the translation source file may be files in different formats.

[0096] Optionally, the format of the translation result file may be a format set by the developer. For example, in the case where the translation result file and the translation source file are files of different formats, the format of the translation result file may be a format pre-specified by the developer. For example, for multiple translation source files of different formats, the translation result files corresponding to the multiple translation source files may be files of the same format; for example, for translation source files in formats such as PDF and PPT, the format of the translation result files is all in WORD format.

[0097] Alternatively, the format of the translation result file may be a format set by the user; for example, the translation sub-area may include a format setting control for the translation result file, and the user may set the format of the translation result file through the format setting control before triggering the translation of the translation source file.

[0098] Optionally, the language corresponding to the above translation result file may be automatically set by the translation system.

[0099] Alternatively, the language corresponding to the above-mentioned translation result file can be in a format set by the user; for example, the above-mentioned translation sub-area can include a target language setting control for the translation result file, and the user can set the language corresponding to the translation result file through the above-mentioned target language setting control before triggering the translation of the translation source file.

[0100] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the above translation method further includes: in response to the translation of the translation source file being completed, displaying at least one of the following controls in the translation function sidebar:

[0101] A file comparison control, used to trigger the display of the file contents of the translation result file corresponding to the translation source file and the file contents of the translation source file in columns on the web page;

[0102] The file viewing control is used to trigger the opening of the file location, which is the location where the translation result file is saved.

[0103] Among them, when the computer device receives a trigger operation on the file comparison control (such as a click operation, a long press operation or a sliding operation, etc.), the browser or translation plug-in can simultaneously display the contents of the translation source file and the translation result file on the web page, so that the user can conveniently browse the original text and the translation of the content outside the web page without switching to other pages outside the browser, thereby improving the efficiency of the user in browsing the translated content.

[0104] When the computer device receives a trigger operation on the above-mentioned file viewing control (such as a click operation, a long press operation or a sliding operation, etc.), the browser or the translation plug-in can call the resource manager in the computer device and open the folder where the translation source file is located in the resource manager interface, so that the user can easily and quickly view the resource location of the translation result file, and then perform subsequent operations on the translation result file, such as opening, copying, cutting, deleting, etc., to improve the efficiency of the user in managing the translation result file.

[0105] Based on the scheme shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, the above-mentioned translation method also includes: in response to receiving a trigger operation on the translation result of the translation source file, displaying the file content of the translation result file corresponding to the translation source file on the web page.

[0106] When a computer device receives a trigger operation (such as a click operation, a long press operation, or a sliding operation, etc.) of a translation result of a translation source file, the browser or the translation plug-in can directly display the translation result file on the web page, so that the user can conveniently browse the translation result file of the content outside the web page without switching to other pages outside the browser, thereby improving the efficiency of the user in browsing the translated content.

[0107] Based on the solution shown in any one or more embodiments of the above embodiments of the present application, in a possible implementation method, please refer to Figure 5 , which shows a flowchart of a translation method provided by an exemplary embodiment of the present application, such as Figure 5 As shown, in the case where the custom content includes a translation source file in a specified file format, the translation function sidebar further includes a content setting control; before the above step 330, step 322 may also be included.

[0108] Step 322: In response to receiving a third trigger operation on the content setting control, a file in a specified file format corresponding to the third trigger operation is obtained as a translation source file.

[0109] In an embodiment of the present application, the above-mentioned translation function sidebar also provides a content setting control for setting the translation source file. Through the content setting control, the user can directly set the translation source file in the translation function sidebar, thereby greatly simplifying the user's operation steps for setting the translation source file and improving the user's efficiency in setting the translation source text outside the web page when using the translation function based on the browser.

[0110] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the third trigger operation includes one or more of the following operations:

[0111] The operation of dragging a file of a specified file format to the content setting control;

[0112] Click the content setting control and select the operation of the file in the specified file format in the pop-up file selection window;

[0113] An operation of copying and pasting a file link to a content setting control, wherein the file link is a link to a file of a specified file format contained in a web page displayed on the web page;

[0114] The operation of copying and pasting a file of a specified file format in a web page displayed on the web page to the content setting control.

[0115] In the embodiment of the present application, the process of setting the translation source file by triggering the third trigger operation may be as follows:

[0116] 1) Displaying an explorer window superimposed on the browser interface, the explorer window containing files in a specified file format; in response to an operation of dragging the file in the specified file format to the content setting control, obtaining the file in the specified file format as a translation source file.

[0117] In an embodiment of the present application, when a user needs to set a translation source file, the user can open an explorer window, open the folder where the file of the specified file format is located in the explorer window, and drag the file of the specified file format in the folder to the content setting control and release it. At this time, the browser or translation plug-in can obtain the file of the specified file format as the translation source file.

[0118] 2) In response to a click operation on a content setting control, a file selection window is displayed; in response to a selection operation on a file of a specified file format displayed in the file selection window, the file of the specified file format is acquired as a translation source file.

[0119] In an embodiment of the present application, when the user needs to set a translation source file, the user can also click on the content setting control to trigger the display of a file selection window. For example, the file selection window can be an explorer window. Then, in the file selection window, open the folder where the file of the specified file format is located, and select the file of the specified file format in the folder. After clicking OK, the browser or translation plug-in can obtain the file of the specified file format as the translation source file.

[0120] The solutions shown in the above embodiments of the present application provide two feasible solutions for setting translation source files outside the web page based on the translation sub-area, ensuring the efficiency of users setting translation source files in the translation function sidebar displayed in the browser.

[0121] 3) In response to receiving an operation of copying and pasting a link of a file in a specified file format into a content setting control, downloading a file according to the link of the file in the specified file format; and obtaining the downloaded file in the specified file format as a translation source file.

[0122] In an embodiment of the present application, the user can also directly set the file corresponding to the link in the web page as the translation source file; specifically, when a web page is being displayed in a web page, and the web page contains a link to a file in a specified file format, the user can copy the link and paste the link into the content setting control, at which point the browser or translation plug-in can automatically access the network location corresponding to the link and download the file in the specified file format to obtain the above-mentioned translation source file. For example, a user opens a web page to query information, and the web page contains a link to a PDF file, and the user needs to translate the PDF file. At this point, the user can copy the link to the PDF file and paste it into the content setting control, and the browser or translation plug-in can automatically download the PDF file according to the link as the translation source file.

[0123] The solution shown in the embodiment of the present application provides a solution for quickly downloading files corresponding to links in web pages as translation source files. Users do not need to manually download corresponding files, thereby significantly simplifying user operations and improving the efficiency of users translating files corresponding to links in web pages.

[0124] 4) In response to receiving an operation of copying and pasting a file in a specified file format in a web page into the translation sub-area, the file in the specified file format in the web page is obtained as a translation source file.

[0125] In an embodiment of the present application, the user can also directly set a file of a specified file format contained in a web page as a translation source file; specifically, when a web page is being displayed in a web page, and the web page contains a file of a specified file format, the user can directly copy the file from the web page and paste the file into the content setting control, for example, right-click the file in the web page, select Copy in the pop-up drop-down menu, then right-click the content setting control, and select Paste in the pop-up drop-down menu. At this time, the browser or translation plug-in can automatically obtain the file of the specified file format and obtain the above-mentioned translation source file. For example, a user opens a web page to query information, and the web page contains a picture. The user needs to translate the text in the picture. At this time, the user can copy the picture and paste it into the content setting control, and the browser or translation plug-in can automatically obtain the picture as the translation source file.

[0126] The solution shown in the embodiment of the present application provides a solution for quickly setting files in a web page as translation source files, without the need for users to manually save images in the web page locally, thereby significantly simplifying user operations and improving the efficiency of users translating files in web pages.

[0127] The above-mentioned content setting control may be an area-type control or a button-type control.

[0128] Based on the solutions shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, before the above-mentioned step 330, the following steps may also be included: in response to displaying the content of a file in a specified file format through a web page, obtaining the file in the specified file format displayed on the web page as a translation source file.

[0129] In an embodiment of the present application, the browser also supports the function of opening files of a specified file format (such as PDF files) through a web page. When a file of a specified file format is opened on a web page of the browser interface, if the browser interface also displays a translation function sidebar, the browser or translation plug-in can automatically obtain the file currently displayed on the web page as the translation source file.

[0130] For example, taking the case where the file in the above-specified file format is a PDF file, the user opens a browser interface and displays a PDF file in the terminal or the network through a web page in the browser interface. When the user browses the PDF file through the web page, he needs to translate the PDF file, which can trigger the display of a translation function sidebar in the browser interface. At this time, the browser or translation plug-in detects that the content currently displayed in the web page is a PDF file, and can automatically obtain the PDF file as a translation source file.

[0131] For example, a user opens a browser interface and triggers the display of a web page and a translation function sidebar side by side in the browser interface. The user needs to browse a PDF file in a terminal or on the network, and can open the PDF file. At this time, the browser can display the content of the PDF file through the web page. At the same time, the browser or the translation plug-in can automatically obtain the PDF file as a translation source file.

[0132] The solution shown in the embodiment of the present application provides a solution for quickly setting a specified type of file displayed on a web page of a browser as a translation source file. The user does not need to manually set the specified type of file as the translation source file, thereby improving the efficiency of the user in translating the specified type of file.

[0133] Based on the solution shown in any one or more embodiments of the above embodiments of the present application, in a possible implementation method, please refer to Figure 6, which shows a flowchart of a translation method provided by an exemplary embodiment of the present application, such as Figure 6 As shown, the above-mentioned custom content includes the translation source text; the translation function sidebar also includes a source text input box and a translation text display box; before the above-mentioned step 330, step 324 is also included, and the above-mentioned step 330 can be implemented as the following step 330c.

[0134] Step 324: Obtain the translation source text entered in the source text input box.

[0135] Step 330c: In response to receiving the second trigger operation, displaying the translation result text corresponding to the translation source text in the translation text display box.

[0136] In an embodiment of the present application, for custom content of text type, the translation function sidebar / non-web page translation area can provide a translation source text input function and a translation result text display function; specifically, when the user triggers the column display of the web page and the translation function sidebar in the browser interface, the user can input the text to be translated into the source text input box while browsing the content in the web page, for example, by copying and pasting the text to be translated into the source text input box. At this time, the translation system can translate the translation source text in the source text input box, and fill the translation result text obtained by translation into the translation text display box to display it to the user.

[0137] In an embodiment of the present application, a web page and a translation function sidebar can be displayed simultaneously in a browser interface. Through the translation function sidebar, the translation of a web page in the web page can be triggered, and a translation source text outside the web page can be set, and the translation result text obtained by translating the translation source text can be directly displayed in the translation function sidebar. This allows the user to perform operations of translating the web page and translating text outside the web page in parallel when browsing a certain web page, thereby expanding the diversity of browser-based translation functions and improving the efficiency of users using browser-based translation functions.

[0138] Based on the scheme shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, before the above-mentioned step 324, the following steps may also be included: in response to the first text being selected, filling the first text into the source text input box; the first text is all or part of the text in the web page displayed on the web page.

[0139] In an embodiment of the present application, when a user displays a web page through a web page of a browser interface, if a translation function sidebar is also displayed in the current browser interface, and the user needs to translate text in the web page, the user can select the text to be translated in the web page, for example, by clicking and sliding the cursor to select the text in the web page. At this time, the browser or translation plug-in automatically fills the text selected by the user as the translation source text into the source text input box.

[0140] The solution shown in the embodiment of the present application provides a solution for quickly setting the text in the web page as the translation source text by selecting the text in the web page. The user does not need to copy the text in the web page and then paste it into the source text input box, thereby improving the efficiency of the user in setting the translation source text.

[0141] Based on the solutions shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, the translation function sidebar includes a language selection control; the above-mentioned translation method also includes: in response to receiving a fourth trigger operation on the language selection control, determining at least one of the source language and the target language for the custom translation.

[0142] In an embodiment of the present application, a language selection control may be included in the translation function sidebar / non-web page translation area, so that the user can conveniently and quickly select the original language and target language for translating the translation source file through the language selection control, thereby improving the efficiency of setting the translation language of the translation source text other than the web page when the user uses the translation function based on the browser.

[0143] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the above translation method further includes the following steps:

[0144] On the Web Page page, the translation results of the web page and custom content are displayed in columns.

[0145] In an embodiment of the present application, the browser or translation plug-in can also display the translation content corresponding to the translation result of the custom content separately together with the web page on the web page, so that the user can more conveniently compare the content of the web page and the translated content, thereby improving the convenience of the user using the translation function based on the browser.

[0146] Based on the scheme shown in any one or more of the above-mentioned embodiments of the present application, in a possible implementation method, the custom content includes a first text in a web page; the translation result of the custom content includes a second text obtained by translating the first text; the first text and the second text are at the same height in the web page.

[0147] In an embodiment of the present application, if the custom content includes a translation source text, and the translation source text is a determined text from a web page (i.e., the first text mentioned above), then after the browser or translation plug-in translates the first text into a second text, and displays the second text separately from the web page, the second text can be set to the same height as the first text in the web page, thereby facilitating the user to compare the source text in the web page and the translated text, thereby improving the convenience of the user using the translation function based on the browser.

[0148] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the above translation method further includes:

[0149] In response to the webpage displaying the translation result of the webpage, one or more of the following controls are displayed in the translation function sidebar:

[0150] Returns a control that is used to trigger the display of a web page in a web page;

[0151] The web page comparison control is used to trigger the display of web pages in columns and the translation results of web pages.

[0152] For example, after translating a web page, a web page comparison control can be displayed in the translation function sidebar / web page translation area. In response to receiving a trigger operation on the web page comparison control, the browser or translation plug-in can display the web page and the translation results of the web page in separate columns on the web page.

[0153] Based on the solutions shown in any one or more of the above embodiments of the present application, in a possible implementation manner, the translation function sidebar further includes a webpage translation setting entry control; the method further includes:

[0154] In response to the fifth trigger operation on the webpage translation setting entry control, a webpage translation setting window is displayed, and the webpage translation setting window includes at least one of the following controls:

[0155] The original text prompt control is used to turn on or off the original text prompt function; the original text prompt function is used to prompt the original text corresponding to the selected translation in the web page when the translation result of the web page is selected;

[0156] Automatic translation control, used to turn on or off the function of automatically translating web pages in languages ​​other than the specified language;

[0157] Specify a webpage translation control to turn on or off the function of automatically translating a specified webpage;

[0158] The word-by-word translation control is used to turn on or off the word-by-word translation function. The word-by-word translation function is used to translate the original text when the original text in the webpage is selected;

[0159] The language setting control for word-marking translation is used to set the language in which the word-marking translation function takes effect;

[0160] The trigger mode setting control for word-marking translation is used to set the trigger mode of the word-marking translation function.

[0161] Optionally, when the original text prompt function is turned on, the web pages are displayed in columns on the web page, and when the translation results of the web pages are displayed, in response to the selection operation of the third text in the web page, the fourth text corresponding to the third text in the translation results of the web page is highlighted.

[0162] Optionally, when the original text prompt function is turned on, the web pages are displayed in columns on the web page, and in the case of the translation results of the web pages, in response to the selection operation of the fifth text in the translation results of the web pages, the sixth text corresponding to the fifth text in the web page is highlighted.

[0163] Optionally, the web page translation setting window / translation function sidebar may include an automatic translation switch option. When the automatic translation switch option is turned on, when a new web page is displayed on the web page, the browser or translation plug-in may automatically translate the new web page.

[0164] Optionally, the web page translation setting window / translation function sidebar may include a switch for automatically translating a specified web page. When the switch for automatically translating a specified web page is turned on, when a specified web page is displayed on a web page, the browser or translation plug-in may automatically translate the specified web page. Optionally, the web page translation setting window / translation function sidebar may include a setting control for a specified web page, and a user may set the specified web page through the setting control.

[0165] Optionally, the web page translation setting window / translation function sidebar may include a switch for a word-marking translation function. When the switch for the word-marking translation function is turned on, when the user selects the original text with the cursor on the web page, the browser or translation plug-in may automatically translate the selected original text and execute the translation. Optionally, the translation result may be displayed in the web page in an inserted manner.

[0166] Optionally, in some embodiments, the browser or translation plug-in may upload the translation results of the web page or custom content to a server for storage, and in response to receiving an operation to download the translation results of the web page or custom content, download the translation results of the web page or custom content from the server.

[0167] In some solutions, translation software / tools can provide translation services between multiple languages. These translation software / tools usually support multiple functions such as text translation, image translation and voice translation, and can directly translate during web browsing. However, these solutions have disadvantages such as complex operation and single function. For example, the interface design of some translation tools is not user-friendly enough, and users need to go through multiple steps to complete the translation task, which is not convenient to use. In addition, most translation tools can only handle a single type of translation task, such as only translating text or pictures, and cannot meet users' needs for multiple translation tasks.

[0168] The solutions provided by the above-mentioned embodiments of the present application can simplify the operating procedures and realize multi-functional integration. Specifically, the solutions provided by the above-mentioned embodiments of the present application optimize the interface design and operating procedures, so that users can complete translation tasks more conveniently and quickly, and can support translation of documents, web pages, pictures, texts and other forms to meet the diverse needs of users.

[0169] For example, please refer to Figure 7 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application, such as Figure 7 As shown, when a user opens a web page or other file through a web page 710 in a browser, the user can translate the current web page through the sidebar 720 on the right (that is, the translation function sidebar mentioned above), and can also upload files for translation, upload pictures for translation, and input text for translation. The four translation functions can be performed in parallel, which can effectively reduce the burden of using translation tools and improve work and study efficiency. The detailed interaction process of the above scheme can be referred to the subsequent description.

[0170] Webpage translation: Please refer to Figure 8 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application, such as Figure 7 and Figure 8 As shown, users only need to click Figure 7 The translation plug-in will respond quickly, recognize and translate the currently browsed web page, and try to keep the format and layout of the original web page to ensure barrier-free transmission of information. Figure 8 The "Show original webpage" button 810 in the interface shown exits the translation state.

[0171] Please refer to Fig. 9 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application, such as Fig. 9As shown, in order to further enhance the flexibility and sustainability of the translation tool, the sidebar also provides personalized setting options such as "Select a question to display the original text prompt" option 910 (corresponding to the above-mentioned original text prompt control), "Translate word by word" option 920 (corresponding to the above-mentioned word by word translation control), and "Automatically translate subsequent web pages" option 930 (corresponding to the above-mentioned automatic translation control). Among them, when the "Select question and display original text prompt" option 910 is checked, when the user selects content in the translation results, the browser will display the original text corresponding to the selected content, or will mark the original text corresponding to the selected content by highlighting or other means; when the above-mentioned "Word-marking translation" option 920 is checked, when the user subsequently selects text to be translated in a web page or file, the browser will display the translation corresponding to the selected text; when the above-mentioned "Automatically translate subsequent web pages" option 930 is checked, when the user subsequently opens a new web page or file, the browser or translation plug-in will directly translate the newly opened web page or file; in addition, the above-mentioned sidebar also provides other setting options, such as options for setting specified web pages for automatic translation (corresponding to the above-mentioned specified web page translation control), options for setting the target language and triggering method of word-marking translation, etc.

[0172] After turning on "Automatically translate subsequent web pages", all foreign web pages opened by the user will be automatically translated into Chinese until the user turns off this option. Fig.10 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application, such as Fig.10 As shown, when the sidebar is closed, a floating window 1010 may appear in the upper right corner, and the floating window is used to prompt that the translation function has been turned on; please refer to Fig.11 , which shows a schematic diagram of a browser interface involved in an embodiment of the present application, such as Fig.11 As shown, after the translation is completed, a "show original webpage" option 1110 of the same style as the sidebar appears in the floating window, unifying the use experience of different tool forms. In addition, it can also include a setting option 1120 for automatically translating subsequent webpages, an option 1130 for triggering content comparison before and after translation, etc. This function meets the needs of users who continue to browse foreign websites and need translation, and can effectively reduce the burden of using translation tools and improve work and learning efficiency.

[0173] Please refer to Fig.12 and Fig.13 , Fig.12 A schematic diagram of a browser interface involved in an embodiment of the present application is shown. Fig.13 Schematic diagram showing the changes of the translation function sidebar involved in the embodiment of the present application. Fig.12 and Fig.13As shown, when the user views a PDF in a browser, the translation plug-in can be invoked, and the icon of the PDF currently being browsed will be displayed in the control area 1210 (corresponding to the above-mentioned content setting control) below the document translation function. The user can quickly click "Translate" without having to manually upload the document again, thereby improving the overall efficiency and user experience of the tool.

[0174] The detailed interaction of the above scheme is as follows: after clicking "Translate", the user can select the target language (Chinese, English, Japanese, Korean) and the export format (PDF, Word, etc.), the translation progress 1310 is displayed during the translation process, and the icon and link 1320 of the translation result file can be displayed after the translation is completed. The user can also click the Continue Translation control to continue translating other PDF files, click the Bi-text Comparison control to enter the Bi-text Comparison page, or click Go to My File Viewing Space to trigger viewing the translation result file in the My File window.

[0175] In addition to being integrated with the current web page, the translation function sidebar also has the ability to be used independently, including text translation, file translation, and image translation. Users can translate other texts, documents, and images without exiting the current web page, and the four translation functions can be processed in parallel. This independence saves users the time of switching tools and waiting for the translation content to be processed, making the translation tool more easily integrated into daily browser use.

[0176] Text translation: please refer to Fig.14 , which shows a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application, such as Fig.14 As shown, the user inputs or directly pastes the text to be translated into the sidebar input box 1410, which will be automatically translated after input, and supports switching between multiple languages. The translation result is displayed in the display box 1420 below the input box 1410. Optionally, the input box 1410 and the display box 1420 also provide a voice playback control 1430 for triggering the playback of the voice of the corresponding content.

[0177] Image translation: please refer to Fig.15 , which shows a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application, such as Fig.15 As shown, the user uploads or drags the image into the designated area 1510 of the sidebar. The user can also select the source language and target language for translation through the language selection control 1520. After clicking Translate, the translation plug-in will recognize and translate the text in the image, display the translation progress during the translation process, and output the translated image after the translation is completed.

[0178] Document translation: please refer to Fig.16 , which shows a schematic diagram of a change of a translation function sidebar involved in an embodiment of the present application, such as Fig.16As shown, the user can upload the file to be translated or drag it into the designated area 1610 of the sidebar. The user can also select the source language and target language for translation. After clicking Translate, the translation plug-in will translate the text in the file to be translated, display the translation progress during the translation process, and output the translation result file after the translation is completed. The user can double-click the file to preview, "go to my file to view" (corresponding to the above-mentioned file viewing control), or perform a two-text comparison.

[0179] In addition, if Figure 7 As shown, users can enter the bi-text comparison mode after completing web page and document translation. When the user clicks the "bi-text comparison" option (i.e. the file comparison control mentioned above), a left-right split-screen layout will be adopted to clearly display the original text and the translation. The page also incorporates an intelligent mouse hover highlight function. When the user selects a sentence with the mouse, the original text and the corresponding translation will be highlighted at the same time. The user can quickly locate the corresponding translation position, facilitating detailed comparison and analysis.

[0180] The solution shown in the above embodiment of the present application can be implemented as a translation plug-in for the browser sidebar, supporting functions such as web page translation, document translation, image translation, text translation, and translation source text and translation comparison. Figures 17 to 19 , which shows three translation process schematic diagrams involved in the embodiments of the present application.

[0181] like Fig.17 As shown, after the user opens a foreign language web page and opens the translation plug-in, clicks the translation button, and the plug-in performs the translation operation. When it is detected that the page language can be translated, a translation request is made to replace the page content. After the translation is successful, the user browses the translated web page. At the same time, the user can compare Chinese and foreign languages ​​and browse more detailed translation results. If the translation fails, a prompt will be given to inform the user that the translation failed or the current page does not support translation. Among them, the translation process of the above web page can include the following steps:

[0182] Step S1701: The user opens a web page through a browser.

[0183] Step S1702: the translation plug-in is started.

[0184] The translation plug-in may be started automatically when the browser is opened, or the translation plug-in may be started when the browser receives an operation by a user triggering a translation function.

[0185] Step S1703: The plug-in detects the page language.

[0186] After the translation plug-in is started, or after the translation plug-in receives an operation executed by a user to trigger webpage translation, the main language of the webpage currently displayed in the webpage page of the browser can be identified.

[0187] Step S1704: The plug-in issues a translation request.

[0188] The translation plug-in can send a translation request to the server, and the translation request can include the content of the current web page, or include the address of the current web page.

[0189] Step S1705: the server processes the translation request.

[0190] After receiving the translation request, the server can obtain the content of the current webpage according to the translation request and translate the content of the current webpage.

[0191] Step S1706: The plug-in receives the translation result.

[0192] The server returns the translation result to the translation plug-in, and the translation plug-in receives the translation result.

[0193] Step S1707: Display a prompt indicating that the translation failed / translation is not supported.

[0194] If step S1703 identifies that the main language of the currently displayed web page is the preset translation target language, a prompt that the current page is not supported may be displayed; if the server returns a translation failure response, a translation failure prompt may be displayed.

[0195] Step S1708, replace the web page content.

[0196] If the server successfully translates the web page, the translation plug-in can replace the content of the current web page with the translated content, for example, keeping the structure of the web page unchanged and replacing the text in the current web page with the translated text.

[0197] Step S1709: the user browses the translated web page.

[0198] Step S1710, display a bilingual comparison button.

[0199] Step S1711, obtaining the original text and the translated text.

[0200] After the user clicks the above-mentioned double-text comparison button, the translation plug-in can obtain the original text and translation of the web page.

[0201] Step S1712, obtaining the Document Object Model (DOM) of the original and translated web pages.

[0202] Step S1713, rendering a bilingual comparison page.

[0203] The browser can render the original web page and the translated web page in separate columns according to the DOM of the original and translated web pages.

[0204] like Fig.18 As shown, when the user translates a document / image, the user clicks the "Upload Document / Image" button and selects the document / image to be translated. The system receives and parses the uploaded file and extracts the file stream. After the user selects the language for translation, the file stream is uploaded to the server, and then a rotation translation operation is performed. If the translation is successful, the translated document link / image link is returned and silently downloaded to the user's default download path. After that, the user can choose to compare the two documents / images to browse more detailed translation results. If the translation fails, a corresponding prompt will be given. Among them, the translation process of the above-mentioned files / images may include the following steps:

[0205] Step S1801: The translation plug-in is started.

[0206] Step S1802, the user clicks the upload document / picture button.

[0207] The user can select the document or picture to upload from the terminal by clicking the Upload Document / Picture button.

[0208] Step S1803, parse the uploaded file and obtain the file stream.

[0209] After the translation plug-in determines the document or image uploaded by the user, it can parse the file of the document or image and obtain the file stream.

[0210] Step S1804: The file stream is transmitted to the server.

[0211] The translation plugin can stream the above files to the server via translation requests.

[0212] Step S1805: the server performs translation.

[0213] The server can receive the above file stream, obtain the document or image to be translated, parse or recognize the text in the document or image and perform translation.

[0214] Step S1806: prompt of translation failure.

[0215] If the server translation fails, a translation failure response may be returned to the translation plug-in, and the translation plug-in may display a translation failure prompt.

[0216] Step S1807, returning the successfully translated file link.

[0217] If the server translation is successful, a link to the successfully translated file can be returned to the translation plug-in.

[0218] Step S1808, download to the default path.

[0219] The translation plug-in can download the successfully translated files silently in the background according to the successfully translated file links and store them in the default storage path.

[0220] Step S1809, display the bilingual comparison button.

[0221] Step S1810, obtaining the original text and the translated text.

[0222] Step S1811, jump to a new web page tab Tab.

[0223] The translation plug-in can control the browser to automatically jump to a new web page Tab.

[0224] Step S1812, rendering a bilingual comparison page.

[0225] like Fig.19 As shown, the text translation module monitors changes in user input content. After the input stops, if the original language is not selected, the input language will be detected, and then the text content will be translated through the translation interface. After the server processes the translation request, the plug-in receives the translation result for display. Click the play button to request the audio stream file. After obtaining the data, parse the audio stream to obtain the audio data (such as an audio file link), and pass it to the audio (Audio) object for playback. Among them, the translation process of the above file / picture can include the following steps:

[0226] Step S1901, the translation plug-in is started.

[0227] Step S1902: The user inputs a translation source text.

[0228] Step S1903, automatically detecting the language of the input text.

[0229] If the user does not set a source language for the translation, the translation plugin can identify the language of the input text.

[0230] If the user does not set the target language for translation, the translation plug-in can also set the target language for translation by default based on the recognized source language of the input text.

[0231] Step S1904: issuing a translation request.

[0232] The translation plug-in sends a translation request to the server according to the source language and target language set or identified by the user, and the translation request may include the above-mentioned translation source text.

[0233] Step S1905: the server processes the translation request.

[0234] Step S1906, returning and displaying the translation result.

[0235] Step S1907, the user clicks the voice play button.

[0236] Step S1908, requesting the audio stream file.

[0237] The translation plug-in can request the audio stream file of the translated text from the server, and the server returns the audio stream file.

[0238] Step S1909, parse the returned audio stream file.

[0239] Step S1910, audio playback.

[0240] The translation plug-in can call the audio object to play the audio stream file.

[0241] The solution shown in the above embodiment of the present application can achieve the following effects:

[0242] 1) The browser sidebar plug-in provides an instant translation function, and users can call the translation service at any time while browsing the web without leaving the current page or switching applications.

[0243] 2) Provides a simple and intuitive user interface that users can easily operate without a complicated learning process. The translation results will be directly displayed in the sidebar, allowing users to quickly obtain the required translation content.

[0244] 3) Supports directly dragging documents to the sidebar for translation. Users can quickly process PDF, Word and other file types, reducing operation steps and improving work efficiency.

[0245] 4) By integrating the translation functions of documents, web pages, images and texts into one tool, users do not need to use multiple different translation tools, which greatly improves efficiency and convenience.

[0246] Please refer to Fig. 20 , which shows a structural block diagram of a translation device provided by an exemplary embodiment of the present application, and the translation device can be used to execute all or part of the steps in the translation method shown in the above embodiments of the present application; the translation device includes:

[0247] The interface display module 2001 is used to display the web page and the translation function sidebar in parallel in the browser interface; the translation function sidebar includes a web page translation control and a non-web page translation control;

[0248] The webpage translation result display module 2002 is used to display the translation result of the webpage in the webpage page in response to the webpage being displayed in the webpage page and receiving the first trigger operation of the webpage translation control;

[0249] The translation information display module 2003 is used to display the translation information of the custom content in the translation function sidebar in response to receiving the second trigger operation on the non-webpage translation control; the custom content is the non-webpage content.

[0250] In a possible implementation, the custom content includes a translation source file in a specified file format; the translation information display module 2003 is used to:

[0251] In response to the second trigger operation, during the process of translating the translation source file, displaying the translation progress of the translation source file in the translation function sidebar;

[0252] In response to the translation of the translation source file being completed, the translation result of the translation source file is displayed in the translation function sidebar.

[0253] In a possible implementation manner, the translation result includes at least one of an icon and a link of a translation result file corresponding to the translation source file.

[0254] In a possible implementation, the device further includes: a first control display module, which displays at least one of the following controls in the translation function sidebar in response to completion of the translation of the translation source file:

[0255] A file comparison control, used for triggering the display of the file content of the translation result file corresponding to the translation source file and the file content of the translation source file in columns on the web page;

[0256] The file viewing control is used to trigger the opening of a file location, where the file location is the location where the translation result file is saved.

[0257] In a possible implementation, the device further includes: a translation file display module, configured to display the file content of the translation result file corresponding to the translation source file in the web page in response to receiving a trigger operation of the translation result of the translation source file.

[0258] In a possible implementation, the custom content includes a translation source file in a specified file format; the translation function sidebar also includes a content setting control; the device also includes: a first source file acquisition module, which is used to obtain the file in the specified file format corresponding to the third trigger operation as the translation source file in response to receiving a third trigger operation on the content setting control before the translation information display module 2003 responds to receiving a second trigger operation on the non-web page translation control and displays the translation information of the custom content corresponding to the second trigger operation in the translation function sidebar.

[0259] In a possible implementation manner, the third trigger operation includes one or more of the following operations:

[0260] An operation of dragging the file of the specified file format to the content setting control;

[0261] Click the content setting control to select a file of the specified file format in the pop-up file selection window;

[0262] An operation of copying and pasting a file link to the content setting control, wherein the file link is a link to a file in the specified file format contained in the web page displayed on the web page;

[0263] The operation of copying and pasting the file of the specified file format in the web page displayed on the web page to the content setting control.

[0264] In a possible implementation, the custom content includes a translation source file in a specified file format; the device also includes: a second source file acquisition module, which is used to obtain the file in the specified file format displayed on the web page as the translation source file in response to displaying the content of the file in the specified file format through the web page, before the translation information display module 2003 responds to receiving a second trigger operation on the non-web translation control and displays the translation information of the custom content corresponding to the second trigger operation in the translation function sidebar.

[0265] In a possible implementation, the specified file format includes one or more of the following formats: transplant document format PDF, presentation PPT, compressed file format, rich text format, plain text format, table format, and picture format.

[0266] In a possible implementation, the custom content includes a translation source text; the translation function sidebar also includes a source text input box and a translation text display box; the device further includes:

[0267] A source text acquisition module, used for acquiring the translation source text filled in the source text input box before the translation information of the custom content is displayed in the translation function sidebar in response to receiving the second trigger operation on the non-webpage translation control in the translation information display module 2003;

[0268] The translation information display module 2003 is used to display the translation result text corresponding to the translation source text in the translation text display box in response to receiving the second trigger operation.

[0269] In a possible implementation manner, the device further includes:

[0270] The text filling module is used to fill the first text into the source text input box in response to the first text being selected before the source text acquisition module acquires the translation source text filled in the source text input box; the first text is all or part of the text in the web page displayed on the web page.

[0271] In a possible implementation, the translation function sidebar includes a language selection control; the device also includes: a language determination module, which is used to determine at least one of a source language and a target language for performing the custom translation in response to receiving a fourth trigger operation on the language selection control.

[0272] In a possible implementation, the device further includes: a column display module, configured to display the web page and the translation result of the custom content in columns on the web page.

[0273] In a possible implementation, the custom content includes a first text in the web page; the translation result of the custom content includes a second text translated from the first text; and the first text and the second text have the same height in the web page.

[0274] In a possible implementation manner, the device further includes:

[0275] The second control display module is configured to display one or more of the following controls in the translation function sidebar in response to the webpage displaying the translation result of the webpage:

[0276] Return control, used to trigger display of the web page in the web page;

[0277] The web page comparison control is used to trigger the display of the web page and the translation result of the web page in columns in the web page.

[0278] In a possible implementation, the translation function sidebar further includes a webpage translation setting entry control; the device further includes: a setting window display module, configured to display a webpage translation setting window in response to a fifth trigger operation on the webpage translation setting entry control, wherein the webpage translation setting window includes at least one of the following controls:

[0279] The original text prompt control is used to turn on or off the original text prompt function; the original text prompt function is used to prompt the original text in the web page corresponding to the selected translation when the translation result in the web page is selected;

[0280] Automatic translation control, used to turn on or off the function of automatically translating web pages in languages ​​other than the specified language;

[0281] Specify a webpage translation control to turn on or off the function of automatically translating a specified webpage;

[0282] A word-marking translation control, used to turn on or off a word-marking translation function, wherein the word-marking translation function is used to translate the original text when the original text in the webpage is selected;

[0283] A control for setting the language of word-marking translation, used to set the language in which the word-marking translation function is effective;

[0284] The word-marking translation triggering mode setting control is used to set the triggering mode of the word-marking translation function.

[0285] Please refer to Fig.21 , Fig.21 21 is a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application. The computer device 2100 includes a central processing unit (CPU) 2101, a system memory 2104 including a random access memory (RAM) 2102 and a read-only memory (ROM) 2103, and a system bus 2105 connecting the system memory 2104 and the central processing unit 2101. The computer device 2100 also includes a basic input / output system (I / O system) 2106 that helps transmit information between various devices in the computer, and a large-capacity storage device 2107 for storing an operating system 2113, application programs 2114 and other program modules 2110.

[0286] The basic input / output system 2106 includes a display 2108 for displaying information and an input device 2109 such as a mouse and a keyboard for user inputting information. The display 2108 and the input device 2109 are connected to the central processing unit 2101 through an input / output controller 2110 connected to the system bus 2105. The basic input / output system 2106 may also include an input / output controller 2110 for receiving and processing inputs from a plurality of other devices such as a keyboard, a mouse, or an electronic stylus. Similarly, the input / output controller 2110 also provides output to a display screen, a printer, or other types of output devices.

[0287] The mass storage device 2107 is connected to the central processing unit 2101 via a mass storage controller (not shown) connected to the system bus 2105. The mass storage device 2107 and its associated computer readable medium provide non-volatile storage for the computer device 2100. That is, the mass storage device 2107 may include a computer readable medium (not shown) such as a hard disk or a CD-ROM (Compact Disc Read-Only Memory) drive.

[0288] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory or other solid-state storage technologies, CD-ROM, DVD (Digital Video Disc) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage media is not limited to the above. The above-mentioned system memory 2104 and mass storage device 2107 can be collectively referred to as memory.

[0289] The computer device 2100 can be connected to the Internet or other network devices through a network interface unit 2111 connected to the system bus 2105 .

[0290] The memory also includes one or more programs / instructions, which are stored in the memory. The central processing unit 2101 implements all or part of the steps in the methods shown in the above-mentioned embodiments of the present application by executing the one or more programs / instructions.

[0291] In an exemplary embodiment, an embodiment of the present application provides a chip, which includes a programmable logic circuit and / or program instructions. When the chip runs on a computer device, it is used to implement the translation method provided in the above method embodiment.

[0292] An embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the translation method provided in the above method embodiment.

[0293] The embodiment of the present application provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, so that the processor loads and executes the computer instructions to implement the translation method provided in the above method embodiment.

[0294] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0295] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned computer-readable storage medium may be a read-only memory, a disk or an optical disk, etc.

[0296] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.

[0297] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A translation method, characterized in that: The method comprises: Displaying a web page and a translation function sidebar in parallel in a browser interface; the translation function sidebar includes a web page translation control and a non-web page translation control; In response to a web page being displayed on the web page and receiving a first trigger operation on the web page translation control, displaying a translation result of the web page on the web page; In response to receiving a second trigger operation on the non-webpage translation control, displaying translation information of custom content in the translation function sidebar; the custom content is non-webpage content.

2. The method according to claim 1, characterized in that The custom content includes a translation source file in a specified file format; In response to receiving a second trigger operation on the non-webpage translation control, displaying translation information of the custom content corresponding to the second trigger operation in the translation function sidebar includes: In response to the second trigger operation, during the process of translating the translation source file, displaying the translation progress of the translation source file in the translation function sidebar; In response to the translation of the translation source file being completed, the translation result of the translation source file is displayed in the translation function sidebar.

3. The method according to claim 2, characterized in that The translation result includes at least one of an icon and a link of a translation result file corresponding to the translation source file.

4. The method according to claim 2 or 3, characterized in that: The method further comprises: In response to the translation of the translation source file being completed, at least one of the following controls is displayed in the translation function sidebar: A file comparison control, used for triggering the display of the file content of the translation result file corresponding to the translation source file and the file content of the translation source file in columns on the web page; The file viewing control is used to trigger the opening of a file location, where the file location is the location where the translation result file is saved.

5. The method according to any one of claims 2 to 4, characterized in that: The method further comprises: In response to receiving a triggering operation of a translation result of the translation source file, the file content of the translation result file corresponding to the translation source file is displayed on the web page.

6. The method according to any one of claims 1 to 5, characterized in that: The custom content includes a translation source file in a specified file format; the translation function sidebar also includes a content setting control; In response to receiving a second trigger operation on the non-webpage translation control, before displaying the translation information of the custom content corresponding to the second trigger operation in the translation function sidebar, the method further includes: In response to receiving a third trigger operation on the content setting control, the file in the specified file format corresponding to the third trigger operation is acquired as the translation source file.

7. The method according to claim 6, characterized in that The third trigger operation includes one or more of the following operations: An operation of dragging the file of the specified file format to the content setting control; Click the content setting control to select a file of the specified file format in the pop-up file selection window; An operation of copying and pasting a file link to the content setting control, wherein the file link is a link to a file in the specified file format contained in the web page displayed on the web page; The operation of copying and pasting the file of the specified file format in the web page displayed on the web page to the content setting control.

8. The method according to any one of claims 1 to 5, characterized in that: The custom content includes a translation source file in a specified file format; In response to receiving a second trigger operation on the non-webpage translation control, before displaying the translation information of the custom content corresponding to the second trigger operation in the translation function sidebar, the method further includes: In response to the content of the file in the specified file format being displayed on the web page, the file in the specified file format displayed on the web page is acquired as the translation source file.

9. The method according to any one of claims 2 to 8, characterized in that: The specified file format includes one or more of the following formats: Migrate document formats PDF, presentation PPT, compressed file formats, rich text formats, plain text formats, table formats, and image formats.

10. The method according to claim 1, characterized in that The custom content includes a translation source text; the translation function sidebar also includes a source text input box and a translation text display box; In response to receiving a second trigger operation on the non-webpage translation control, before displaying the translation information of the custom content in the translation function sidebar, the method further includes: Obtaining the translation source text filled in the source text input box; In response to receiving a second trigger operation on the non-webpage translation control, displaying translation information of the custom content in the translation function sidebar includes: In response to receiving the second trigger operation, displaying a translation result text corresponding to the translation source text in the translation text display box.

11. The method according to claim 10, characterized in that Before obtaining the translation source text filled in the source text input box, the method further includes: In response to the first text being selected, the first text is filled into the source text input box; the first text is all or part of the text in the web page displayed on the web page.

12. The method according to any one of claims 1 to 11, characterized in that: The translation function sidebar includes a language selection control; the method further includes: In response to receiving a fourth trigger operation on the language selection control, at least one of a source language and a target language for performing translation on the custom language is determined.

13. The method according to any one of claims 1 to 12, characterized in that: The method further comprises: In the web page, the web page and the translation results of the custom content are displayed in columns.

14. The method according to claim 13, characterized in that The custom content includes a first text in the web page; the translation result of the custom content includes a second text translated from the first text; the first text and the second text have the same height in the web page.

15. The method according to any one of claims 1 to 14, characterized in that: The method further comprises: In response to the webpage displaying the translation result of the webpage, one or more of the following controls are displayed in the translation function sidebar: Return control, used to trigger display of the web page in the web page; The web page comparison control is used to trigger the display of the web page and the translation result of the web page in columns in the web page.

16. The method according to any one of claims 1 to 15, characterized in that: The translation function sidebar also includes a webpage translation setting entry control; the method also includes: In response to the fifth triggering operation on the webpage translation setting entry control, a webpage translation setting window is displayed, wherein the webpage translation setting window includes at least one of the following controls: The original text prompt control is used to turn on or off the original text prompt function; the original text prompt function is used to prompt the original text in the web page corresponding to the selected translation when the translation result in the web page is selected; Automatic translation control, used to turn on or off the function of automatically translating web pages in languages ​​other than the specified language; Specify a webpage translation control to turn on or off the function of automatically translating a specified webpage; A word-marking translation control, used to turn on or off a word-marking translation function, wherein the word-marking translation function is used to translate the original text when the original text in the webpage is selected; A control for setting the language of word-marking translation, used to set the language in which the word-marking translation function is effective; The word-marking translation triggering mode setting control is used to set the triggering mode of the word-marking translation function.

17. A translation device, characterized in that: The device comprises: An interface display module, used to display web pages and a translation function sidebar in parallel in a browser interface; the translation function sidebar includes a web page translation control and a non-web page translation control; A webpage translation result display module, configured to display a translation result of the webpage in the webpage page in response to a webpage being displayed in the webpage page and receiving a first trigger operation on the webpage translation control; The translation information display module is used to display the translation information of the custom content in the translation function sidebar in response to receiving a second trigger operation on the non-webpage translation control; the custom content is the non-webpage content.

18. A computer device, characterized in that: The computer device comprises: a processor and a memory, wherein the memory stores a computer program, and the computer program is loaded and executed by the processor to implement the translation method according to any one of claims 1 to 16.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is loaded and executed by a processor to implement the translation method according to any one of claims 1 to 16.

20. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor obtains the computer instructions from the computer-readable storage medium, so that the processor loads and executes the computer instructions to implement the translation method according to any one of claims 1 to 16.