diff --git a/Telegram/Resources/langs/rewrites/en.json b/Telegram/Resources/langs/rewrites/en.json index 779f066f6..dfed0f314 100644 --- a/Telegram/Resources/langs/rewrites/en.json +++ b/Telegram/Resources/langs/rewrites/en.json @@ -265,5 +265,11 @@ "ktg_jump_to_beginning": "Jump to beginning", "ktg_show_calendar": "Show calendar", "ktg_in_app_update_disabled": "In-app updater is disabled.", + "ktg_experimental_tabbed_panel_by_click": "Show tabbed panel by click", + "ktg_experimental_tabbed_panel_by_click_description": "Show Emoji / Stickers / GIFs panel only after a click.", + "ktg_experimental_view_profile_context_menu": "Add \"View Profile\"", + "ktg_experimental_view_profile_context_menu_description": "Add \"View Profile\" to context menu in chats list", + "ktg_experimental_linux_nvidia_opengl": "Allow OpenGL on the NVIDIA drivers (Linux)", + "ktg_experimental_linux_nvidia_opengl_description": "Qt+OpenGL have problems on Linux with NVIDIA drivers.", "dummy_last_string": "" } diff --git a/Telegram/Resources/langs/rewrites/ru.json b/Telegram/Resources/langs/rewrites/ru.json index ae321eb26..500485168 100644 --- a/Telegram/Resources/langs/rewrites/ru.json +++ b/Telegram/Resources/langs/rewrites/ru.json @@ -265,5 +265,11 @@ "ktg_jump_to_beginning": "Перейти в начало", "ktg_show_calendar": "Показать календарь", "ktg_in_app_update_disabled": "Обновление внутри приложения отключено.", + "ktg_experimental_tabbed_panel_by_click": "Панель с вкладками по клику", + "ktg_experimental_tabbed_panel_by_click_description": "Показывать панель эмодзи / стикеров / GIF только после клика.", + "ktg_experimental_view_profile_context_menu": "Добавить \"Показать профиль\"", + "ktg_experimental_view_profile_context_menu_description": "Добавить пункт \"Показать профиль\" в контекстное меню списка чатов.", + "ktg_experimental_linux_nvidia_opengl": "OpenGL на драйверах NVIDIA (Linux)", + "ktg_experimental_linux_nvidia_opengl_description": "У Qt+OpenGL есть проблемы на Linux с драйверами NVIDIA.", "dummy_last_string": "" } diff --git a/Telegram/SourceFiles/settings/settings_experimental.cpp b/Telegram/SourceFiles/settings/settings_experimental.cpp index 9e264f82b..d8c040dbe 100644 --- a/Telegram/SourceFiles/settings/settings_experimental.cpp +++ b/Telegram/SourceFiles/settings/settings_experimental.cpp @@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "settings/settings_experimental.h" +#include "kotato/kotato_lang.h" #include "ui/boxes/confirm_box.h" #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" @@ -26,13 +27,34 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Settings { namespace { +// format: { key, { name, description }} +const std::map> TranslationMap { + { ChatHelpers::kOptionTabbedPanelShowOnClick, { + "ktg_experimental_tabbed_panel_by_click", + "ktg_experimental_tabbed_panel_by_click_description", + }}, + { Window::kOptionViewProfileInChatsListContextMenu, { + "ktg_experimental_view_profile_context_menu", + "ktg_experimental_view_profile_context_menu_description", + }}, + { Ui::GL::kOptionAllowLinuxNvidiaOpenGL, { + "ktg_experimental_linux_nvidia_opengl", + "ktg_experimental_linux_nvidia_opengl_description", + }}, +}; + void AddOption( not_null window, not_null container, base::options::option &option, rpl::producer<> resetClicks) { auto &lifetime = container->lifetime(); - const auto name = option.name().isEmpty() ? option.id() : option.name(); + const auto translation = TranslationMap.find(option.id()); + const auto name = translation != TranslationMap.end() + ? ktr(translation->second.first) + : option.name().isEmpty() + ? option.id() + : option.name(); const auto toggles = lifetime.make_state>(); std::move( resetClicks @@ -72,7 +94,10 @@ void AddOption( } }, container->lifetime()); - const auto &description = option.description(); + const auto &description = (translation != TranslationMap.end() + && !translation->second.second.isEmpty()) + ? ktr(translation->second.second) + : option.description(); if (!description.isEmpty()) { AddSkip(container, st::settingsCheckboxesSkip); AddDividerText(container, rpl::single(description));