A translation method, applied to an electronic device and an application, wherein the method comprises: displaying a first interface of the application, wherein the first interface comprises a first text and a floating ball, and the floating ball comprises a first floating ball state (303, 401) and a second floating ball state, the first state being an expanded state, and the second state being a contracted state; displaying a first control in response to a first operation performed by a user on the first text, wherein the first control comprises a copy option, and the first operation comprises any one of a selection operation, a touch operation, a tap operation, a slide operation, a touch and hold operation, or a double-tap operation on the first text; writing the first text into a clipboard of the electronic device in response to a copy operation performed by the user on the copy option, and after the copy operation: upon recognizing that the first text in the clipboard comprises language different from a system language of the electronic device, displaying the floating ball in the first floating ball state; and displaying a floating window in the first interface in response to a translation operation performed by the user on the floating ball in the first floating ball state, wherein the floating window comprises the first text and a first translation corresponding to the first text, and the floating window is displayed in a first floating window state. displaying a first interface of the application, wherein the first interface comprises a first text and a floating ball, and the floating ball comprises a first floating ball state (303, 401) and a second floating ball state, the first state being an expanded state, and the second state being a contracted state; displaying a first control in response to a first operation performed by a user on the first text, wherein the first control comprises a copy option, and the first operation comprises any one of a selection operation, a touch operation, a tap operation, a slide operation, a touch and hold operation, or a double-tap operation on the first text; writing the first text into a clipboard of the electronic device in response to a copy operation performed by the user on the copy option, and after the copy operation: upon recognizing that the first text in the clipboard comprises language different from a system language of the electronic device, displaying the floating ball in the first floating ball state; and displaying a floating window in the first interface in response to a translation operation performed by the user on the floating ball in the first floating ball state, wherein the floating window comprises the first text and a first translation corresponding to the first text, and the floating window is displayed in a first floating window state. upon recognizing that the first text in the clipboard comprises language different from a system language of the electronic device, displaying the floating ball in the first floating ball state; and displaying a floating window in the first interface in response to a translation operation performed by the user on the floating ball in the first floating ball state, wherein the floating window comprises the first text and a first translation corresponding to the first text, and the floating window is displayed in a first floating window state.