mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +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())) {
|
if (Ui::SkipTranslate(state->labelText.current())) {
|
||||||
return;
|
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), [=] {
|
request.menu->addAction(std::move(item), [=] {
|
||||||
controller->window().show(Box(
|
controller->window().show(Box(
|
||||||
Ui::TranslateBox,
|
Ui::TranslateBox,
|
||||||
peer,
|
peer,
|
||||||
MsgId(),
|
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));
|
false));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Submodule Telegram/lib_ui updated: cb57bef3f0...08b56a1789
Reference in New Issue
Block a user