mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 14:08:41 +00:00
Added ability to translate selected text in profile section.
This commit is contained in:
@@ -965,13 +965,20 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
||||
if (Ui::SkipTranslate(state->labelText.current())) {
|
||||
return;
|
||||
}
|
||||
auto item = tr::lng_context_translate(tr::now);
|
||||
auto item = (request.selection.empty()
|
||||
? tr::lng_context_translate
|
||||
: tr::lng_context_translate_selected)(tr::now);
|
||||
request.menu->addAction(std::move(item), [=] {
|
||||
controller->window().show(Box(
|
||||
Ui::TranslateBox,
|
||||
peer,
|
||||
MsgId(),
|
||||
state->labelText.current(),
|
||||
request.selection.empty()
|
||||
? state->labelText.current()
|
||||
: Ui::Text::Mid(
|
||||
state->labelText.current(),
|
||||
request.selection.from,
|
||||
request.selection.to - request.selection.from),
|
||||
false));
|
||||
});
|
||||
});
|
||||
|
Submodule Telegram/lib_ui updated: cb57bef3f0...08b56a1789
Reference in New Issue
Block a user