Added ability to translate selected text in profile section.
This commit is contained in:
parent
20a13663a6
commit
ef8c07e6eb
|
@ -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(),
|
||||||
|
request.selection.empty()
|
||||||
|
? state->labelText.current()
|
||||||
|
: Ui::Text::Mid(
|
||||||
state->labelText.current(),
|
state->labelText.current(),
|
||||||
|
request.selection.from,
|
||||||
|
request.selection.to - request.selection.from),
|
||||||
false));
|
false));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit cb57bef3f01b7ec60eb0eae0ee68cd56cb3a9b1f
|
Subproject commit 08b56a17892d4c9c6b7ef87fcffbb64090e9ce2a
|
Loading…
Reference in New Issue