WO2021197094A1 - Translation text display - Google Patents

Translation text display Download PDF

Info

Publication number
WO2021197094A1
WO2021197094A1 PCT/CN2021/081742 CN2021081742W WO2021197094A1 WO 2021197094 A1 WO2021197094 A1 WO 2021197094A1 CN 2021081742 W CN2021081742 W CN 2021081742W WO 2021197094 A1 WO2021197094 A1 WO 2021197094A1
Authority
WO
WIPO (PCT)
Prior art keywords
translation
floating layer
display
target screenshot
copy
Prior art date
Application number
PCT/CN2021/081742
Other languages
French (fr)
Chinese (zh)
Inventor
胡伟韬
潘勇
顾健旭
李岩
Original Assignee
支付宝实验室(新加坡)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 支付宝实验室(新加坡)有限公司 filed Critical 支付宝实验室(新加坡)有限公司
Publication of WO2021197094A1 publication Critical patent/WO2021197094A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/40Processing or translation of natural language
    • G06F40/42Data-driven translation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/454Multi-language systems; Localisation; Internationalisation

Definitions

  • the embodiments of this specification relate to the field of display, and in particular to a method, system and storage medium for displaying translated texts.
  • the embodiments of this specification provide a translation copy display method, system and storage medium, so that the translation copy UI has user interaction capabilities, and it is convenient for users to compare the translation copy with the original copy.
  • the embodiment of this specification provides a translation copy display method, which is applied to a mobile terminal, and the method includes: if a user's translation start operation is detected, intercepting the current screen content of the mobile terminal to obtain a target screenshot, The target screenshot contains more than one translation object; the translation copy of each translation object on the target screenshot is obtained; the target screenshot is displayed, and for each translation object on the target screenshot, the translation object is located A translation display floating layer is created in the text line area, and the translation text corresponding to the translation object is added to the translation display floating layer for display.
  • the embodiment of this specification provides a translation copy display device, which is applied to a mobile terminal, and the device includes: a first operation detection unit configured to intercept the current translation of the mobile terminal if the user's translation start operation is detected Screen content, obtain a target screenshot, the target screenshot contains more than one translation object; a copy acquisition unit, used to obtain the translation copy of each translation object on the target screenshot; a copy display unit, used to display the target screenshot, And for each translation object on the target screenshot, a translation display floating layer is created in the text line area where the translation object is located, and the translation copy corresponding to the translation object is added to the translation display floating layer for display .
  • an embodiment of this specification provides a translation system, including: a mobile terminal, configured to intercept the current screen content of the mobile terminal to obtain a target screenshot if a user's translation activation operation is detected, and send the target screenshot to The server side, the target screenshot contains more than one translation object; the server side, is used to process the target screenshot to obtain the translation copy of each translation object on the target screenshot, and send the translation copy to the The mobile terminal; the mobile terminal is also used to display the target screenshot, and for each translation object on the target screenshot, create a translation display floating layer in the text line area of the translation object, which will be compared with the The translation copy corresponding to the translation object is added to the translation display floating layer for display.
  • an embodiment of the present specification provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
  • the processor implements the program described in the first aspect when the program is executed. Method steps.
  • the embodiments of this specification provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect are implemented.
  • the target screenshot is obtained by intercepting the screen content containing the translation object, and the translation display floating layer is created in the text line area where the translation object is located on the target screenshot.
  • Display the translation copy of the translation object so that the translation copy will not replace the translation object, but the translation copy and the translation object can exist at the same time, which facilitates the comparison between the translation copy and the translation object, and improves the user experience.
  • the translation copy display method provided by the embodiment of this specification is applied to the text translation displayed on the APP page, it is convenient for the user to understand the scene content displayed in the APP more quickly and accurately.
  • Figure 1 is a system architecture diagram of the translation system in the embodiment of the specification
  • Figure 2 is a schematic flow diagram of a method for displaying translated text in an embodiment of the specification
  • Figure 3 is a schematic diagram of a screenshot of a target captured in an embodiment of the specification
  • Figure 4 is a schematic diagram showing the effect of the translation copy in the embodiment of the specification.
  • Figure 5 is a schematic diagram showing the effect of unfolding the translation to show the floating layer in the embodiment of the specification
  • FIG. 6 is a schematic diagram of the effect of moving the translation to display the floating layer in the embodiment of the specification.
  • FIG. 7 is a schematic diagram of the effect of the translation copy display device in the embodiment of the specification.
  • Fig. 8 is a schematic structural diagram of a mobile terminal in an embodiment of this specification.
  • the embodiments of this specification provide a translation system architecture that implements the method for displaying translated texts.
  • the translation system includes a mobile terminal 10 and a server 20.
  • the mobile terminal 10 may be a terminal device such as a smart phone, a tablet computer, etc. If the mobile terminal 10 detects the user's translation start operation, it will intercept the current screen content of the mobile terminal 10 to obtain the corresponding screen content. Target screenshot, where the target screenshot contains more than one translation object. The mobile terminal 10 sends the target screenshot to the server 20.
  • the server 20 is used to process the target screenshot, obtain the translation copy of each translation object on the target screenshot, and send the translation copy to the mobile terminal 10.
  • a text detection model and a translation model are deployed on the server 20.
  • the server 20 detects each translation object from the target screenshot received from the mobile terminal 10 through the text detection model, and then translates each translation object through the translation model.
  • the translation copy corresponding to the translation object is obtained, and the server 20 feeds back each translation copy to the mobile terminal 10.
  • the target screenshot is displayed on the mobile terminal 10, a translation display floating layer is created in the text line area of each translation object on the target screenshot, and the translation text corresponding to the translation object is added to the corresponding translation display floating layer for display, so that the translation
  • the copy is floating on the upper layer corresponding to the translation object on the target screenshot, thereby ensuring that the translation copy and the translation object can exist at the same time, and it is convenient for users to compare the content between the translation copy and the translation object.
  • a target application is installed on the mobile terminal 10, and the target application may be a social application, a shopping application, and other apps that have requirements for delivery in multiple countries.
  • Add a translation applet in the target application When the target application is running in the foreground, the mobile terminal 10 interacts with the server 20 through the translation applet to realize a block of text content displayed in the application page of the target application (for example, a text content block). It is a translation object) for translation, and the translation copy corresponding to the text content block is displayed in the text line area where the text content block is located in the form of a translation display floating layer, so that the translation copy floats on the upper layer of the text content block.
  • a translation application can also be installed in the mobile terminal 10, and the translation application interacts with the server 20 through the translation application to implement translation of the text content block displayed in the application page of any foreground running application on the mobile terminal 10. , And display the translation copy corresponding to the text content block in the form of translation display floating layer.
  • the embodiment of this specification provides a method for displaying translated text, which is applied to the mobile terminal as shown in FIG. 1.
  • the following describes the translation copy display method provided by the embodiment of this specification with reference to FIG. 1 and FIG. 2.
  • Fig. 2 is a schematic flow chart of the method for displaying a translation copy in an embodiment of the specification.
  • the method for displaying a translation copy provided in an embodiment of the specification includes the following steps S200-S204:
  • the mobile terminal If the mobile terminal detects the user's translation start operation, it intercepts the current screen content of the mobile terminal to obtain a target screenshot corresponding to the current screen content, and the target screenshot contains more than one translation object.
  • the translation applet added in the target application is started, and the translation applet after the startup is provided to the user for the translation operation portal, and the user performs the translation start operation through the translation operation portal.
  • the translation operation entry may be as shown in FIG. 3, which is displayed in a fixed position on the application page with a floating button component, for example, a floating button component implemented with a fixed div, displayed in the lower right corner of the current screen.
  • a floating button component for example, a floating button component implemented with a fixed div, displayed in the lower right corner of the current screen.
  • the current screen content of the mobile terminal is captured to obtain a target screenshot corresponding to the current screen content.
  • the target screenshot may be: a screenshot image obtained by taking a screenshot of the mobile terminal or scrolling the screenshot, the screenshot image contains the current application page of the target application, and the screenshot image can be referred to as shown in FIG. 3.
  • the target screenshot may be a screenshot of the application page obtained by taking a screenshot of the current application page of the target application.
  • the target screenshot contains more than one translation object.
  • Each translation object is more than one text in the form of an image in the target screenshot.
  • Each translation object on the target screenshot is independent of each other.
  • the mobile terminal obtains the translation text of each translation object in the target screenshot.
  • the translation copy of each translation object on the target screenshot is obtained.
  • the process of processing the target screenshot to obtain the translated text can be executed by the mobile terminal or the server. In view of the large amount of calculation in the processing process, it is best to be executed by the server.
  • the mobile terminal sends the target screenshot to the server.
  • the server performs text detection on the received target screenshot through the text detection model, and obtains each translation object on the target screenshot.
  • the text detection model may be an OCR (Optical Character Recognition) model.
  • OCR model is used to perform OCR recognition on the target screenshot to obtain a recognition result queue.
  • the recognition result queue contains more than one recognition result
  • the recognition result and the translation object are one object
  • each recognition result contains the translation object in text format
  • the translation object represented in the text format in the recognition result can be a single word, a single word, a sequence of words, or more than one sentence.
  • the server translates the translation object represented in the text format in the recognition result through the translation model, and obtains the translation copy corresponding to the translation object.
  • the server feeds back each translation text it gets to the mobile terminal.
  • the mobile terminal receives the translation copy of each translation object on the target screenshot from the server.
  • the process of processing the target screenshot on the mobile terminal to obtain the translation copy is similar to the aforementioned process of processing the target screenshot to obtain the translation copy.
  • the specific execution sequence of step S204 may be: create translation display floating layers in the text line area where each translation object is located on the target screenshot, and write the floating layer in the container of each translation display floating layer.
  • the translation copy corresponding to the translation object in order to obtain the result of the splicing of the target screenshot and the translation copy, and display the splicing result, so as to avoid the loss of the original copy information caused by the translation copy cover and the replacement of the translation target, and to avoid the user's translation The inconvenience caused by the understanding of the content.
  • the specific execution order of step S204 can also be: first display the target screenshot after obtaining the target screenshot, and create the i-th translation display after obtaining the i-th translation copy corresponding to the i-th translation object on the target screenshot Floating layer and write the i-th translation copy in the i-th translation display floating layer, and add the i-th translation display floating layer after the i-th translation copy is written into the text line area where the i-th translation object is located on the target screenshot.
  • the size of the translation copy is different from the size of the translation object.
  • the implementation process of creating a translation display floating layer is: for each translation object on the target screenshot, determine the relative coordinate information of the text line area where the translation object is located.
  • the target screenshot contains N translation objects, and N is a positive integer;
  • the relative coordinate information of the text line area where the i-th translation object is located on the target screenshot creates a floating layer of the i-th translation display that matches the text line area where the i-th translation object is located, and i takes 1 to N in turn.
  • the i-th translation display floating layer according to the area position of the text line area where the i-th translation object is located, adds the i-th translation display floating layer to the upper layer of the target screenshot to cover the text line area where the i-th translation object is located.
  • the relative coordinate information of the text line area where each translation object is located specifically refers to: the diagonal coordinates (x1, y1), (x2, y2) of the text line area where the translation object is located.
  • the relative coordinate information of the text line area where each translation object is located on the target screenshot also comes from the server, which has been explained in the foregoing and will not be repeated here.
  • each created translation display floating layer will not cover the text line area where any translation object except the corresponding translation object is located, showing the effect of the translation copy. Refer to Figure 4 to improve the display effect of the translated text.
  • Implementation mode one is a mode that is a sub-th translation copy of the original floating layer size of the i-th translation display floating layer, and i is sequentially selected from 1 to N to more rationally translate the copy.
  • Implementation mode one is a mode that is a sub-th translation copy of the original floating layer size of the i-th translation display floating layer, and i is sequentially selected from 1 to N to more rationally translate the copy.
  • the user's expansion operation on the i-th translation display floating layer is detected, expand the i-th translation display floating layer; Display the complete translation content of the i-th translation copy in the expanded float size of the i-th translation display floating layer. If it is detected that the user restores the i-th translation display floating layer after unfolding, the original floating layer size of the i-th translation display floating layer and the partial translation content of the i-th translation copy displayed in the original floating layer size are restored.
  • the trigger operation for expanding and restoring the i-th translation display floating layer can be predefined as any of the following:
  • an expandable mark is set on each expandable translation display floating layer on the target screenshot. Refer to the triangle mark set on the translation display floating layer as shown in Figure 4 to identify the expandable translation display floating layer. , It is convenient for users to distinguish whether the translation display floating layer can be expanded, and the user experience is improved.
  • FIG. 5 illustrates the translation copy corresponding to the translation object "cross-border traffic"
  • the effect of unfolding shows that the translation copy UI has user-interactive capabilities, which enables users to quickly view the complete translation content through gesture operations, avoiding the problem of excessively long translated copy text and incomplete display.
  • the text size for displaying the i-th translation copy calculates the text size for displaying the i-th translation copy; use the calculated text size to display the translation copy in the translation display floating layer
  • the complete translation content of is displayed in the i-th translation display floating layer.
  • the complete translation content corresponding to the i-th translation copy is displayed in the expansion floating layer size of the i-th translation display floating layer with a preset standard text size.
  • the floating layer is displayed for each translation created on the target screenshot. If the user's movement operation on the translation display floating layer is detected, it will be based on the operation of the movement operation.
  • the information moves the translation display floating layer so that the translation copy that shields the translation object can be moved to other areas, so that the translation object and the translation copy can be displayed at the same time, so as to compare the content before and after translation, and show the moving effect of the floating layer in the translation.
  • Figure 6 which illustrates the effect of moving the translation text corresponding to the translation object "cross-border traffic”.
  • the movement operation is specifically a drag operation.
  • obtain the drag trajectory of the user's drag operation on the translation display floating layer obtain the drag trajectory of the user's drag operation on the translation display floating layer; move the translation display floating layer according to the drag trajectory to move to the text line area corresponding to the translation object Outside.
  • the translation display floating layer is moved back to the original display area of the translation display floating layer.
  • the original display area of the translation display floating layer is the text line corresponding to the translation object. area. According to the relative coordinate information of the text line area where the corresponding translation object is located, the translation display floating layer is moved back to the original display area of the translation display floating layer. Avoid the floating layer of the translated translation after moving to affect the display of other translation texts.
  • the position coordinates at the end of the drag operation are determined, and the translation display floating layer stays on the target screenshot according to the position indicated by the position coordinates.
  • the i-th translation display floating layer Take the i-th translation display floating layer as an example, if the user's drag operation on the i-th translation display floating layer is detected, the i-th translation display floating layer is moved according to the drag trajectory of the drag operation, and the drag operation ends When, move the i-th translation display floating layer back to the text line area where the i-th translation object is displayed.
  • click and drag operations can be combined to display the translated text of the translated text and display the floating layer to improve the user experience of multilingual translation:
  • any translation display floating layer displayed on the target screenshot when the user's click operation on the translation display floating layer is detected, the translation display floating layer is expanded from the original floating layer size, and the floating layer is displayed in the translation. The full translation content of the corresponding translation copy is displayed within the expanded floating layer size of the layer. If the user continues to perform a drag operation on the translation display floating layer after the click operation, the drag operation will be detected and the expanded translation will be displayed The floating layer moves according to the drag trajectory of the drag operation. In this process, the corresponding translation object and translation copy will be presented at the same time. When it is detected that the drag operation of the translation display floating layer is completed, the translation display floating layer is moved back to the text line area where the translation object is located, so as to avoid subsequent impact on other content.
  • the user can complete the complete translation view of the translation text and the comparison before and after translation with only one continuous gesture operation formed by clicking + dragging.
  • it is convenient and fast, and is in line with the use characteristics of mobile terminals.
  • each translation display floating layer created on the target screenshot is hidden to show each translation object.
  • the translation hiding operation may be a clicking operation on the translation operation entry.
  • steps S200 to S204 are executed to display the target screenshot
  • Each translation text is displayed in the floating layer of the translation; the current screen content of the mobile terminal is displayed in the floating layer of the translation when the target screenshot of each translation text is displayed, if the click of the floating button component is detected Operation, hide each translation display floating layer displayed on the target screenshot to show the user each translation object on the target screenshot. Therefore, the user's operation complexity is reduced, and multiple interactive operations are realized with a single floating virtual button, which is more concise and more convenient to operate.
  • the embodiment of this specification provides a translation copy display device, which is applied to a mobile terminal.
  • the device includes: a first operation detection unit 701, configured to capture the current screen content of the mobile terminal if the user's translation start operation is detected to obtain a target screenshot, the target screenshot containing more than one Translation object; copy acquisition unit 702, used to obtain the translation copy of each translation object on the target screenshot; the first copy display unit 703, used to display the target screenshot, and for each translation object on the target screenshot , Creating a translation display floating layer in the text line area where the translation object is located, and adding the translation text corresponding to the translation object to the translation display floating layer for display.
  • the first copywriting display unit 703 includes: a coordinate determination subunit, configured to determine the relative coordinate information of the text line area where the translation object is located for each translation object on the target screenshot ,
  • the target screenshot contains N translation objects, and N is a positive integer;
  • the floating layer creation unit is used to create a translation with the i-th translation object based on the relative coordinate information of the text line area where the i-th translation object is located on the target screenshot
  • the i-th translation that matches the text line area where the object is located displays the floating layer, and i takes 1 to N in turn.
  • the first copywriting display unit 703 includes: a comparison subunit for comparing whether the original floating layer size of the i-th translation display floating layer is greater than or equal to the i-th translation copy
  • the size of i is taken from 1 to N in turn; the content display subunit is used to display the complete translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer, otherwise, according to The i-th translation shows the original floating layer size of the floating layer, and part of the translated content of the i-th translation copy is displayed within the original floating layer size of the i-th translation display floating layer.
  • the device further includes: a second operation detection unit 705, configured to display part of the translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer , If the user's expansion operation on the i-th translation display floating layer is detected, then the i-th translation display floating layer will be expanded; Within the layer size, the complete translation content of the i-th translation copy is displayed.
  • a second operation detection unit 705 configured to display part of the translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer , If the user's expansion operation on the i-th translation display floating layer is detected, then the i-th translation display floating layer will be expanded; Within the layer size, the complete translation content of the i-th translation copy is displayed.
  • the device further includes: a copywriting moving unit 704, configured to display a floating layer for each translation created on the target screenshot, and if a user's movement operation on the translation display floating layer is detected , Then move the translation display floating layer according to the operation information of the moving operation.
  • a copywriting moving unit 704 configured to display a floating layer for each translation created on the target screenshot, and if a user's movement operation on the translation display floating layer is detected , Then move the translation display floating layer according to the operation information of the moving operation.
  • the moving operation is a dragging operation
  • the copywriting moving unit 704 includes: a drag trajectory subunit for acquiring the drag operation performed by the user on the translation display floating layer Trajectory, to move the translation display floating layer according to the dragging trajectory; an end determination subunit for moving the translation display floating layer back to the translation display when the end of the drag operation is detected
  • the original display area of the floating layer, or the position coordinates at the end of the drag operation are determined, and the translation display floating layer stays on the target screenshot according to the position indicated by the position coordinates.
  • the copywriting acquisition unit 702 includes: a screenshot sending subunit, configured to send the target screenshot to the server, so that the server processes the target screenshot to generate the The translation copy of each translation object on the target screenshot; the copy receiving subunit is used to receive the translation copy corresponding to the translation object fed back by the server for each translation object on the target screenshot.
  • the device further includes: a copy hiding unit 707, configured to hide each translation display floating layer created on the target screenshot if the user's translation hiding operation is detected.
  • a copy hiding unit 707 configured to hide each translation display floating layer created on the target screenshot if the user's translation hiding operation is detected.
  • an embodiment of this specification also provides a mobile terminal.
  • the server includes a memory 804, a processor 802, and a memory 804.
  • a computer program that can be run on the processor 802. When the processor 802 executes the program, the steps in any of the foregoing embodiments of the translation copy presentation method are implemented.
  • the bus architecture (represented by a bus 800), the bus 800 can include any number of interconnected buses and bridges, and the bus 800 will include one or more processors represented by the processor 802 and a memory 804 represented by The various circuits of the memory are linked together.
  • the bus 800 may also link various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further description is provided herein.
  • the bus interface 805 provides an interface between the bus 800 and the receiver 801 and the transmitter 803.
  • the receiver 801 and the transmitter 803 may be the same element, that is, a transceiver, which provides a unit for communicating with various other devices on the transmission medium.
  • the processor 802 is responsible for managing the bus 800 and general processing, and the memory 804 may be used to store data used by the processor 802 when performing operations.
  • the embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the foregoing Describe the steps of the translation copy display method.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiments of the present description disclose a translation text display method and device, a system, and a storage medium, which are applied to a mobile terminal. Said method comprises: upon detection of a translation start operation of a user, capturing current screen content on a mobile terminal to obtain a target screenshot, the target screenshot containing more than one object to be translated; and displaying the target screenshot, creating, for each of said objects on the target screenshot, a translation display overlay in a text line region where said objects are located, and adding a translation corresponding to said object to the corresponding translation display overlay for display.

Description

翻译文案展示Translation copy display 技术领域Technical field
本说明书实施例涉及显示领域,尤其涉及一种翻译文案展示方法、系统及存储介质。The embodiments of this specification relate to the field of display, and in particular to a method, system and storage medium for displaying translated texts.
背景技术Background technique
随着业务的多国发展,App用户扩展到多个国家,需要App有多国语言能力支持来提供更好的用户体验,因此,用户希望通过翻译APP内显示的文字来理解场景。With the development of business in multiple countries, App users have expanded to multiple countries, and the App has multi-language support to provide a better user experience. Therefore, users hope to understand the scene by translating the text displayed in the APP.
发明内容Summary of the invention
本说明书实施例提供一种翻译文案展示方法、系统及存储介质,使得翻译文案UI具备用户可交互能力,方便用户进行翻译文案与原文案进行对比。The embodiments of this specification provide a translation copy display method, system and storage medium, so that the translation copy UI has user interaction capabilities, and it is convenient for users to compare the translation copy with the original copy.
第一方面,本说明书实施例提供了一种翻译文案展示方法,应用于移动终端,所述方法包括:如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容,得到目标截图,所述目标截图上包含一个以上翻译对象;获得所述目标截图上每个翻译对象的翻译文案;展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。In the first aspect, the embodiment of this specification provides a translation copy display method, which is applied to a mobile terminal, and the method includes: if a user's translation start operation is detected, intercepting the current screen content of the mobile terminal to obtain a target screenshot, The target screenshot contains more than one translation object; the translation copy of each translation object on the target screenshot is obtained; the target screenshot is displayed, and for each translation object on the target screenshot, the translation object is located A translation display floating layer is created in the text line area, and the translation text corresponding to the translation object is added to the translation display floating layer for display.
第二方面,本说明书实施例提供一种翻译文案展示装置,应用于移动终端,所述装置包括:第一操作检测单元,用于如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容,得到目标截图,所述目标截图上包含一个以上翻译对象;文案获取单元,用于获得所述目标截图上每个翻译对象的翻译文案;文案展示单元,用于展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。In the second aspect, the embodiment of this specification provides a translation copy display device, which is applied to a mobile terminal, and the device includes: a first operation detection unit configured to intercept the current translation of the mobile terminal if the user's translation start operation is detected Screen content, obtain a target screenshot, the target screenshot contains more than one translation object; a copy acquisition unit, used to obtain the translation copy of each translation object on the target screenshot; a copy display unit, used to display the target screenshot, And for each translation object on the target screenshot, a translation display floating layer is created in the text line area where the translation object is located, and the translation copy corresponding to the translation object is added to the translation display floating layer for display .
第三方面,本说明书实施例提供一种翻译系统,包括:移动终端,用于如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容得到目标截图,将所述目标截图发送至服务端,所述目标截图上包含一个以上翻译对象;服务端,用于对所述目标截图进行处理,得到所述目标截图上每个翻译对象的翻译文案,并将所述翻译文案发送至 所述移动终端;所述移动终端,还用于展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。In a third aspect, an embodiment of this specification provides a translation system, including: a mobile terminal, configured to intercept the current screen content of the mobile terminal to obtain a target screenshot if a user's translation activation operation is detected, and send the target screenshot to The server side, the target screenshot contains more than one translation object; the server side, is used to process the target screenshot to obtain the translation copy of each translation object on the target screenshot, and send the translation copy to the The mobile terminal; the mobile terminal is also used to display the target screenshot, and for each translation object on the target screenshot, create a translation display floating layer in the text line area of the translation object, which will be compared with the The translation copy corresponding to the translation object is added to the translation display floating layer for display.
第四方面,本说明书实施例提供一种移动终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现第一方面所述方法的步骤。In a fourth aspect, an embodiment of the present specification provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor. The processor implements the program described in the first aspect when the program is executed. Method steps.
第五方面,本说明书实施例提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面所述方法的步骤。In a fifth aspect, the embodiments of this specification provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in the first aspect are implemented.
本说明书实施例提供的一个或者多个技术方案,至少实现了如下技术效果:通过截取包含翻译对象的屏幕内容得到目标截图,对目标截图上翻译对象所在的文本行区域内创建译文展示浮层来展示翻译对象的翻译文案,使得翻译文案不会替换掉翻译对象,而是翻译文案和翻译对象能够同时存在,便于用户进行翻译文案与翻译对象之间的对比,提高了用户体验。The one or more technical solutions provided in the embodiments of this specification at least achieve the following technical effects: the target screenshot is obtained by intercepting the screen content containing the translation object, and the translation display floating layer is created in the text line area where the translation object is located on the target screenshot. Display the translation copy of the translation object, so that the translation copy will not replace the translation object, but the translation copy and the translation object can exist at the same time, which facilitates the comparison between the translation copy and the translation object, and improves the user experience.
进一步的,如果本说明书实施例提供的翻译文案展示方法应用于对APP页面显示的文字翻译,便于用户更快、更准确理解APP内显示的场景内容。Further, if the translation copy display method provided by the embodiment of this specification is applied to the text translation displayed on the APP page, it is convenient for the user to understand the scene content displayed in the APP more quickly and accurately.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only It is an embodiment of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work.
图1为本说明书实施例中翻译系统的系统架构图;Figure 1 is a system architecture diagram of the translation system in the embodiment of the specification;
图2为本说明书实施例中翻译文案展示方法的流程示意图;Figure 2 is a schematic flow diagram of a method for displaying translated text in an embodiment of the specification;
图3为本说明书实施例中截取的目标截图的示意图;Figure 3 is a schematic diagram of a screenshot of a target captured in an embodiment of the specification;
图4为本说明书实施例中展示翻译文案的效果示意图;Figure 4 is a schematic diagram showing the effect of the translation copy in the embodiment of the specification;
图5为本说明书实施例中展开译文展示浮层的效果示意图;Figure 5 is a schematic diagram showing the effect of unfolding the translation to show the floating layer in the embodiment of the specification;
图6为本说明书实施例中移动译文展示浮层的效果示意图;FIG. 6 is a schematic diagram of the effect of moving the translation to display the floating layer in the embodiment of the specification;
图7为本说明书实施例中翻译文案展示装置的效果示意图;FIG. 7 is a schematic diagram of the effect of the translation copy display device in the embodiment of the specification;
图8为本说明书实施例中移动终端的结构示意图。Fig. 8 is a schematic structural diagram of a mobile terminal in an embodiment of this specification.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
第一方面,本说明书实施例提供一种实现翻译文案展示方法的翻译系统架构。参考图1所示,该翻译系统包括移动终端10和服务端20。In the first aspect, the embodiments of this specification provide a translation system architecture that implements the method for displaying translated texts. Referring to FIG. 1, the translation system includes a mobile terminal 10 and a server 20.
在本说明书实施例中,移动终端10可以是智能手机、平板电脑等终端设备,如果移动终端10检测到用户的翻译启动操作,则截取移动终端10的当前屏幕内容,得到与当前屏幕内容对应的目标截图,其中,目标截图上包含一个以上翻译对象。移动终端10将目标截图发送至服务端20。In the embodiment of this specification, the mobile terminal 10 may be a terminal device such as a smart phone, a tablet computer, etc. If the mobile terminal 10 detects the user's translation start operation, it will intercept the current screen content of the mobile terminal 10 to obtain the corresponding screen content. Target screenshot, where the target screenshot contains more than one translation object. The mobile terminal 10 sends the target screenshot to the server 20.
服务端20用于对目标截图进行处理,得到目标截图上每个翻译对象的翻译文案,并将翻译文案发送至移动终端10。服务端20上部署有文本检测模型和翻译模型,服务端20通过文本检测模型对从移动终端10接收到的目标截图中检测得到每个翻译对象,再通过翻译模型对每个翻译对象进行翻译,得到该翻译对象对应的翻译文案,服务端20将每个翻译文案反馈至移动终端10。The server 20 is used to process the target screenshot, obtain the translation copy of each translation object on the target screenshot, and send the translation copy to the mobile terminal 10. A text detection model and a translation model are deployed on the server 20. The server 20 detects each translation object from the target screenshot received from the mobile terminal 10 through the text detection model, and then translates each translation object through the translation model. The translation copy corresponding to the translation object is obtained, and the server 20 feeds back each translation copy to the mobile terminal 10.
在移动终端10展示目标截图,在目标截图上每个翻译对象的文本行区域内创建译文展示浮层,将与该翻译对象对应的翻译文案添加到对应的译文展示浮层内进行展示,使得翻译文案浮于目标截图上对应翻译对象的上层,进而保证了翻译文案和翻译对象能够同时存在,便于用户进行翻译文案与翻译对象之间的内容对比。The target screenshot is displayed on the mobile terminal 10, a translation display floating layer is created in the text line area of each translation object on the target screenshot, and the translation text corresponding to the translation object is added to the corresponding translation display floating layer for display, so that the translation The copy is floating on the upper layer corresponding to the translation object on the target screenshot, thereby ensuring that the translation copy and the translation object can exist at the same time, and it is convenient for users to compare the content between the translation copy and the translation object.
具体来讲,在移动终端10上安装有目标应用,目标应用可以为社交应用、购物应用等有多国投放需求的APP。在目标应用内添加翻译小程序,目标应用运行在前台时,移动终端10通过翻译小程序与服务端20进行交互,实现对目标应用的应用页面内展示的文字内容块(比如,一个文字内容块是一个翻译对象)进行翻译,并以译文展示浮层的方式在该文字内容块所在文本行区域内展示与文字内容块对应的翻译文案,以使得翻译文案浮于文字内容块的上层。当然,具体实施过程中,也可以在移动终端10内安装有 翻译应用,通过翻译应用与服务端20进行交互,实现对移动终端10上任一前台运行应用的应用页面内展示的文字内容块进行翻译,并以译文展示浮层的方式展示与文字内容块对应的翻译文案。Specifically, a target application is installed on the mobile terminal 10, and the target application may be a social application, a shopping application, and other apps that have requirements for delivery in multiple countries. Add a translation applet in the target application. When the target application is running in the foreground, the mobile terminal 10 interacts with the server 20 through the translation applet to realize a block of text content displayed in the application page of the target application (for example, a text content block). It is a translation object) for translation, and the translation copy corresponding to the text content block is displayed in the text line area where the text content block is located in the form of a translation display floating layer, so that the translation copy floats on the upper layer of the text content block. Of course, in the specific implementation process, a translation application can also be installed in the mobile terminal 10, and the translation application interacts with the server 20 through the translation application to implement translation of the text content block displayed in the application page of any foreground running application on the mobile terminal 10. , And display the translation copy corresponding to the text content block in the form of translation display floating layer.
第二方面,本说明书实施例提供一种翻译文案展示方法,应用于如图1所示的移动终端。下面结合图1和图2所示,对本说明书实施例提供的翻译文案展示方法进行描述。图2为本说明书实施例中翻译文案展示方法的流程示意图,本说明书实施例提供的翻译文案展示方法包括如下步骤S200-S204:In the second aspect, the embodiment of this specification provides a method for displaying translated text, which is applied to the mobile terminal as shown in FIG. 1. The following describes the translation copy display method provided by the embodiment of this specification with reference to FIG. 1 and FIG. 2. Fig. 2 is a schematic flow chart of the method for displaying a translation copy in an embodiment of the specification. The method for displaying a translation copy provided in an embodiment of the specification includes the following steps S200-S204:
S200、如果移动终端检测到用户的翻译启动操作,截取移动终端的当前屏幕内容,得到当前屏幕内容对应的目标截图,目标截图上包含一个以上翻译对象。S200. If the mobile terminal detects the user's translation start operation, it intercepts the current screen content of the mobile terminal to obtain a target screenshot corresponding to the current screen content, and the target screenshot contains more than one translation object.
在本说明书实施例中,启动目标应用内添加的翻译小程序,启动之后的翻译小程序向用户提供给翻译操作入口,用户通过翻译操作入口执行翻译启动操作。In the embodiment of this specification, the translation applet added in the target application is started, and the translation applet after the startup is provided to the user for the translation operation portal, and the user performs the translation start operation through the translation operation portal.
具体的,翻译操作入口可以是如图3中所示的,以悬浮按钮组件显示在应用页面上的固定位置,比如,是以固定div实现的悬浮按钮组件,展示在当前屏幕内的右下角。如果检测到用户对虚浮按钮组件的点击操作,则截取移动终端的当前屏幕内容,得到当前屏幕内容对应的目标截图。其中,目标截图可以是:通过对移动终端进行截屏或者滚动截屏得到的截屏图像,截屏图像中包含目标应用的当前应用页面,截屏图像可以参考图3所示。或者目标截图可以是通过对目标应用的当前应用页面进行截图,得到的应用页面截图。Specifically, the translation operation entry may be as shown in FIG. 3, which is displayed in a fixed position on the application page with a floating button component, for example, a floating button component implemented with a fixed div, displayed in the lower right corner of the current screen. If the user's click operation on the virtual floating button component is detected, the current screen content of the mobile terminal is captured to obtain a target screenshot corresponding to the current screen content. The target screenshot may be: a screenshot image obtained by taking a screenshot of the mobile terminal or scrolling the screenshot, the screenshot image contains the current application page of the target application, and the screenshot image can be referred to as shown in FIG. 3. Or the target screenshot may be a screenshot of the application page obtained by taking a screenshot of the current application page of the target application.
在本说明书实施例中,目标截图上包含一个以上翻译对象。每个翻译对象在目标截图中是以图像形式存在的一个以上文字。目标截图上的各个翻译对象互为独立。In the embodiment of this specification, the target screenshot contains more than one translation object. Each translation object is more than one text in the form of an image in the target screenshot. Each translation object on the target screenshot is independent of each other.
S202、移动终端获得目标截图中每个翻译对象的翻译文案。S202. The mobile terminal obtains the translation text of each translation object in the target screenshot.
在本说明书实施例中,通过对目标截图进行处理,得到目标截图上每个翻译对象的翻译文案。而对目标截图进行处理得到翻译文案的过程可以由移动终端或者服务端执行。鉴于处理过程计算量较大,最好由服务端来执行。In the embodiment of this specification, by processing the target screenshot, the translation copy of each translation object on the target screenshot is obtained. The process of processing the target screenshot to obtain the translated text can be executed by the mobile terminal or the server. In view of the large amount of calculation in the processing process, it is best to be executed by the server.
下面,对移动终端与服务端进行交互,获得目标截图中每个翻译对象的翻译文案的过程进行详细描述:Below, the process of interacting between the mobile terminal and the server to obtain the translation copy of each translation object in the target screenshot will be described in detail:
移动终端将目标截图发送至服务端。服务端通过文本检测模型对接收到的目标截图进行文本检测,得到目标截图上每个翻译对象。具体的,文本检测模型可以是OCR(Optical Character Recognition,光学字符识别)模型,通过OCR模型对目标截图进行 OCR识别,得到识别结果队列。其中,识别结果队列中包含一个以上识别结果,识别结果与翻译对象一一对象,每个识别结果中包含以文本格式表示的翻译对象,以及该翻译对象所在文本行区域的相对坐标信息,每个识别结果中以文本格式表示的翻译对象可以是单个文字、单个词语、词语序列或者一个以上语句。接下来,针对识别结果队列中每个识别结果,服务端通过翻译模型对该识别结果中以文本格式表示的翻译对象进行翻译,得到该翻译对象对应的翻译文案。服务端将得到的每个翻译文案反馈给移动终端。从而,移动终端从服务端接收到目标截图上每个翻译对象的翻译文案。The mobile terminal sends the target screenshot to the server. The server performs text detection on the received target screenshot through the text detection model, and obtains each translation object on the target screenshot. Specifically, the text detection model may be an OCR (Optical Character Recognition) model. The OCR model is used to perform OCR recognition on the target screenshot to obtain a recognition result queue. Among them, the recognition result queue contains more than one recognition result, the recognition result and the translation object are one object, each recognition result contains the translation object in text format, and the relative coordinate information of the text line area where the translation object is located. The translation object represented in the text format in the recognition result can be a single word, a single word, a sequence of words, or more than one sentence. Next, for each recognition result in the recognition result queue, the server translates the translation object represented in the text format in the recognition result through the translation model, and obtains the translation copy corresponding to the translation object. The server feeds back each translation text it gets to the mobile terminal. Thus, the mobile terminal receives the translation copy of each translation object on the target screenshot from the server.
在移动终端处理目标截图得到翻译文案的过程与前述在处理目标截图得到翻译文案的过程类似,为了说明书的简洁,在此不再赘述。The process of processing the target screenshot on the mobile terminal to obtain the translation copy is similar to the aforementioned process of processing the target screenshot to obtain the translation copy.
S204、在移动终端展示目标截图,并针对目标截图中每个翻译对象,在该翻译对象的文本行区域之内创建译文展示浮层,将与该翻译对象对应的翻译文案添加到对应的译文展示浮层内进行展示。S204. Display the target screenshot on the mobile terminal, and for each translation object in the target screenshot, create a translation display floating layer within the text line area of the translation object, and add the translation copy corresponding to the translation object to the corresponding translation display Display in the floating layer.
在具体实施过程中,步骤S204的具体执行顺序可以是:在目标截图上每个翻译对象所在的文本行区域之内分别创建译文展示浮层,在每个译文展示浮层的容器内写入该翻译对象对应的翻译文案,以得到目标截图与翻译文案进行拼接的结果,对拼接结果进行展示,以此避免了翻译文案覆盖且替换掉翻译对象而造成的原文案信息缺失,避免给用户对翻译内容的理解造成的不便。In the specific implementation process, the specific execution sequence of step S204 may be: create translation display floating layers in the text line area where each translation object is located on the target screenshot, and write the floating layer in the container of each translation display floating layer. The translation copy corresponding to the translation object, in order to obtain the result of the splicing of the target screenshot and the translation copy, and display the splicing result, so as to avoid the loss of the original copy information caused by the translation copy cover and the replacement of the translation target, and to avoid the user's translation The inconvenience caused by the understanding of the content.
在具体实施过程中,步骤S204的具体执行顺序也可以是:在得到目标截图之后先对目标截图进行展示,在获得目标截图上第i翻译对象对应的第i翻译文案之后,创建第i译文展示浮层并在第i译文展示浮层内写入第i翻译文案,将写入第i翻译文案之后的第i译文展示浮层添加至目标截图上第i翻译对象所在文本行区域内。In the specific implementation process, the specific execution order of step S204 can also be: first display the target screenshot after obtaining the target screenshot, and create the i-th translation display after obtaining the i-th translation copy corresponding to the i-th translation object on the target screenshot Floating layer and write the i-th translation copy in the i-th translation display floating layer, and add the i-th translation display floating layer after the i-th translation copy is written into the text line area where the i-th translation object is located on the target screenshot.
很多时候,翻译文案的尺寸与翻译对象的尺寸不相同,通过在翻译对象所在的文本行区域之内创建译文展示浮层,仅仅会遮挡对应翻译对象所在文本行区域,而不是替换对应翻译对象,更不会遮挡其他翻译对象所在的文本行区域,进而能够避免不同翻译文案之间相互遮盖。In many cases, the size of the translation copy is different from the size of the translation object. By creating a translation display floating layer within the text line area where the translation object is located, only the text line area where the corresponding translation object is located will be blocked instead of replacing the corresponding translation object. Moreover, the text line area where other translation objects are located will not be obstructed, thereby avoiding mutual obscuration between different translation texts.
下面针对在目标截图上创建译文展示浮层的过程以及在译文展示浮层内展示翻译文案的过程分别进行详细描述:The following is a detailed description of the process of creating a translation display floating layer on the target screenshot and the process of displaying the translation copy in the translation display floating layer:
①创建译文展示浮层:①Create translation display floating layer:
具体的,创建译文展示浮层的实施过程是:针对目标截图上每个翻译对象,确定该 翻译对象所在文本行区域的相对坐标信息,目标截图上包含N个翻译对象,N为正整数;根据目标截图上第i翻译对象所在文本行区域的相对坐标信息,创建与第i翻译对象所在文本行区域匹配的第i译文展示浮层,i依次取1至N。Specifically, the implementation process of creating a translation display floating layer is: for each translation object on the target screenshot, determine the relative coordinate information of the text line area where the translation object is located. The target screenshot contains N translation objects, and N is a positive integer; The relative coordinate information of the text line area where the i-th translation object is located on the target screenshot, creates a floating layer of the i-th translation display that matches the text line area where the i-th translation object is located, and i takes 1 to N in turn.
具体来讲,根据第i翻译对象所在文本行区域的相对坐标信息,确定第i翻译对象所在文本行区域的区域尺寸和区域位置;创建与第i翻译对象所在文本行区域的区域尺寸相同的第i译文展示浮层,根据第i翻译对象所在文本行区域的区域位置,将第i译文展示浮层添加至目标截图的上层,以遮挡第i翻译对象所在的文本行区域。Specifically, according to the relative coordinate information of the text line area where the i-th translation object is located, determine the area size and area position of the text line area where the i-th translation object is located; create the same area size of the text line area where the i-th translation object is located. The i-th translation display floating layer, according to the area position of the text line area where the i-th translation object is located, adds the i-th translation display floating layer to the upper layer of the target screenshot to cover the text line area where the i-th translation object is located.
需要说明的是,每个翻译对象所在文本行区域的相对坐标信息,具体是指:该翻译对象所在文本行区域的对角坐标(x1,y1),(x2,y2)。在本说明书实施例中,目标截图上每个翻译对象所在文本行区域的相对坐标信息同样来自于服务端,在前文已经说明,在此不再赘述。It should be noted that the relative coordinate information of the text line area where each translation object is located specifically refers to: the diagonal coordinates (x1, y1), (x2, y2) of the text line area where the translation object is located. In the embodiment of this specification, the relative coordinate information of the text line area where each translation object is located on the target screenshot also comes from the server, which has been explained in the foregoing and will not be repeated here.
通过上述在目标截图上创建译文展示浮层的方式,所创建的每个译文展示浮层不会覆盖除对应翻译对象之外的任一个翻译对象所在的文本行区域,展示出翻译文案的效果可以参考图4所示,以此提升了翻译文案的显示效果。Through the above method of creating a translation display floating layer on the target screenshot, each created translation display floating layer will not cover the text line area where any translation object except the corresponding translation object is located, showing the effect of the translation copy. Refer to Figure 4 to improve the display effect of the translated text.
②在每个译文展示浮层内展示翻译文案:②Display the translation copy in each translation display floating layer:
具体的,根据第i译文展示浮层的原始浮层尺寸,在第i译文展示浮层内展示第i翻译文案,i依次取1至N,以更合理翻译文案。本说明书实施例给出两种实施方式:实施方式一:Specifically, according to the original floating layer size of the i-th translation display floating layer, the i-th translation copy is displayed in the i-th translation display floating layer, and i is sequentially selected from 1 to N to more rationally translate the copy. The embodiment of this specification provides two implementation modes: Implementation mode one:
对比第i译文展示浮层的原始浮层尺寸是否大于或等于第i翻译文案的尺寸;如果是,在第i译文展示浮层内展示第i翻译文案的完整译文内容,否则,根据第i译文展示浮层的原始浮层尺寸,在第i译文展示浮层内展示第i翻译文案的部分译文内容。Compare whether the original floating layer size of the i-th translation display floating layer is greater than or equal to the size of the i-th translation copy; if so, display the complete translation content of the i-th translation copy in the i-th translation display floating layer; otherwise, according to the i-th translation Display the original floating layer size of the floating layer, and display part of the translation content of the i-th translation copy in the i-th translation display floating layer.
进一步的,为了在第i译文展示浮层内展示的是第i翻译文案的部分译文内容情况下,如果检测到用户对第i译文展示浮层的展开操作,则展开第i译文展示浮层;在第i译文展示浮层的展开浮层尺寸内展示第i翻译文案的完整译文内容。如果检测到用户对展开后第i译文展示浮层的恢复操作时,恢复第i译文展示浮层的原始浮层尺寸以及在该原始浮层尺寸内展示的第i翻译文案的部分译文内容。Further, in order to display part of the translation content of the i-th translation copy in the i-th translation display floating layer, if the user's expansion operation on the i-th translation display floating layer is detected, expand the i-th translation display floating layer; Display the complete translation content of the i-th translation copy in the expanded float size of the i-th translation display floating layer. If it is detected that the user restores the i-th translation display floating layer after unfolding, the original floating layer size of the i-th translation display floating layer and the partial translation content of the i-th translation copy displayed in the original floating layer size are restored.
具体来讲,展开和恢复所述第i译文展示浮层的触发操作可以预定义如下任意一种:Specifically, the trigger operation for expanding and restoring the i-th translation display floating layer can be predefined as any of the following:
①,检测到在第i译文展示浮层上的停留操作时,根据对应的第i翻译文案的尺寸 展开第i译文展示浮层;检测到对展开后第i译文展示浮层的离开操作时,恢复第i译文展示浮层的原始浮层尺寸。①, when the stay operation on the i-th translation display floating layer is detected, expand the i-th translation display floating layer according to the size of the corresponding i-th translation copy; when the leaving operation on the i-th translation display floating layer is detected, Restore the original floating layer size of the i-th translation to show the floating layer.
②,检测到对第i译文展示浮层的点击操作时,根据第i翻译文案的尺寸展开第i译文展示浮层;在展开第i译文展示浮层达到预设时长之后,或者在检测到对展开后第i译文展示浮层的点击操作时,恢复第i译文展示浮层的原始浮层尺寸。②, when the click operation on the i-th translation display floating layer is detected, expand the i-th translation display floating layer according to the size of the i-th translation copy; after the i-th translation display floating layer is expanded for the preset duration, or after the detection of the right After unfolding, when the i-th translation display floating layer is clicked, the original floating layer size of the i-th translation display floating layer is restored.
③,检测到对第i译文展示浮层的双指外滑操作时,根据第i翻译文案的尺寸展开第i译文展示浮层,检测到对展开后第i译文展示浮层的双指收拢操作时,恢复第i译文展示浮层的原始浮层尺寸。③, when the two-finger sliding operation of the i-th translation display floating layer is detected, expand the i-th translation display floating layer according to the size of the i-th translation copy, and the two-finger folding operation of the i-th translation display floating layer after the expansion is detected When, restore the original floating layer size of the i-th translation to show the floating layer.
在具体实施过程中,在目标截图上的每个可展开的译文展示浮层上设置可展开标识,参考图4所示在译文展示浮层上设置的三角标识来标识可以展开的译文展示浮层,便于用户分辨译文展示浮层是否可展开,提高了用户体验度。In the specific implementation process, an expandable mark is set on each expandable translation display floating layer on the target screenshot. Refer to the triangle mark set on the translation display floating layer as shown in Figure 4 to identify the expandable translation display floating layer. , It is convenient for users to distinguish whether the translation display floating layer can be expanded, and the user experience is improved.
通过上述在译文展示浮层内展示翻译文案的实施方式一,对译文展示浮层的展开效果可以参考图5所示,图5中示例了对“跨境交通”这一翻译对象对应的翻译文案进行展开的效果,可以看出,翻译文案UI具备用户可交互能力,能够使得用户快速通过手势操作来查看完整翻译内容,避免了翻译文案文字过长而显示不全的问题。Through the first embodiment of displaying the translation copy in the translation display floating layer, the unfolding effect of the translation display floating layer can be referred to as shown in Figure 5. Figure 5 illustrates the translation copy corresponding to the translation object "cross-border traffic" The effect of unfolding shows that the translation copy UI has user-interactive capabilities, which enables users to quickly view the complete translation content through gesture operations, avoiding the problem of excessively long translated copy text and incomplete display.
实施方式二:Implementation mode two:
根据第i译文展示浮层的原始浮层尺寸以及所要展示第i翻译文案的尺寸,计算用于显示第i翻译文案的文字大小;以计算出的文字大小在译文展示浮层内展示该翻译文案的完整译文内容。从而通过调整文字大小来保证在第i译文展示浮层内展示对应第i翻译文案的完整译文内容。在检测到对第i译文展示浮层的展开操作时,以预设的标准文字大小在第i译文展示浮层的展开浮层尺寸内展示对应第i翻译文案的完整译文内容。According to the original floating layer size of the i-th translation display floating layer and the size of the i-th translation copy to be displayed, calculate the text size for displaying the i-th translation copy; use the calculated text size to display the translation copy in the translation display floating layer The complete translation content of. Thus, by adjusting the text size, the complete translation content corresponding to the i-th translation copy is displayed in the i-th translation display floating layer. When the expansion operation of the i-th translation display floating layer is detected, the complete translation content corresponding to the i-th translation copy is displayed in the expansion floating layer size of the i-th translation display floating layer with a preset standard text size.
通过上述在译文展示浮层内展示翻译文案的实施方式二,避免了翻译文案文字过长而显示不清的问题,通过手势操作来清楚展示译文内容。Through the second implementation manner of displaying the translation text in the translation display floating layer, the problem of the text of the translation text being too long and unclear is avoided, and the content of the translation can be clearly displayed through gesture operations.
进一步的,为了方便用户进行翻译对象与翻译文案之间的对照查看,针对目标截图上创建的每个译文展示浮层,如果检测到用户对译文展示浮层的移动操作,则根据移动操作的操作信息对译文展示浮层进行移动,以使能够将遮挡翻译对象的翻译文案移动到其他区域,以同时显示出翻译对象与翻译文案,以进行翻译前后内容的对照,对译文展示浮层的移动效果可以参考图6所示,图6中示例了对“跨境交通”这一翻译对象对应的翻译文案进行移动的效果。Further, in order to facilitate the user to compare the translation object and the translation copy, the floating layer is displayed for each translation created on the target screenshot. If the user's movement operation on the translation display floating layer is detected, it will be based on the operation of the movement operation. The information moves the translation display floating layer so that the translation copy that shields the translation object can be moved to other areas, so that the translation object and the translation copy can be displayed at the same time, so as to compare the content before and after translation, and show the moving effect of the floating layer in the translation. Refer to Figure 6, which illustrates the effect of moving the translation text corresponding to the translation object "cross-border traffic".
在一可选的实施方式下,为了便于用户通过手势操作移动译文展示浮层,移动操作具体是拖拽操作。针对目标截图上任一译文展示浮层,获取用户对该译文展示浮层进行拖拽操作的拖拽轨迹;根据拖拽轨迹对该译文展示浮层进行移动,以移动至对应翻译对象的文本行区域之外。在检测到拖拽操作结束时,将该译文展示浮层回移至该译文展示浮层的原始展示区域,需要说明的是,该译文展示浮层的原始展示区域就是对应翻译对象所在的文本行区域。根据对应翻译对象所在的文本行区域的相对坐标信息,将该译文展示浮层回移至该译文展示浮层的原始展示区域。避免移动后的译文展示浮层影响其他翻译文案的显示。In an optional implementation manner, in order to facilitate the user to move the translation display floating layer through a gesture operation, the movement operation is specifically a drag operation. For any translation display floating layer on the target screenshot, obtain the drag trajectory of the user's drag operation on the translation display floating layer; move the translation display floating layer according to the drag trajectory to move to the text line area corresponding to the translation object Outside. When the end of the drag operation is detected, the translation display floating layer is moved back to the original display area of the translation display floating layer. It should be noted that the original display area of the translation display floating layer is the text line corresponding to the translation object. area. According to the relative coordinate information of the text line area where the corresponding translation object is located, the translation display floating layer is moved back to the original display area of the translation display floating layer. Avoid the floating layer of the translated translation after moving to affect the display of other translation texts.
或者,在检测到拖拽操作结束时,确定该拖拽操作结束时的位置坐标,并将该译文展示浮层停留在目标截图上根据该位置坐标指示的位置。Or, when the end of the drag operation is detected, the position coordinates at the end of the drag operation are determined, and the translation display floating layer stays on the target screenshot according to the position indicated by the position coordinates.
以第i译文展示浮层为例,如果检测到用户对第i译文展示浮层的拖拽操作,则根据拖拽操作的拖拽轨迹对第i译文展示浮层进行移动,在拖拽操作结束时,将第i译文展示浮层回移至展示第i翻译对象所在的文本行区域内。Take the i-th translation display floating layer as an example, if the user's drag operation on the i-th translation display floating layer is detected, the i-th translation display floating layer is moved according to the drag trajectory of the drag operation, and the drag operation ends When, move the i-th translation display floating layer back to the text line area where the i-th translation object is displayed.
为了进一步提高交互高效性,可以将点击操作和拖拽操作进行结合,展示翻译文案的译文展示浮层进行操作,来提高多语言翻译的用户体验:In order to further improve the efficiency of interaction, click and drag operations can be combined to display the translated text of the translated text and display the floating layer to improve the user experience of multilingual translation:
针对目标截图上展示的任意一个译文展示浮层而言:当检测到用户对该译文展示浮层的点击操作时,将该译文展示浮层从原始浮层尺寸进行展开,并在该译文展示浮层的展开浮层尺寸内进行展示对应翻译文案的完整译文内容,若用户在点击操作之后继续针对该译文展示浮层执行拖拽操作,则检测到该拖拽操作,将展开后的该译文展示浮层根据拖拽操作的拖拽轨迹进行移动,在此过程中,会同时呈现出对应的翻译对象和翻译文案。当检测到对该译文展示浮层的拖拽操作结束,则将该译文展示浮层回移至翻译对象所在的文本行区域内,避免后续对其他内容的影响。For any translation display floating layer displayed on the target screenshot: when the user's click operation on the translation display floating layer is detected, the translation display floating layer is expanded from the original floating layer size, and the floating layer is displayed in the translation. The full translation content of the corresponding translation copy is displayed within the expanded floating layer size of the layer. If the user continues to perform a drag operation on the translation display floating layer after the click operation, the drag operation will be detected and the expanded translation will be displayed The floating layer moves according to the drag trajectory of the drag operation. In this process, the corresponding translation object and translation copy will be presented at the same time. When it is detected that the drag operation of the translation display floating layer is completed, the translation display floating layer is moved back to the text line area where the translation object is located, so as to avoid subsequent impact on other content.
通过这种方式,用户仅仅一个点击+拖拽形成的连续手势操作,就能完成对翻译文案的完整译文查看和翻译前后对比。对用户而言,方便又快捷,符合移动终端的使用特点。In this way, the user can complete the complete translation view of the translation text and the comparison before and after translation with only one continuous gesture operation formed by clicking + dragging. For users, it is convenient and fast, and is in line with the use characteristics of mobile terminals.
进一步的,为了用户操作简便,提高用户体验度,如果检测到用户的译文隐藏操作,则隐藏在目标截图上创建的每个译文展示浮层,以展示出每个翻译对象。结合前述实施例,译文隐藏操作可以是对翻译操作入口的点击操作。Further, in order to facilitate user operations and improve user experience, if a user's translation hiding operation is detected, each translation display floating layer created on the target screenshot is hidden to show each translation object. In combination with the foregoing embodiment, the translation hiding operation may be a clicking operation on the translation operation entry.
具体来讲,在移动终端的当前屏幕内容是目标应用的应用页面时,如果检测到设置 于当前屏幕上固定位置的悬浮按钮组件的点击操作,则执行步骤S200~S204,以在目标截图上以译文展示浮层的方式展示出每个翻译文案;在移动终端的当前屏幕内容显示的是以译文展示浮层的方式展示出每个翻译文案的目标截图时,如果检测到该悬浮按钮组件的点击操作,则隐藏目标截图上展示的每个译文展示浮层,以向用户展示出目标截图上的每个翻译对象。从而减少了用户的操作复杂度,以单一的悬浮虚拟按钮实现了多项交互操作,更简洁、操作也更方便。Specifically, when the current screen content of the mobile terminal is the application page of the target application, if a click operation of the floating button component set in a fixed position on the current screen is detected, steps S200 to S204 are executed to display the target screenshot Each translation text is displayed in the floating layer of the translation; the current screen content of the mobile terminal is displayed in the floating layer of the translation when the target screenshot of each translation text is displayed, if the click of the floating button component is detected Operation, hide each translation display floating layer displayed on the target screenshot to show the user each translation object on the target screenshot. Therefore, the user's operation complexity is reduced, and multiple interactive operations are realized with a single floating virtual button, which is more concise and more convenient to operate.
第三方面,本说明书实施例提供一种翻译文案展示装置,应用于移动终端。参考图7所示,该装置包括:第一操作检测单元701,用于如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容,得到目标截图,所述目标截图上包含一个以上翻译对象;文案获取单元702,用于获得所述目标截图上每个翻译对象的翻译文案;第一文案展示单元703,用于展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。In the third aspect, the embodiment of this specification provides a translation copy display device, which is applied to a mobile terminal. As shown in FIG. 7, the device includes: a first operation detection unit 701, configured to capture the current screen content of the mobile terminal if the user's translation start operation is detected to obtain a target screenshot, the target screenshot containing more than one Translation object; copy acquisition unit 702, used to obtain the translation copy of each translation object on the target screenshot; the first copy display unit 703, used to display the target screenshot, and for each translation object on the target screenshot , Creating a translation display floating layer in the text line area where the translation object is located, and adding the translation text corresponding to the translation object to the translation display floating layer for display.
在一可选的实施方式,所述第一文案展示单元703,包括:坐标确定子单元,用于针对所述目标截图上每个翻译对象,确定所述翻译对象所在文本行区域的相对坐标信息,所述目标截图上包含N个翻译对象,N为正整数;浮层创建单元,用于根据所述目标截图上第i翻译对象所在文本行区域的相对坐标信息,创建与所述第i翻译对象所在文本行区域匹配的第i译文展示浮层,i依次取1至N。In an optional implementation manner, the first copywriting display unit 703 includes: a coordinate determination subunit, configured to determine the relative coordinate information of the text line area where the translation object is located for each translation object on the target screenshot , The target screenshot contains N translation objects, and N is a positive integer; the floating layer creation unit is used to create a translation with the i-th translation object based on the relative coordinate information of the text line area where the i-th translation object is located on the target screenshot The i-th translation that matches the text line area where the object is located displays the floating layer, and i takes 1 to N in turn.
在一可选的实施方式下,所述第一文案展示单元703,包括:对比子单元,用于对比所述第i译文展示浮层的原始浮层尺寸是否大于或等于所述第i翻译文案的尺寸,i依次取1至N;内容展示子单元,用于如果是,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的完整译文内容,否则,根据所述第i译文展示浮层的原始浮层尺寸,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容。In an alternative embodiment, the first copywriting display unit 703 includes: a comparison subunit for comparing whether the original floating layer size of the i-th translation display floating layer is greater than or equal to the i-th translation copy The size of i is taken from 1 to N in turn; the content display subunit is used to display the complete translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer, otherwise, according to The i-th translation shows the original floating layer size of the floating layer, and part of the translated content of the i-th translation copy is displayed within the original floating layer size of the i-th translation display floating layer.
在一可选的实施方式,所述装置还包括:第二操作检测单元705,用于在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容之后,如果检测到用户对所述第i译文展示浮层的展开操作,则展开所述第i译文展示浮层;第二文案展示单元706,用于在所述第i译文展示浮层的展开浮层尺寸内,展示所述第i翻译文案的完整译文内容。In an optional embodiment, the device further includes: a second operation detection unit 705, configured to display part of the translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer , If the user's expansion operation on the i-th translation display floating layer is detected, then the i-th translation display floating layer will be expanded; Within the layer size, the complete translation content of the i-th translation copy is displayed.
在一可选的实施方式,所述装置还包括:文案移动单元704,用于针对所述目标截 图上创建的每个译文展示浮层,如果检测到用户对所述译文展示浮层的移动操作,则根据所述移动操作的操作信息对所述译文展示浮层进行移动。In an optional implementation manner, the device further includes: a copywriting moving unit 704, configured to display a floating layer for each translation created on the target screenshot, and if a user's movement operation on the translation display floating layer is detected , Then move the translation display floating layer according to the operation information of the moving operation.
在一可选的实施方式,所述移动操作为拖拽操作,所述文案移动单元704,包括:拖拽轨迹子单元,用于获取用户对所述译文展示浮层进行拖拽操作的拖拽轨迹,根据所述拖拽轨迹对所述译文展示浮层进行移动;结束确定子单元,用于在检测到所述拖拽操作结束时,将所述译文展示浮层回移至所述译文展示浮层的原始展示区域,或者确定所述拖拽操作结束时的位置坐标,并将所述译文展示浮层停留在所述目标截图上根据所述位置坐标指示的位置。In an optional embodiment, the moving operation is a dragging operation, and the copywriting moving unit 704 includes: a drag trajectory subunit for acquiring the drag operation performed by the user on the translation display floating layer Trajectory, to move the translation display floating layer according to the dragging trajectory; an end determination subunit for moving the translation display floating layer back to the translation display when the end of the drag operation is detected The original display area of the floating layer, or the position coordinates at the end of the drag operation are determined, and the translation display floating layer stays on the target screenshot according to the position indicated by the position coordinates.
在一可选的实施方式,所述文案获取单元702,包括:截图发送子单元,用于将所述目标截图发送至服务端,使得所述服务端对所述目标截图进行处理,生成所述目标截图上每个翻译对象的翻译文案;文案接收子单元,用于针对所述目标截图上每个翻译对象,接收所述服务端反馈的与所述翻译对象对应的翻译文案。In an optional implementation manner, the copywriting acquisition unit 702 includes: a screenshot sending subunit, configured to send the target screenshot to the server, so that the server processes the target screenshot to generate the The translation copy of each translation object on the target screenshot; the copy receiving subunit is used to receive the translation copy corresponding to the translation object fed back by the server for each translation object on the target screenshot.
在一可选的实施方式,所述装置还包括:文案隐藏单元707,用于如果检测到用户的译文隐藏操作,则隐藏在所述目标截图上创建的每个译文展示浮层。In an optional implementation manner, the device further includes: a copy hiding unit 707, configured to hide each translation display floating layer created on the target screenshot if the user's translation hiding operation is detected.
第四方面,基于与前述实施例中翻译文案展示方法同样的发明构思,本说明书实施例还提供一种移动终端,如图8所示,该服务器包括存储器804、处理器802及存储在存储器804上并可在处理器802上运行的计算机程序,处理器802执行程序时实现前文翻译文案展示方法实施例中任一实施方式下的步骤。In the fourth aspect, based on the same inventive concept as the translation copy display method in the foregoing embodiment, an embodiment of this specification also provides a mobile terminal. As shown in FIG. 8, the server includes a memory 804, a processor 802, and a memory 804. A computer program that can be run on the processor 802. When the processor 802 executes the program, the steps in any of the foregoing embodiments of the translation copy presentation method are implemented.
其中,在图8中,总线架构(用总线800来代表),总线800可以包括任意数量的互联的总线和桥,总线800将包括由处理器802代表的一个或多个处理器和存储器804代表的存储器的各种电路链接在一起。总线800还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口805在总线800和接收器801和发送器803之间提供接口。接收器801和发送器803可以是同一个元件,即收发机,提供用于在传输介质上与各种其他装置通信的单元。处理器802负责管理总线800和通常的处理,而存储器804可以被用于存储处理器802在执行操作时所使用的数据。Wherein, in FIG. 8, the bus architecture (represented by a bus 800), the bus 800 can include any number of interconnected buses and bridges, and the bus 800 will include one or more processors represented by the processor 802 and a memory 804 represented by The various circuits of the memory are linked together. The bus 800 may also link various other circuits such as peripheral devices, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, no further description is provided herein. The bus interface 805 provides an interface between the bus 800 and the receiver 801 and the transmitter 803. The receiver 801 and the transmitter 803 may be the same element, that is, a transceiver, which provides a unit for communicating with various other devices on the transmission medium. The processor 802 is responsible for managing the bus 800 and general processing, and the memory 804 may be used to store data used by the processor 802 when performing operations.
第五方面,基于与前述实施例中翻译文案展示方法的同样发明构思,本说明书实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现前文所述翻译文案展示方法的步骤。In the fifth aspect, based on the same inventive concept as the translation copy display method in the foregoing embodiment, the embodiment of this specification also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the foregoing Describe the steps of the translation copy display method.
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的设备。This specification is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are used to generate It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令设备的制造品,该指令设备实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
尽管已描述了本说明书的确定出实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括确定出实施例以及落入本说明书范围的所有变更和修改。Although the specific embodiments of this specification have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including all changes and modifications that have determined the embodiments and fall within the scope of this specification.
显然,本领域的技术人员可以对本说明书进行各种改动和变型而不脱离本说明书的精神和范围。这样,倘若本说明书的这些修改和变型属于本说明书权利要求及其等同技术的范围之内,则本说明书也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to this specification without departing from the spirit and scope of the specification. In this way, if these modifications and variations of this specification fall within the scope of the claims of this specification and their equivalent technologies, this specification is also intended to include these modifications and variations.

Claims (19)

  1. 一种翻译文案展示方法,应用于移动终端,所述方法包括:A method for displaying translation texts, applied to a mobile terminal, and the method includes:
    如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容,得到目标截图,所述目标截图上包含一个以上翻译对象;If the user's translation start operation is detected, intercept the current screen content of the mobile terminal to obtain a target screenshot, and the target screenshot contains more than one translation object;
    获得所述目标截图上每个翻译对象的翻译文案;Obtain the translation copy of each translation object on the target screenshot;
    展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。Display the target screenshot, and for each translation object on the target screenshot, create a translation display floating layer in the text line area where the translation object is located, and add the translation copy corresponding to the translation object to the translation Display in the display floating layer.
  2. 如权利要求1所述的方法,所述针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,包括:The method according to claim 1, wherein for each translation object on the target screenshot, creating a translation display floating layer in the text line area where the translation object is located includes:
    针对所述目标截图上每个翻译对象,确定所述翻译对象所在文本行区域的相对坐标信息,所述目标截图上包含N个翻译对象,N为正整数;For each translation object on the target screenshot, determine the relative coordinate information of the text line area where the translation object is located, the target screenshot contains N translation objects, and N is a positive integer;
    根据所述目标截图上第i翻译对象所在文本行区域的相对坐标信息,创建与所述第i翻译对象所在文本行区域匹配的第i译文展示浮层,i依次取1至N。According to the relative coordinate information of the text line area where the i-th translation object is located on the target screenshot, an i-th translation display floating layer that matches the text line area where the i-th translation object is located is created, and i takes 1 to N in turn.
  3. 如权利要求2所述的方法,所述将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示,包括:The method according to claim 2, wherein the adding the translation copy corresponding to the translation object to the translation display floating layer for display comprises:
    对比所述第i译文展示浮层的原始浮层尺寸是否大于或等于所述第i翻译文案的尺寸,i依次取1至N;Comparing the i-th translation to show whether the original floating layer size of the floating layer is greater than or equal to the size of the i-th translation copy, and i takes 1 to N in turn;
    如果是,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的完整译文内容,否则,根据所述第i译文展示浮层的原始浮层尺寸,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容。If yes, display the complete translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer; otherwise, display the original floating layer size of the i-th translation based on the original floating layer size of the i-th translation display floating layer. Part of the translation content of the i-th translation copy is displayed in the original floating layer size of the i-th translation display floating layer.
  4. 如权利要求3所述的方法,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容之后,还包括:The method according to claim 3, after displaying part of the translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer, further comprising:
    如果检测到用户对所述第i译文展示浮层的展开操作,则展开所述第i译文展示浮层;If the user's expansion operation on the i-th translation display floating layer is detected, expand the i-th translation display floating layer;
    在所述第i译文展示浮层的展开浮层尺寸内,展示所述第i翻译文案的完整译文内容。Within the unfolded floating layer size of the i-th translation display floating layer, the complete translation content of the i-th translation copy is displayed.
  5. 如权利要求1-4中任一所述的方法,针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层之后,所述方法还包括:The method according to any one of claims 1 to 4, for each translation object on the target screenshot, after creating a translation display floating layer in the text line area where the translation object is located, the method further comprises:
    针对所述目标截图上创建的每个译文展示浮层,如果检测到用户对所述译文展示浮层的移动操作,则根据所述移动操作的操作信息对所述译文展示浮层进行移动。For each translation display floating layer created on the target screenshot, if a user's movement operation on the translation display floating layer is detected, the translation display floating layer is moved according to the operation information of the moving operation.
  6. 如权利要求5所述的方法,所述移动操作为拖拽操作,所述根据所述移动操作的操作信息对所述译文展示浮层进行移动,包括:The method according to claim 5, wherein the moving operation is a drag operation, and the moving the translation display floating layer according to the operation information of the moving operation comprises:
    获取用户对所述译文展示浮层进行拖拽操作的拖拽轨迹,根据所述拖拽轨迹对所述译文展示浮层进行移动;Acquiring a drag trajectory of a drag operation performed by a user on the translation display floating layer, and moving the translation display floating layer according to the drag trajectory;
    在检测到所述拖拽操作结束时,将所述译文展示浮层回移至所述译文展示浮层的原始展示区域,或者确定所述拖拽操作结束时的位置坐标,并将所述译文展示浮层停留在所述目标截图上根据所述位置坐标指示的位置。When the end of the drag operation is detected, the translation display floating layer is moved back to the original display area of the translation display floating layer, or the position coordinates at the end of the drag operation are determined, and the translation The display floating layer stays at the position indicated by the position coordinates on the target screenshot.
  7. 如权利要求1所述的方法,所述获得所述目标截图上每个翻译对象的翻译文案,包括:The method according to claim 1, wherein the obtaining the translation copy of each translation object on the target screenshot includes:
    将所述目标截图发送至服务端,使得所述服务端对所述目标截图进行处理,生成所述目标截图上每个翻译对象的翻译文案;Sending the target screenshot to the server, so that the server processes the target screenshot to generate a translation copy of each translation object on the target screenshot;
    针对所述目标截图上每个翻译对象,接收所述服务端反馈的与所述翻译对象对应的翻译文案。For each translation object on the target screenshot, a translation copy corresponding to the translation object fed back by the server is received.
  8. 如权利要求1所述的方法,在所述目标截图上每个翻译对象的文本行区域内创建译文展示浮层之后,所述方法还包括:The method according to claim 1, after creating a translation display floating layer in the text line area of each translation object on the target screenshot, the method further comprises:
    如果检测到用户的译文隐藏操作,则隐藏在所述目标截图上创建的每个译文展示浮层。If the user's translation hiding operation is detected, the display floating layer of each translation created on the target screenshot is hidden.
  9. 一种翻译文案展示装置,应用于移动终端,所述装置包括:A translation copy display device applied to a mobile terminal, the device comprising:
    第一操作检测单元,用于如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容,得到目标截图,所述目标截图上包含一个以上翻译对象;The first operation detection unit is configured to, if a user's translation start operation is detected, intercept the current screen content of the mobile terminal to obtain a target screenshot, and the target screenshot contains more than one translation object;
    文案获取单元,用于获得所述目标截图上每个翻译对象的翻译文案;The copywriting acquisition unit is used to obtain the translation copy of each translation object on the target screenshot;
    文案展示单元,用于展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象所在的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。The copywriting display unit is used to display the target screenshot, and for each translation object on the target screenshot, create a translation display floating layer in the text line area where the translation object is located, and convert the translation corresponding to the translation object The copy is added to the translation display floating layer for display.
  10. 如权利要求9所述的装置,所述文案展示单元,包括:9. The device of claim 9, wherein the copy display unit comprises:
    坐标确定子单元,用于针对所述目标截图上每个翻译对象,确定所述翻译对象所在文本行区域的相对坐标信息,所述目标截图上包含N个翻译对象,N为正整数;The coordinate determination subunit is used to determine the relative coordinate information of the text line area where the translation object is located for each translation object on the target screenshot, the target screenshot contains N translation objects, and N is a positive integer;
    浮层创建单元,用于根据所述目标截图上第i翻译对象所在文本行区域的相对坐标信息,创建与所述第i翻译对象所在文本行区域匹配的第i译文展示浮层,i依次取1至N。The floating layer creation unit is used to create an i-th translation display floating layer matching the text line region where the i-th translation object is located according to the relative coordinate information of the text line region where the i-th translation object is located on the target screenshot, and i is taken in turn 1 to N.
  11. 如权利要求10所述的装置,所述文案展示单元,包括:The device according to claim 10, wherein the copy display unit comprises:
    对比子单元,用于对比所述第i译文展示浮层的原始浮层尺寸是否大于或等于所述第i翻译文案的尺寸,i依次取1至N;The comparison sub-unit is used to compare whether the original floating layer size of the i-th translation display floating layer is greater than or equal to the size of the i-th translation copy, and i takes 1 to N in turn;
    内容展示子单元,用于如果是,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的完整译文内容,否则,根据所述第i译文展示浮层的原始浮层尺寸,在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容。The content display subunit is used to, if yes, display the complete translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer; otherwise, display the original floating layer according to the i-th translation Floating layer size, displaying part of the translation content of the i-th translation copy within the original floating layer size of the i-th translation display floating layer.
  12. 如权利要求11所述的装置,所述装置还包括:The device according to claim 11, further comprising:
    第二操作检测单元,用于在所述第i译文展示浮层的原始浮层尺寸内展示所述第i翻译文案的部分译文内容之后,如果检测到用户对所述第i译文展示浮层的展开操作,则展开所述第i译文展示浮层;The second operation detection unit is used to display part of the translation content of the i-th translated text within the original floating layer size of the i-th translation display floating layer, if it is detected that the user shows the floating layer to the i-th translation Expand operation, expand the i-th translation display floating layer;
    第二文案展示单元,用于在所述第i译文展示浮层的展开浮层尺寸内,展示所述第i翻译文案的完整译文内容。The second copywriting display unit is used to display the complete translation content of the i-th translation copy within the unfolded floating layer size of the i-th translation display floating layer.
  13. 如权利要求9-12中任一所述的装置,所述装置还包括:The device according to any one of claims 9-12, the device further comprising:
    文案移动单元,用于针对所述目标截图上创建的每个译文展示浮层,如果检测到用户对所述译文展示浮层的移动操作,则根据所述移动操作的操作信息对所述译文展示浮层进行移动。The copywriting moving unit is used to display the floating layer for each translation created on the target screenshot, and if a user's movement operation on the translation display floating layer is detected, display the translation according to the operation information of the moving operation The floating layer moves.
  14. 如权利要求13所述的装置,所述移动操作为拖拽操作,所述文案移动单元,包括:The device according to claim 13, wherein the moving operation is a dragging operation, and the copy moving unit includes:
    拖拽轨迹子单元,用于获取用户对所述译文展示浮层进行拖拽操作的拖拽轨迹,根据所述拖拽轨迹对所述译文展示浮层进行移动;The drag trajectory subunit is used to obtain the drag trajectory of the drag operation performed by the user on the translation display floating layer, and move the translation display floating layer according to the drag trajectory;
    结束确定子单元,用于在检测到所述拖拽操作结束时,将所述译文展示浮层回移至所述译文展示浮层的原始展示区域,或者确定所述拖拽操作结束时的位置坐标,并将所述译文展示浮层停留在所述目标截图上根据所述位置坐标指示的位置。The end determination subunit is used to move the translation display float back to the original display area of the translation display float when the end of the drag operation is detected, or determine the position at the end of the drag operation Coordinates, and the translation display floating layer stays on the target screenshot according to the position indicated by the position coordinates.
  15. 如权利要求9所述的装置,所述文案获取单元,包括:The device according to claim 9, wherein the copy acquisition unit comprises:
    截图发送子单元,用于将所述目标截图发送至服务端,使得所述服务端对所述目标截图进行处理,生成所述目标截图上每个翻译对象的翻译文案;The screenshot sending subunit is used to send the target screenshot to the server, so that the server processes the target screenshot, and generates a translation copy of each translation object on the target screenshot;
    文案接收子单元,用于针对所述目标截图上每个翻译对象,接收所述服务端反馈的与所述翻译对象对应的翻译文案。The copywriting receiving subunit is configured to receive, for each translation object on the target screenshot, the translation copy corresponding to the translation object fed back by the server.
  16. 如权利要求9所述的装置,所述装置还包括:The device of claim 9, further comprising:
    文案隐藏单元,用于如果检测到用户的译文隐藏操作,则隐藏在所述目标截图上创建的每个译文展示浮层。The copywriting hiding unit is used to hide each translation display floating layer created on the target screenshot if the user's translation hiding operation is detected.
  17. 一种翻译系统,包括:A translation system including:
    移动终端,用于如果检测到用户的翻译启动操作,截取所述移动终端的当前屏幕内容得到目标截图,将所述目标截图发送至服务端,所述目标截图上包含一个以上翻译对象;The mobile terminal is configured to, if a user's translation start operation is detected, intercept the current screen content of the mobile terminal to obtain a target screenshot, and send the target screenshot to the server, and the target screenshot contains more than one translation object;
    服务端,用于对所述目标截图进行处理,得到所述目标截图上每个翻译对象的翻译文案,并将所述翻译文案发送至所述移动终端;The server is used to process the target screenshot, obtain the translation copy of each translation object on the target screenshot, and send the translation copy to the mobile terminal;
    所述移动终端,还用于展示所述目标截图,并针对所述目标截图上每个翻译对象,在所述翻译对象的文本行区域内创建译文展示浮层,将与所述翻译对象对应的翻译文案添加到所述译文展示浮层内进行展示。The mobile terminal is also used to display the target screenshot, and for each translation object on the target screenshot, create a translation display floating layer in the text line area of the translation object, which will correspond to the translation object The translation copy is added to the translation display floating layer for display.
  18. 一种移动终端,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1-8中任一项所述方法的步骤。A mobile terminal, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor implements the steps of the method in any one of claims 1-8 when the processor executes the program .
  19. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现权利要求1-8中任一项所述方法的步骤。A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of claims 1-8.
PCT/CN2021/081742 2020-04-02 2021-03-19 Translation text display WO2021197094A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010256392.3 2020-04-02
CN202010256392.3A CN111553172A (en) 2020-04-02 2020-04-02 Translation document display method, device, system and storage medium

Publications (1)

Publication Number Publication Date
WO2021197094A1 true WO2021197094A1 (en) 2021-10-07

Family

ID=72005591

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/081742 WO2021197094A1 (en) 2020-04-02 2021-03-19 Translation text display

Country Status (2)

Country Link
CN (1) CN111553172A (en)
WO (1) WO2021197094A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111553172A (en) * 2020-04-02 2020-08-18 支付宝实验室(新加坡)有限公司 Translation document display method, device, system and storage medium
CN115562554A (en) 2021-06-30 2023-01-03 腾讯科技(深圳)有限公司 Interface information processing method, device, storage medium and equipment
CN114064186B (en) * 2021-11-30 2024-06-07 Oppo广东移动通信有限公司 Character processing method, device, server, storage medium, terminal equipment and server

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020111788A1 (en) * 2001-01-19 2002-08-15 Nec Corporation Translation server, translation method and program therefor
CN108182184A (en) * 2017-12-27 2018-06-19 北京百度网讯科技有限公司 Picture character interpretation method, application and computer equipment
CN108334526A (en) * 2017-01-20 2018-07-27 北京搜狗科技发展有限公司 The methods of exhibiting and device of search result items
CN110674814A (en) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 Picture identification and translation method, terminal and medium
CN110674825A (en) * 2019-09-27 2020-01-10 安徽咪鼠科技有限公司 Character recognition method, device and system applied to intelligent voice mouse and storage medium
CN110781688A (en) * 2019-09-20 2020-02-11 华为技术有限公司 Method and electronic device for machine translation
CN111553172A (en) * 2020-04-02 2020-08-18 支付宝实验室(新加坡)有限公司 Translation document display method, device, system and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020111788A1 (en) * 2001-01-19 2002-08-15 Nec Corporation Translation server, translation method and program therefor
CN108334526A (en) * 2017-01-20 2018-07-27 北京搜狗科技发展有限公司 The methods of exhibiting and device of search result items
CN108182184A (en) * 2017-12-27 2018-06-19 北京百度网讯科技有限公司 Picture character interpretation method, application and computer equipment
CN110781688A (en) * 2019-09-20 2020-02-11 华为技术有限公司 Method and electronic device for machine translation
CN110674814A (en) * 2019-09-25 2020-01-10 深圳传音控股股份有限公司 Picture identification and translation method, terminal and medium
CN110674825A (en) * 2019-09-27 2020-01-10 安徽咪鼠科技有限公司 Character recognition method, device and system applied to intelligent voice mouse and storage medium
CN111553172A (en) * 2020-04-02 2020-08-18 支付宝实验室(新加坡)有限公司 Translation document display method, device, system and storage medium

Also Published As

Publication number Publication date
CN111553172A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
WO2021197094A1 (en) Translation text display
US9092121B2 (en) Copy and paste experience
CN110069257B (en) Interface processing method and device and terminal
US9430139B2 (en) Information processing apparatus, information processing method, and program
US8949729B2 (en) Enhanced copy and paste between applications
CN112115678B (en) Information display method and device, storage medium and electronic equipment
US20140232743A1 (en) Method of synthesizing images photographed by portable terminal, machine-readable storage medium, and portable terminal
US20130132878A1 (en) Touch enabled device drop zone
US10346032B2 (en) Controlling display object on display screen
TW201525776A (en) Invocation control over keyboard user interface
CN105144058A (en) Deferred placement prompt
US9841881B2 (en) Two step content selection with auto content categorization
CN113536173B (en) Page processing method and device, electronic equipment and readable storage medium
CN110286971B (en) Processing method and system, medium and computing device
CN104123383A (en) Method and device used in media application
CN105723314B (en) Two-step content selection
CN113934356A (en) Display operation method, device, equipment and storage medium of intelligent interactive panel
CN106598410A (en) Display method, device and terminal equipment of electronic book
EP2965181B1 (en) Enhanced canvas environments
WO2023202570A1 (en) Image processing method and processing apparatus, electronic device and readable storage medium
WO2016173307A1 (en) Message copying method and device, and smart terminal
WO2024160133A1 (en) Image generation method and apparatus, electronic device, and storage medium
WO2024104079A1 (en) Desktop component generation method and apparatus, electronic device, and readable storage medium
US20150138077A1 (en) Display system and display controll device
WO2023174328A1 (en) Screen control method and apparatus, electronic device, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21778723

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21778723

Country of ref document: EP

Kind code of ref document: A1