Localize self-destruct messages button to Russian

This commit is contained in:
Eric Kotato 2021-08-15 11:37:44 +03:00
parent d30f7a8221
commit 34cf89ec59
11 changed files with 53 additions and 7 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_changes.h" #include "data/data_changes.h"
#include "main/main_session.h" #include "main/main_session.h"
#include "lang/lang_keys.h" #include "lang/lang_keys.h"
#include "lang/lang_instance.h"
#include "boxes/peers/edit_peer_info_box.h" #include "boxes/peers/edit_peer_info_box.h"
#include "ui/boxes/auto_delete_settings.h" #include "ui/boxes/auto_delete_settings.h"
#include "ui/toast/toast.h" #include "ui/toast/toast.h"
@ -26,6 +27,46 @@ namespace {
constexpr auto kToastDuration = crl::time(3500); constexpr auto kToastDuration = crl::time(3500);
enum {
TTLIcon1 = 0,
TTLIcon1Over,
TTLIcon2,
TTLIcon2Over,
TTLIcon3,
TTLIcon3Over
};
QList<const style::icon *> defaultLangTTLIcons = {
nullptr,
nullptr,
&st::historyMessagesTTL2Icon,
&st::historyMessagesTTL2IconOver,
&st::historyMessagesTTL3Icon,
&st::historyMessagesTTL3IconOver
};
QList<const style::icon *> ruLangTTLIcons = {
&st::historyMessagesTTLRUIcon,
&st::historyMessagesTTLRUIconOver,
&st::historyMessagesTTLRU2Icon,
&st::historyMessagesTTLRU2IconOver,
&st::historyMessagesTTLRU3Icon,
&st::historyMessagesTTLRU3IconOver
};
const QList<const style::icon *> &TTLIconsList() {
const auto baseLang = Lang::GetInstance().baseId();
const auto currentLang = Lang::Id();
for (const auto language : { "ru", "uk", "be" }) {
if (baseLang.startsWith(QLatin1String(language)) || currentLang == QString(language)) {
return ruLangTTLIcons;
}
}
return defaultLangTTLIcons;
}
} // namespace } // namespace
void ShowAutoDeleteToast(not_null<PeerData*> peer) { void ShowAutoDeleteToast(not_null<PeerData*> peer) {
@ -96,6 +137,9 @@ void AutoDeleteSettingsBox(
TTLButton::TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer) TTLButton::TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer)
: _peer(peer) : _peer(peer)
, _button(parent, st::historyMessagesTTL) { , _button(parent, st::historyMessagesTTL) {
const auto iconsList = TTLIconsList();
_button.setIconOverride(iconsList[TTLIcon1], iconsList[TTLIcon1Over]);
_button.setClickedCallback([=] { _button.setClickedCallback([=] {
const auto canEdit = peer->isUser() const auto canEdit = peer->isUser()
|| (peer->isChat() || (peer->isChat()
@ -116,15 +160,11 @@ TTLButton::TTLButton(not_null<QWidget*> parent, not_null<PeerData*> peer)
) | rpl::start_with_next([=] { ) | rpl::start_with_next([=] {
const auto ttl = peer->messagesTTL(); const auto ttl = peer->messagesTTL();
if (ttl < 2 * 86400) { if (ttl < 2 * 86400) {
_button.setIconOverride(nullptr, nullptr); _button.setIconOverride(iconsList[TTLIcon1], iconsList[TTLIcon1Over]);
} else if (ttl < 8 * 86400) { } else if (ttl < 8 * 86400) {
_button.setIconOverride( _button.setIconOverride(iconsList[TTLIcon2], iconsList[TTLIcon2Over]);
&st::historyMessagesTTL2Icon,
&st::historyMessagesTTL2IconOver);
} else { } else {
_button.setIconOverride( _button.setIconOverride(iconsList[TTLIcon3], iconsList[TTLIcon3Over]);
&st::historyMessagesTTL3Icon,
&st::historyMessagesTTL3IconOver);
} }
}, _button.lifetime()); }, _button.lifetime());
} }

View file

@ -313,6 +313,12 @@ historyMessagesTTL2Icon: icon {{ "chat/input_autodelete_7d", historyComposeIconF
historyMessagesTTL2IconOver: icon {{ "chat/input_autodelete_7d", historyComposeIconFgOver }}; historyMessagesTTL2IconOver: icon {{ "chat/input_autodelete_7d", historyComposeIconFgOver }};
historyMessagesTTL3Icon: icon {{ "chat/input_autodelete_30d", historyComposeIconFg }}; historyMessagesTTL3Icon: icon {{ "chat/input_autodelete_30d", historyComposeIconFg }};
historyMessagesTTL3IconOver: icon {{ "chat/input_autodelete_30d", historyComposeIconFgOver }}; historyMessagesTTL3IconOver: icon {{ "chat/input_autodelete_30d", historyComposeIconFgOver }};
historyMessagesTTLRUIcon: icon {{ "chat/input_autodelete_1d_ru", historyComposeIconFg }};
historyMessagesTTLRUIconOver: icon {{ "chat/input_autodelete_1d_ru", historyComposeIconFgOver }};
historyMessagesTTLRU2Icon: icon {{ "chat/input_autodelete_7d_ru", historyComposeIconFg }};
historyMessagesTTLRU2IconOver: icon {{ "chat/input_autodelete_7d_ru", historyComposeIconFgOver }};
historyMessagesTTLRU3Icon: icon {{ "chat/input_autodelete_30d_ru", historyComposeIconFg }};
historyMessagesTTLRU3IconOver: icon {{ "chat/input_autodelete_30d_ru", historyComposeIconFgOver }};
historyAttachEmojiFgActive: windowActiveTextFg; historyAttachEmojiFgActive: windowActiveTextFg;
historyAttachEmojiActive: icon {{ "chat/input_smile_face", historyAttachEmojiFgActive }}; historyAttachEmojiActive: icon {{ "chat/input_smile_face", historyAttachEmojiFgActive }};
historyAttachEmojiTooltipDelta: 4px; historyAttachEmojiTooltipDelta: 4px;