diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index b1bff342c..61bc31f04 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "data/data_drafts.h" #include "observer_peer.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwindow.h" #include "messenger.h" diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index de24b3ede..740deb32e 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_chat_helpers.h" #include "styles/style_history.h" #include "styles/style_boxes.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "data/data_abstract_structure.h" #include "history/history_service_layout.h" #include "history/history_location_manager.h" diff --git a/Telegram/SourceFiles/boxes/about_box.cpp b/Telegram/SourceFiles/boxes/about_box.cpp index 5f216e604..663037f3a 100644 --- a/Telegram/SourceFiles/boxes/about_box.cpp +++ b/Telegram/SourceFiles/boxes/about_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/about_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "autoupdater.h" diff --git a/Telegram/SourceFiles/boxes/abstract_box.cpp b/Telegram/SourceFiles/boxes/abstract_box.cpp index 95955ffa3..5f3c7e680 100644 --- a/Telegram/SourceFiles/boxes/abstract_box.cpp +++ b/Telegram/SourceFiles/boxes/abstract_box.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/widget_fade_wrap.h" #include "ui/widgets/buttons.h" #include "ui/widgets/scroll_area.h" diff --git a/Telegram/SourceFiles/boxes/add_contact_box.cpp b/Telegram/SourceFiles/boxes/add_contact_box.cpp index b3767f187..16ca841d2 100644 --- a/Telegram/SourceFiles/boxes/add_contact_box.cpp +++ b/Telegram/SourceFiles/boxes/add_contact_box.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "styles/style_dialogs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "messenger.h" #include "boxes/contacts_box.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/boxes/autolock_box.cpp b/Telegram/SourceFiles/boxes/autolock_box.cpp index f96e3ee8b..0573908e0 100644 --- a/Telegram/SourceFiles/boxes/autolock_box.cpp +++ b/Telegram/SourceFiles/boxes/autolock_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/autolock_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwindow.h" #include "ui/widgets/checkbox.h" diff --git a/Telegram/SourceFiles/boxes/background_box.cpp b/Telegram/SourceFiles/boxes/background_box.cpp index 73ba337f6..594c6b21a 100644 --- a/Telegram/SourceFiles/boxes/background_box.cpp +++ b/Telegram/SourceFiles/boxes/background_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/background_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "window/themes/window_theme.h" diff --git a/Telegram/SourceFiles/boxes/calendar_box.cpp b/Telegram/SourceFiles/boxes/calendar_box.cpp index 4ec587fe3..f8827b80e 100644 --- a/Telegram/SourceFiles/boxes/calendar_box.cpp +++ b/Telegram/SourceFiles/boxes/calendar_box.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/buttons.h" #include "styles/style_boxes.h" #include "styles/style_dialogs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/ripple_animation.h" namespace { diff --git a/Telegram/SourceFiles/boxes/change_phone_box.cpp b/Telegram/SourceFiles/boxes/change_phone_box.cpp index 8829914cb..5c17f7c89 100644 --- a/Telegram/SourceFiles/boxes/change_phone_box.cpp +++ b/Telegram/SourceFiles/boxes/change_phone_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/change_phone_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "styles/style_boxes.h" #include "ui/widgets/labels.h" #include "ui/widgets/input_fields.h" diff --git a/Telegram/SourceFiles/boxes/confirm_box.cpp b/Telegram/SourceFiles/boxes/confirm_box.cpp index 591a7e4d0..3a3bad473 100644 --- a/Telegram/SourceFiles/boxes/confirm_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_box.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/confirm_box.h" #include "styles/style_boxes.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "apiwrap.h" diff --git a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp b/Telegram/SourceFiles/boxes/confirm_phone_box.cpp index 90445bee4..196e2d101 100644 --- a/Telegram/SourceFiles/boxes/confirm_phone_box.cpp +++ b/Telegram/SourceFiles/boxes/confirm_phone_box.cpp @@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/input_fields.h" #include "ui/widgets/labels.h" #include "mainwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace { diff --git a/Telegram/SourceFiles/boxes/connection_box.cpp b/Telegram/SourceFiles/boxes/connection_box.cpp index 2b369aeaa..9d9ab003e 100644 --- a/Telegram/SourceFiles/boxes/connection_box.cpp +++ b/Telegram/SourceFiles/boxes/connection_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/connection_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/boxes/contacts_box.cpp b/Telegram/SourceFiles/boxes/contacts_box.cpp index 0364fb6a0..7d0831523 100644 --- a/Telegram/SourceFiles/boxes/contacts_box.cpp +++ b/Telegram/SourceFiles/boxes/contacts_box.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_dialogs.h" #include "styles/style_history.h" #include "styles/style_profile.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/add_contact_box.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/boxes/download_path_box.cpp b/Telegram/SourceFiles/boxes/download_path_box.cpp index b25c57bef..a89a9e1e2 100644 --- a/Telegram/SourceFiles/boxes/download_path_box.cpp +++ b/Telegram/SourceFiles/boxes/download_path_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/download_path_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "core/file_utilities.h" #include "ui/widgets/checkbox.h" diff --git a/Telegram/SourceFiles/boxes/edit_color_box.cpp b/Telegram/SourceFiles/boxes/edit_color_box.cpp index 79720ed6b..3c3420216 100644 --- a/Telegram/SourceFiles/boxes/edit_color_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_color_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/edit_color_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "styles/style_boxes.h" #include "ui/widgets/shadow.h" #include "styles/style_mediaview.h" diff --git a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp index 8e52170e5..14c7f15b3 100644 --- a/Telegram/SourceFiles/boxes/edit_privacy_box.cpp +++ b/Telegram/SourceFiles/boxes/edit_privacy_box.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/effects/widget_slide_wrap.h" #include "boxes/peer_list_box.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace { diff --git a/Telegram/SourceFiles/boxes/emoji_box.cpp b/Telegram/SourceFiles/boxes/emoji_box.cpp index 954021874..19b7140c6 100644 --- a/Telegram/SourceFiles/boxes/emoji_box.cpp +++ b/Telegram/SourceFiles/boxes/emoji_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/emoji_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/boxes/language_box.cpp b/Telegram/SourceFiles/boxes/language_box.cpp index eb4d005ab..ee72a10f6 100644 --- a/Telegram/SourceFiles/boxes/language_box.cpp +++ b/Telegram/SourceFiles/boxes/language_box.cpp @@ -20,14 +20,14 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/language_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/widgets/checkbox.h" #include "ui/widgets/buttons.h" #include "storage/localstorage.h" #include "boxes/confirm_box.h" #include "mainwidget.h" #include "mainwindow.h" -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" #include "styles/style_boxes.h" void LanguageBox::prepare() { @@ -48,7 +48,7 @@ void LanguageBox::prepare() { for (auto i = 0; i != languageCount; ++i) { LangLoaderResult result; if (i) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), langLoaderRequest(lng_language_name)); + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), { lng_language_name }); result = loader.found(); } else { result.insert(lng_language_name, langOriginal(lng_language_name)); @@ -66,7 +66,7 @@ void LanguageBox::prepare() { void LanguageBox::mousePressEvent(QMouseEvent *e) { if ((e->modifiers() & Qt::CTRL) && (e->modifiers() & Qt::ALT) && (e->modifiers() & Qt::SHIFT)) { for (int32 i = 1; i < languageCount; ++i) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), langLoaderRequest(lngkeys_cnt)); + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[i].c_str() + qsl(".strings"), { lngkeys_cnt }); if (!loader.errors().isEmpty()) { Ui::show(Box(qsl("Lang \"") + LanguageCodes[i].c_str() + qsl("\" error :(\n\nError: ") + loader.errors())); return; @@ -90,10 +90,10 @@ void LanguageBox::languageChanged(int languageId) { LangLoaderResult result; if (languageId > 0) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[languageId].c_str() + qsl(".strings"), langLoaderRequest(lng_sure_save_language, lng_cancel, lng_box_ok)); + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[languageId].c_str() + qsl(".strings"), { lng_sure_save_language, lng_cancel, lng_box_ok }); result = loader.found(); } else if (languageId == languageTest) { - LangLoaderPlain loader(cLangFile(), langLoaderRequest(lng_sure_save_language, lng_cancel, lng_box_ok)); + LangLoaderPlain loader(cLangFile(), { lng_sure_save_language, lng_cancel, lng_box_ok }); result = loader.found(); } auto text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)), diff --git a/Telegram/SourceFiles/boxes/local_storage_box.cpp b/Telegram/SourceFiles/boxes/local_storage_box.cpp index 4c5a134f8..4329acb07 100644 --- a/Telegram/SourceFiles/boxes/local_storage_box.cpp +++ b/Telegram/SourceFiles/boxes/local_storage_box.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "ui/widgets/buttons.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "auth_session.h" diff --git a/Telegram/SourceFiles/boxes/members_box.cpp b/Telegram/SourceFiles/boxes/members_box.cpp index 50960c354..30971617d 100644 --- a/Telegram/SourceFiles/boxes/members_box.cpp +++ b/Telegram/SourceFiles/boxes/members_box.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "styles/style_dialogs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "boxes/contacts_box.h" diff --git a/Telegram/SourceFiles/boxes/notifications_box.cpp b/Telegram/SourceFiles/boxes/notifications_box.cpp index fcbf0586b..644e5807b 100644 --- a/Telegram/SourceFiles/boxes/notifications_box.cpp +++ b/Telegram/SourceFiles/boxes/notifications_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/notifications_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/widgets/buttons.h" #include "ui/widgets/discrete_sliders.h" #include "styles/style_boxes.h" diff --git a/Telegram/SourceFiles/boxes/passcode_box.cpp b/Telegram/SourceFiles/boxes/passcode_box.cpp index 402bea76f..ea0e0474d 100644 --- a/Telegram/SourceFiles/boxes/passcode_box.cpp +++ b/Telegram/SourceFiles/boxes/passcode_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/passcode_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/confirm_box.h" #include "mainwindow.h" #include "storage/localstorage.h" diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index 16795f1d6..9bc370bb6 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/multi_select.h" #include "ui/widgets/labels.h" #include "ui/effects/widget_slide_wrap.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/round_checkbox.h" #include "boxes/contacts_box.h" #include "window/themes/window_theme.h" diff --git a/Telegram/SourceFiles/boxes/photo_crop_box.cpp b/Telegram/SourceFiles/boxes/photo_crop_box.cpp index 5f1286dfc..7792b8dfb 100644 --- a/Telegram/SourceFiles/boxes/photo_crop_box.cpp +++ b/Telegram/SourceFiles/boxes/photo_crop_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/photo_crop_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "messenger.h" #include "mainwidget.h" #include "storage/file_upload.h" diff --git a/Telegram/SourceFiles/boxes/rate_call_box.cpp b/Telegram/SourceFiles/boxes/rate_call_box.cpp index a09fdd70c..23b62bca3 100644 --- a/Telegram/SourceFiles/boxes/rate_call_box.cpp +++ b/Telegram/SourceFiles/boxes/rate_call_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/rate_call_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "styles/style_boxes.h" #include "styles/style_calls.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/boxes/report_box.cpp b/Telegram/SourceFiles/boxes/report_box.cpp index b8eb15f1e..bf791713a 100644 --- a/Telegram/SourceFiles/boxes/report_box.cpp +++ b/Telegram/SourceFiles/boxes/report_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/report_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "styles/style_boxes.h" #include "styles/style_profile.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/boxes/self_destruction_box.cpp b/Telegram/SourceFiles/boxes/self_destruction_box.cpp index 3e5daf862..a40dda47e 100644 --- a/Telegram/SourceFiles/boxes/self_destruction_box.cpp +++ b/Telegram/SourceFiles/boxes/self_destruction_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/self_destruction_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/widgets/checkbox.h" #include "ui/widgets/labels.h" #include "styles/style_boxes.h" diff --git a/Telegram/SourceFiles/boxes/send_files_box.cpp b/Telegram/SourceFiles/boxes/send_files_box.cpp index 419b6cd41..4faf3f890 100644 --- a/Telegram/SourceFiles/boxes/send_files_box.cpp +++ b/Telegram/SourceFiles/boxes/send_files_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/send_files_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwidget.h" #include "history/history_media_types.h" diff --git a/Telegram/SourceFiles/boxes/sessions_box.cpp b/Telegram/SourceFiles/boxes/sessions_box.cpp index 68d57aa83..e4806b196 100644 --- a/Telegram/SourceFiles/boxes/sessions_box.cpp +++ b/Telegram/SourceFiles/boxes/sessions_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/sessions_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/boxes/share_box.cpp b/Telegram/SourceFiles/boxes/share_box.cpp index 022f9bae8..4f4e9b105 100644 --- a/Telegram/SourceFiles/boxes/share_box.cpp +++ b/Telegram/SourceFiles/boxes/share_box.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "styles/style_history.h" #include "observer_peer.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "mainwidget.h" #include "base/qthelp_url.h" diff --git a/Telegram/SourceFiles/boxes/sticker_set_box.cpp b/Telegram/SourceFiles/boxes/sticker_set_box.cpp index d97d04325..54b42e5f9 100644 --- a/Telegram/SourceFiles/boxes/sticker_set_box.cpp +++ b/Telegram/SourceFiles/boxes/sticker_set_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/sticker_set_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "chat_helpers/stickers.h" diff --git a/Telegram/SourceFiles/boxes/stickers_box.cpp b/Telegram/SourceFiles/boxes/stickers_box.cpp index 364268982..4e71e0b76 100644 --- a/Telegram/SourceFiles/boxes/stickers_box.cpp +++ b/Telegram/SourceFiles/boxes/stickers_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "stickers_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "chat_helpers/stickers.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/boxes/username_box.cpp b/Telegram/SourceFiles/boxes/username_box.cpp index e8b56f7bb..d1f0f30bf 100644 --- a/Telegram/SourceFiles/boxes/username_box.cpp +++ b/Telegram/SourceFiles/boxes/username_box.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "boxes/username_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/calls/calls_box_controller.cpp b/Telegram/SourceFiles/calls/calls_box_controller.cpp index 0dd10ec58..c2e7d96d4 100644 --- a/Telegram/SourceFiles/calls/calls_box_controller.cpp +++ b/Telegram/SourceFiles/calls/calls_box_controller.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_calls.h" #include "styles/style_boxes.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "observer_peer.h" #include "ui/effects/ripple_animation.h" #include "calls/calls_instance.h" diff --git a/Telegram/SourceFiles/calls/calls_call.cpp b/Telegram/SourceFiles/calls/calls_call.cpp index 3877a6988..61cf9065f 100644 --- a/Telegram/SourceFiles/calls/calls_call.cpp +++ b/Telegram/SourceFiles/calls/calls_call.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "auth_session.h" #include "mainwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/confirm_box.h" #include "boxes/rate_call_box.h" #include "calls/calls_instance.h" diff --git a/Telegram/SourceFiles/calls/calls_instance.cpp b/Telegram/SourceFiles/calls/calls_instance.cpp index 36c68ee42..6f1230ddd 100644 --- a/Telegram/SourceFiles/calls/calls_instance.cpp +++ b/Telegram/SourceFiles/calls/calls_instance.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "messenger.h" #include "auth_session.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/confirm_box.h" #include "calls/calls_call.h" #include "calls/calls_panel.h" diff --git a/Telegram/SourceFiles/calls/calls_panel.cpp b/Telegram/SourceFiles/calls/calls_panel.cpp index 8f48c6ee5..c853265b9 100644 --- a/Telegram/SourceFiles/calls/calls_panel.cpp +++ b/Telegram/SourceFiles/calls/calls_panel.cpp @@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/effects/widget_fade_wrap.h" #include "messenger.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "auth_session.h" #include "apiwrap.h" #include "observer_peer.h" diff --git a/Telegram/SourceFiles/calls/calls_top_bar.cpp b/Telegram/SourceFiles/calls/calls_top_bar.cpp index a70464bf1..f23aea0db 100644 --- a/Telegram/SourceFiles/calls/calls_top_bar.cpp +++ b/Telegram/SourceFiles/calls/calls_top_bar.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_calls.h" #include "ui/widgets/buttons.h" #include "ui/widgets/labels.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "calls/calls_call.h" #include "calls/calls_instance.h" #include "styles/style_boxes.h" diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index a2c25bd16..67deeff07 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/buttons.h" #include "styles/style_chat_helpers.h" #include "ui/widgets/shadow.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace ChatHelpers { namespace { diff --git a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp index df994ec7d..6f3410b5f 100644 --- a/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/gifs_list_widget.cpp @@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "inline_bots/inline_bot_result.h" #include "chat_helpers/stickers.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "window/window_controller.h" diff --git a/Telegram/SourceFiles/chat_helpers/stickers.cpp b/Telegram/SourceFiles/chat_helpers/stickers.cpp index 0f7ea3c23..a77dea10e 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/stickers_box.h" #include "boxes/confirm_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "apiwrap.h" #include "storage/localstorage.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 5ebc54647..c861bee54 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "inline_bots/inline_bot_result.h" #include "chat_helpers/stickers.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "dialogs/dialogs_layout.h" #include "boxes/sticker_set_box.h" diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp index 183037cef..284ddc8ca 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_selector.cpp @@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/discrete_sliders.h" #include "ui/widgets/scroll_area.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" namespace ChatHelpers { diff --git a/Telegram/SourceFiles/codegen/lang/generator.cpp b/Telegram/SourceFiles/codegen/lang/generator.cpp index e1f68e394..3dc0426ba 100644 --- a/Telegram/SourceFiles/codegen/lang/generator.cpp +++ b/Telegram/SourceFiles/codegen/lang/generator.cpp @@ -181,7 +181,7 @@ inline LangString " << entry.key << "(" << params.join(QString(", ")) << ") {\n\ bool Generator::writeSource() { source_ = std::make_unique(basePath_ + ".cpp", project_); - source_->include("lang.h").pushNamespace().stream() << "\ + source_->include("lang/lang_keys.h").pushNamespace().stream() << "\ const char *_langKeyNames[lngkeys_cnt] = {\n\ \n"; for (auto &entry : langpack_.entries) { diff --git a/Telegram/SourceFiles/core/click_handler_types.cpp b/Telegram/SourceFiles/core/click_handler_types.cpp index c614df927..d75389c9c 100644 --- a/Telegram/SourceFiles/core/click_handler_types.cpp +++ b/Telegram/SourceFiles/core/click_handler_types.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "core/click_handler_types.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "platform/platform_specific.h" #include "boxes/confirm_box.h" #include "base/qthelp_regex.h" diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index ea22ca44f..0c7a2a3f6 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "dialogs/dialogs_list.h" #include "styles/style_dialogs.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Dialogs { namespace Layout { diff --git a/Telegram/SourceFiles/dialogswidget.cpp b/Telegram/SourceFiles/dialogswidget.cpp index b8d68e31e..7fb6526f3 100644 --- a/Telegram/SourceFiles/dialogswidget.cpp +++ b/Telegram/SourceFiles/dialogswidget.cpp @@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/buttons.h" #include "ui/widgets/popup_menu.h" #include "data/data_drafts.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwindow.h" #include "dialogswidget.h" diff --git a/Telegram/SourceFiles/facades.cpp b/Telegram/SourceFiles/facades.cpp index 2ffd033f9..63c545890 100644 --- a/Telegram/SourceFiles/facades.cpp +++ b/Telegram/SourceFiles/facades.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "messenger.h" #include "boxes/confirm_box.h" #include "layerwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "base/observer.h" #include "base/task_queue.h" diff --git a/Telegram/SourceFiles/history.cpp b/Telegram/SourceFiles/history.cpp index fd63c7944..c700e23ee 100644 --- a/Telegram/SourceFiles/history.cpp +++ b/Telegram/SourceFiles/history.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "dialogs/dialogs_indexed_list.h" #include "styles/style_dialogs.h" #include "data/data_drafts.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "apiwrap.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/history/history_drag_area.cpp b/Telegram/SourceFiles/history/history_drag_area.cpp index 1e943f680..d70fd363b 100644 --- a/Telegram/SourceFiles/history/history_drag_area.cpp +++ b/Telegram/SourceFiles/history/history_drag_area.cpp @@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "dialogs/dialogs_layout.h" #include "historywidget.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "apiwrap.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/history/history_inner_widget.cpp b/Telegram/SourceFiles/history/history_inner_widget.cpp index b8a06dfd4..b38ea3d04 100644 --- a/Telegram/SourceFiles/history/history_inner_widget.cpp +++ b/Telegram/SourceFiles/history/history_inner_widget.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "auth_session.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace { diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 0eba7c208..662c4ce8f 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "history/history_item.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "history/history_service_layout.h" #include "media/media_clip_reader.h" diff --git a/Telegram/SourceFiles/history/history_location_manager.cpp b/Telegram/SourceFiles/history/history_location_manager.cpp index adb87c867..a8be64365 100644 --- a/Telegram/SourceFiles/history/history_location_manager.cpp +++ b/Telegram/SourceFiles/history/history_location_manager.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "history/history_location_manager.h" #include "mainwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "platform/platform_specific.h" namespace { diff --git a/Telegram/SourceFiles/history/history_media_types.cpp b/Telegram/SourceFiles/history/history_media_types.cpp index 2a2c391ec..bc355487e 100644 --- a/Telegram/SourceFiles/history/history_media_types.cpp +++ b/Telegram/SourceFiles/history/history_media_types.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "history/history_media_types.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "storage/localstorage.h" diff --git a/Telegram/SourceFiles/history/history_message.cpp b/Telegram/SourceFiles/history/history_message.cpp index 9b8561b7c..bd7f4a0c6 100644 --- a/Telegram/SourceFiles/history/history_message.cpp +++ b/Telegram/SourceFiles/history/history_message.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "history/history_message.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "apiwrap.h" diff --git a/Telegram/SourceFiles/history/history_service_layout.cpp b/Telegram/SourceFiles/history/history_service_layout.cpp index 921cae0a0..d7986d87b 100644 --- a/Telegram/SourceFiles/history/history_service_layout.cpp +++ b/Telegram/SourceFiles/history/history_service_layout.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "data/data_abstract_structure.h" #include "styles/style_history.h" #include "mainwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace HistoryLayout { namespace { diff --git a/Telegram/SourceFiles/historywidget.cpp b/Telegram/SourceFiles/historywidget.cpp index 79f153cd3..dd37764e0 100644 --- a/Telegram/SourceFiles/historywidget.cpp +++ b/Telegram/SourceFiles/historywidget.cpp @@ -50,7 +50,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "chat_helpers/tabbed_selector.h" #include "chat_helpers/bot_keyboard.h" #include "chat_helpers/message_field.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp index acd828480..33c258ff8 100644 --- a/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_bot_layout_internal.cpp @@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "history/history_location_manager.h" #include "storage/localstorage.h" #include "auth_session.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace InlineBots { namespace Layout { diff --git a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp index 7fb9a7a8e..3e7b83845 100644 --- a/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp +++ b/Telegram/SourceFiles/inline_bots/inline_results_widget.cpp @@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "inline_bots/inline_bot_layout_item.h" #include "dialogs/dialogs_layout.h" #include "storage/localstorage.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "apiwrap.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/intro/introcode.cpp b/Telegram/SourceFiles/intro/introcode.cpp index 7d21bb2c0..f25231b83 100644 --- a/Telegram/SourceFiles/intro/introcode.cpp +++ b/Telegram/SourceFiles/intro/introcode.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "intro/introcode.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "intro/introsignup.h" #include "intro/intropwdcheck.h" diff --git a/Telegram/SourceFiles/intro/introphone.cpp b/Telegram/SourceFiles/intro/introphone.cpp index 13b347f82..3665efcfa 100644 --- a/Telegram/SourceFiles/intro/introphone.cpp +++ b/Telegram/SourceFiles/intro/introphone.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "intro/introphone.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "intro/introcode.h" #include "styles/style_intro.h" diff --git a/Telegram/SourceFiles/intro/intropwdcheck.cpp b/Telegram/SourceFiles/intro/intropwdcheck.cpp index 670d80d4c..9f25f4ce8 100644 --- a/Telegram/SourceFiles/intro/intropwdcheck.cpp +++ b/Telegram/SourceFiles/intro/intropwdcheck.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "core/file_utilities.h" #include "boxes/confirm_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "intro/introsignup.h" #include "ui/widgets/buttons.h" diff --git a/Telegram/SourceFiles/intro/introsignup.cpp b/Telegram/SourceFiles/intro/introsignup.cpp index bd6cd8aa6..6dfa587de 100644 --- a/Telegram/SourceFiles/intro/introsignup.cpp +++ b/Telegram/SourceFiles/intro/introsignup.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "core/file_utilities.h" #include "boxes/photo_crop_box.h" #include "boxes/confirm_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "ui/widgets/buttons.h" #include "ui/widgets/input_fields.h" diff --git a/Telegram/SourceFiles/intro/introstart.cpp b/Telegram/SourceFiles/intro/introstart.cpp index 32e7e9782..c98f4993f 100644 --- a/Telegram/SourceFiles/intro/introstart.cpp +++ b/Telegram/SourceFiles/intro/introstart.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "intro/introstart.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "intro/introphone.h" #include "ui/widgets/buttons.h" diff --git a/Telegram/SourceFiles/intro/introwidget.cpp b/Telegram/SourceFiles/intro/introwidget.cpp index 59b046d51..84362407d 100644 --- a/Telegram/SourceFiles/intro/introwidget.cpp +++ b/Telegram/SourceFiles/intro/introwidget.cpp @@ -20,9 +20,9 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "intro/introwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" #include "intro/introstart.h" #include "intro/introphone.h" #include "intro/introcode.h" @@ -64,7 +64,7 @@ Widget::Widget(QWidget *parent) : TWidget(parent) if (cLang() == languageDefault) { auto systemLangId = Sandbox::LangSystem(); if (systemLangId != languageDefault) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), langLoaderRequest(lng_switch_to_this)); + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[systemLangId].c_str() + qsl(".strings"), { lng_switch_to_this }); QString text = loader.found().value(lng_switch_to_this); if (!text.isEmpty()) { _changeLanguage.create(this, object_ptr(this, text), st::introCoverDuration); diff --git a/Telegram/SourceFiles/lang/lang_file_parser.cpp b/Telegram/SourceFiles/lang/lang_file_parser.cpp index 35c86df01..437136c55 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.cpp +++ b/Telegram/SourceFiles/lang/lang_file_parser.cpp @@ -18,7 +18,7 @@ to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" #include "base/parse_helper.h" @@ -45,12 +45,12 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { if (*from != '"') throw Exception(QString("Expected string after '=' in key '%1'!").arg(varName)); LangKey varKey = keyIndex(varName); - bool feedingValue = request.isEmpty(); + bool feedingValue = request.empty(); if (feedingValue) { if (varKey == lngkeys_cnt) { warning(QString("Unknown key '%1'!").arg(varName)); } - } else if (!readingAll && !request.contains(varKey)) { + } else if (!readingAll && request.find(varKey) == request.end()) { varKey = lngkeys_cnt; } bool readingValue = (varKey != lngkeys_cnt); @@ -206,7 +206,7 @@ bool LangLoaderPlain::readKeyValue(const char *&from, const char *end) { return true; } -LangLoaderPlain::LangLoaderPlain(const QString &file, const LangLoaderRequest &request) : file(file), request(request), readingAll(request.contains(lngkeys_cnt)) { +LangLoaderPlain::LangLoaderPlain(const QString &file, const std::set &request) : file(file), request(request), readingAll(request.find(lngkeys_cnt) != request.end()) { QFile f(file); if (!f.open(QIODevice::ReadOnly)) { error(qsl("Could not open input file!")); diff --git a/Telegram/SourceFiles/lang/lang_file_parser.h b/Telegram/SourceFiles/lang/lang_file_parser.h index a4ce49af6..027d7f96a 100644 --- a/Telegram/SourceFiles/lang/lang_file_parser.h +++ b/Telegram/SourceFiles/lang/lang_file_parser.h @@ -20,38 +20,12 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #pragma once -#include "lang.h" - -using LangLoaderRequest = OrderedSet; - -template -struct LangLoaderRequestHelper; - -template <> -struct LangLoaderRequestHelper<> { - static inline void fill(LangLoaderRequest &result) { - } -}; - -template -struct LangLoaderRequestHelper { - static inline void fill(LangLoaderRequest &result, Arg arg, Args ...args) { - result.insert(arg); - LangLoaderRequestHelper::fill(result, args...); - } -}; - -template -inline LangLoaderRequest langLoaderRequest(Args ...args) { - LangLoaderRequest result; - LangLoaderRequestHelper::fill(result, args...); - return result; -} +#include "lang/lang_keys.h" using LangLoaderResult = QMap; class LangLoaderPlain : public LangLoader { public: - LangLoaderPlain(const QString &file, const LangLoaderRequest &request = LangLoaderRequest()); + LangLoaderPlain(const QString &file, const std::set &request = std::set()); LangLoaderResult found() const { return result; @@ -59,7 +33,7 @@ public: protected: QString file; - LangLoaderRequest request; + std::set request; bool readKeyValue(const char *&from, const char *end); diff --git a/Telegram/SourceFiles/lang/lang_keys.cpp b/Telegram/SourceFiles/lang/lang_keys.cpp index 5c08c734b..ba530a73b 100644 --- a/Telegram/SourceFiles/lang/lang_keys.cpp +++ b/Telegram/SourceFiles/lang/lang_keys.cpp @@ -18,9 +18,9 @@ to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ -#include "lang.h" +#include "lang/lang_keys.h" -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" LangString LangString::tag(ushort tag, const QString &replacement) { for (const QChar *s = constData(), *ch = s, *e = ch + size(); ch != e;) { @@ -96,7 +96,7 @@ QString langNewVersionText() { QString langNewVersionTextForLang(int langId) { LangLoaderResult result; if (langId) { - LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[langId].c_str() + qsl(".strings"), langLoaderRequest(lng_language_name, NEW_VER_KEY)); + LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[langId].c_str() + qsl(".strings"), { lng_language_name, NEW_VER_KEY }); result = loader.found(); } else { result.insert(lng_language_name, langOriginal(lng_language_name)); diff --git a/Telegram/SourceFiles/layerwidget.cpp b/Telegram/SourceFiles/layerwidget.cpp index 4e265c575..7789569c1 100644 --- a/Telegram/SourceFiles/layerwidget.cpp +++ b/Telegram/SourceFiles/layerwidget.cpp @@ -18,7 +18,7 @@ to link the code of portions of this program with the OpenSSL library. Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ -#include "lang.h" +#include "lang/lang_keys.h" #include "media/media_clip_reader.h" #include "boxes/abstract_box.h" diff --git a/Telegram/SourceFiles/layout.cpp b/Telegram/SourceFiles/layout.cpp index 86c8adb25..acc76bb2d 100644 --- a/Telegram/SourceFiles/layout.cpp +++ b/Telegram/SourceFiles/layout.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "layout.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "application.h" #include "storage/file_upload.h" diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 2d464fdf2..4d46f68ee 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -37,7 +37,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "historywidget.h" #include "history/history_service_layout.h" #include "overviewwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/add_contact_box.h" #include "storage/file_upload.h" #include "messenger.h" diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index 1c557298e..3472cc710 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/popup_menu.h" #include "ui/widgets/buttons.h" #include "base/zlib_help.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "shortcuts.h" #include "messenger.h" #include "application.h" diff --git a/Telegram/SourceFiles/media/player/media_player_widget.cpp b/Telegram/SourceFiles/media/player/media_player_widget.cpp index 7a2fd58e5..f704da0b6 100644 --- a/Telegram/SourceFiles/media/player/media_player_widget.cpp +++ b/Telegram/SourceFiles/media/player/media_player_widget.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/shadow.h" #include "ui/widgets/buttons.h" #include "ui/effects/ripple_animation.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "media/media_audio.h" #include "media/view/media_clip_playback.h" #include "media/player/media_player_button.h" diff --git a/Telegram/SourceFiles/mediaview.cpp b/Telegram/SourceFiles/mediaview.cpp index 3cb4520b2..e0e0696f5 100644 --- a/Telegram/SourceFiles/mediaview.cpp +++ b/Telegram/SourceFiles/mediaview.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "mediaview.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "mainwindow.h" #include "application.h" diff --git a/Telegram/SourceFiles/messenger.cpp b/Telegram/SourceFiles/messenger.cpp index 2e8cca15a..308910eaf 100644 --- a/Telegram/SourceFiles/messenger.cpp +++ b/Telegram/SourceFiles/messenger.cpp @@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "auth_session.h" #include "apiwrap.h" #include "calls/calls_instance.h" -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" #include "observer_peer.h" #include "storage/file_upload.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/mtproto/connection.cpp b/Telegram/SourceFiles/mtproto/connection.cpp index d062b8c17..bb6bf48ed 100644 --- a/Telegram/SourceFiles/mtproto/connection.cpp +++ b/Telegram/SourceFiles/mtproto/connection.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include #include #include "zlib.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "base/openssl_help.h" #include "mtproto/rsa_public_key.h" diff --git a/Telegram/SourceFiles/mtproto/core_types.cpp b/Telegram/SourceFiles/mtproto/core_types.cpp index a8b9f3ae5..717da8d67 100644 --- a/Telegram/SourceFiles/mtproto/core_types.cpp +++ b/Telegram/SourceFiles/mtproto/core_types.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "zlib.h" -#include "lang.h" +#include "lang/lang_keys.h" QString mtpWrapNumber(float64 number) { return QString::number(number); diff --git a/Telegram/SourceFiles/overview/overview_layout.cpp b/Telegram/SourceFiles/overview/overview_layout.cpp index 4faaf5b81..c628c4c82 100644 --- a/Telegram/SourceFiles/overview/overview_layout.cpp +++ b/Telegram/SourceFiles/overview/overview_layout.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "core/file_utilities.h" #include "boxes/add_contact_box.h" #include "boxes/confirm_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "application.h" #include "storage/file_upload.h" diff --git a/Telegram/SourceFiles/overviewwidget.cpp b/Telegram/SourceFiles/overviewwidget.cpp index cdf170fbe..becf8a625 100644 --- a/Telegram/SourceFiles/overviewwidget.cpp +++ b/Telegram/SourceFiles/overviewwidget.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/input_fields.h" #include "window/top_bar_widget.h" #include "window/themes/window_theme.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "mainwidget.h" #include "overviewwidget.h" diff --git a/Telegram/SourceFiles/passcodewidget.cpp b/Telegram/SourceFiles/passcodewidget.cpp index 361c14364..bf7f31a45 100644 --- a/Telegram/SourceFiles/passcodewidget.cpp +++ b/Telegram/SourceFiles/passcodewidget.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "passcodewidget.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwindow.h" #include "messenger.h" diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index a71aeced9..099b504d8 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwindow.h" #include "messenger.h" #include "application.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" namespace Platform { diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index b9f06b666..25ded0100 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "window/notifications_utilities.h" #include "platform/linux/linux_libnotify.h" #include "platform/linux/linux_libs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "base/task_queue.h" namespace Platform { diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 5d4bf6179..edbcca4b7 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -18,7 +18,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "platform/linux/specific_linux.h" #include "platform/linux/linux_libs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/platform/mac/mac_utilities.h b/Telegram/SourceFiles/platform/mac/mac_utilities.h index 4812c75f8..55cbe3bb5 100644 --- a/Telegram/SourceFiles/platform/mac/mac_utilities.h +++ b/Telegram/SourceFiles/platform/mac/mac_utilities.h @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #pragma once -#include "lang.h" +#include "lang/lang_keys.h" #include diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 2b113c761..ecb32f3c8 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "platform/platform_notifications_manager.h" #include "boxes/contacts_box.h" #include "boxes/about_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "platform/mac/mac_utilities.h" #include diff --git a/Telegram/SourceFiles/platform/mac/specific_mac.cpp b/Telegram/SourceFiles/platform/mac/specific_mac.cpp index b519e29b2..bde81f6ed 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac.cpp +++ b/Telegram/SourceFiles/platform/mac/specific_mac.cpp @@ -17,7 +17,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "platform/mac/specific_mac.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "mainwidget.h" #include "historywidget.h" diff --git a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm index 03cf31959..47af332f0 100644 --- a/Telegram/SourceFiles/platform/mac/specific_mac_p.mm +++ b/Telegram/SourceFiles/platform/mac/specific_mac_p.mm @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "media/media_audio.h" #include "platform/mac/mac_utilities.h" #include "styles/style_window.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "base/timer.h" #include diff --git a/Telegram/SourceFiles/platform/win/file_utilities_win.cpp b/Telegram/SourceFiles/platform/win/file_utilities_win.cpp index 45f4ddb8d..613f122e8 100644 --- a/Telegram/SourceFiles/platform/win/file_utilities_win.cpp +++ b/Telegram/SourceFiles/platform/win/file_utilities_win.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwindow.h" #include "storage/localstorage.h" #include "platform/win/windows_dlls.h" -#include "lang.h" +#include "lang/lang_keys.h" #include #include diff --git a/Telegram/SourceFiles/platform/win/main_window_win.cpp b/Telegram/SourceFiles/platform/win/main_window_win.cpp index 8ee3fbb3d..22507ceaa 100644 --- a/Telegram/SourceFiles/platform/win/main_window_win.cpp +++ b/Telegram/SourceFiles/platform/win/main_window_win.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwindow.h" #include "messenger.h" #include "application.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "ui/widgets/popup_menu.h" #include "window/themes/window_theme.h" diff --git a/Telegram/SourceFiles/platform/win/specific_win.cpp b/Telegram/SourceFiles/platform/win/specific_win.cpp index d738c80ae..40e55d76d 100644 --- a/Telegram/SourceFiles/platform/win/specific_win.cpp +++ b/Telegram/SourceFiles/platform/win/specific_win.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "platform/win/windows_app_user_model_id.h" #include "platform/win/windows_dlls.h" #include "platform/win/windows_event_filter.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "mainwidget.h" #include "history/history_location_manager.h" diff --git a/Telegram/SourceFiles/profile/profile_block_actions.cpp b/Telegram/SourceFiles/profile/profile_block_actions.cpp index 6d7dbcbfa..5642f6b28 100644 --- a/Telegram/SourceFiles/profile/profile_block_actions.cpp +++ b/Telegram/SourceFiles/profile/profile_block_actions.cpp @@ -29,7 +29,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "observer_peer.h" #include "apiwrap.h" #include "auth_session.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { diff --git a/Telegram/SourceFiles/profile/profile_block_channel_members.cpp b/Telegram/SourceFiles/profile/profile_block_channel_members.cpp index 6d7111204..bfd1c0292 100644 --- a/Telegram/SourceFiles/profile/profile_block_channel_members.cpp +++ b/Telegram/SourceFiles/profile/profile_block_channel_members.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/buttons.h" #include "boxes/members_box.h" #include "observer_peer.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { diff --git a/Telegram/SourceFiles/profile/profile_block_group_members.cpp b/Telegram/SourceFiles/profile/profile_block_group_members.cpp index bb09d0d77..ccf18e756 100644 --- a/Telegram/SourceFiles/profile/profile_block_group_members.cpp +++ b/Telegram/SourceFiles/profile/profile_block_group_members.cpp @@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "apiwrap.h" #include "observer_peer.h" #include "auth_session.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { diff --git a/Telegram/SourceFiles/profile/profile_block_info.cpp b/Telegram/SourceFiles/profile/profile_block_info.cpp index 3b09a8f28..65272169a 100644 --- a/Telegram/SourceFiles/profile/profile_block_info.cpp +++ b/Telegram/SourceFiles/profile/profile_block_info.cpp @@ -28,7 +28,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "observer_peer.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "messenger.h" namespace Profile { diff --git a/Telegram/SourceFiles/profile/profile_block_invite_link.cpp b/Telegram/SourceFiles/profile/profile_block_invite_link.cpp index ff521c303..12bc7a20b 100644 --- a/Telegram/SourceFiles/profile/profile_block_invite_link.cpp +++ b/Telegram/SourceFiles/profile/profile_block_invite_link.cpp @@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/confirm_box.h" #include "observer_peer.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { diff --git a/Telegram/SourceFiles/profile/profile_block_settings.cpp b/Telegram/SourceFiles/profile/profile_block_settings.cpp index c65d0cd1b..ead6aade6 100644 --- a/Telegram/SourceFiles/profile/profile_block_settings.cpp +++ b/Telegram/SourceFiles/profile/profile_block_settings.cpp @@ -30,7 +30,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "auth_session.h" #include "mainwidget.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" // tmp diff --git a/Telegram/SourceFiles/profile/profile_block_shared_media.cpp b/Telegram/SourceFiles/profile/profile_block_shared_media.cpp index 45476c051..8052a61e5 100644 --- a/Telegram/SourceFiles/profile/profile_block_shared_media.cpp +++ b/Telegram/SourceFiles/profile/profile_block_shared_media.cpp @@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "observer_peer.h" #include "ui/widgets/buttons.h" #include "mainwidget.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { namespace { diff --git a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp index 357661842..d05670aea 100644 --- a/Telegram/SourceFiles/profile/profile_common_groups_section.cpp +++ b/Telegram/SourceFiles/profile/profile_common_groups_section.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "observer_peer.h" #include "apiwrap.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Profile { namespace CommonGroups { diff --git a/Telegram/SourceFiles/profile/profile_cover.cpp b/Telegram/SourceFiles/profile/profile_cover.cpp index 6b05f06ea..c631dd160 100644 --- a/Telegram/SourceFiles/profile/profile_cover.cpp +++ b/Telegram/SourceFiles/profile/profile_cover.cpp @@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/confirm_box.h" #include "boxes/contacts_box.h" #include "boxes/photo_crop_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "apiwrap.h" #include "mainwidget.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/profile/profile_fixed_bar.cpp b/Telegram/SourceFiles/profile/profile_fixed_bar.cpp index 2118cdd8d..c49d3a4c2 100644 --- a/Telegram/SourceFiles/profile/profile_fixed_bar.cpp +++ b/Telegram/SourceFiles/profile/profile_fixed_bar.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_profile.h" #include "styles/style_window.h" #include "ui/widgets/buttons.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "boxes/add_contact_box.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 828624fbe..8c5ad87d2 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings.h" #include "platform/platform_specific.h" -#include "lang.h" +#include "lang/lang_keys.h" bool gRtl = false; Qt::LayoutDirection gLangDir = gRtl ? Qt::RightToLeft : Qt::LeftToRight; diff --git a/Telegram/SourceFiles/settings/settings_advanced_widget.cpp b/Telegram/SourceFiles/settings/settings_advanced_widget.cpp index 7416afb19..ac1f9bb2b 100644 --- a/Telegram/SourceFiles/settings/settings_advanced_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_advanced_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_advanced_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/connection_box.h" #include "boxes/confirm_box.h" #include "boxes/about_box.h" diff --git a/Telegram/SourceFiles/settings/settings_background_widget.cpp b/Telegram/SourceFiles/settings/settings_background_widget.cpp index c7895fb0d..84f023c3f 100644 --- a/Telegram/SourceFiles/settings/settings_background_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_background_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_background_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwidget.h" #include "boxes/background_box.h" #include "ui/effects/widget_slide_wrap.h" diff --git a/Telegram/SourceFiles/settings/settings_chat_settings_widget.cpp b/Telegram/SourceFiles/settings/settings_chat_settings_widget.cpp index 9d919219d..9904b9422 100644 --- a/Telegram/SourceFiles/settings/settings_chat_settings_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_chat_settings_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_chat_settings_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/widget_slide_wrap.h" #include "ui/widgets/checkbox.h" #include "ui/widgets/buttons.h" diff --git a/Telegram/SourceFiles/settings/settings_cover.cpp b/Telegram/SourceFiles/settings/settings_cover.cpp index c89ac773f..48840c033 100644 --- a/Telegram/SourceFiles/settings/settings_cover.cpp +++ b/Telegram/SourceFiles/settings/settings_cover.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/labels.h" #include "ui/widgets/buttons.h" #include "observer_peer.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "messenger.h" #include "mainwindow.h" #include "apiwrap.h" diff --git a/Telegram/SourceFiles/settings/settings_general_widget.cpp b/Telegram/SourceFiles/settings/settings_general_widget.cpp index cdfc7683a..9f2097e0a 100644 --- a/Telegram/SourceFiles/settings/settings_general_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_general_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_general_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/widget_slide_wrap.h" #include "ui/widgets/checkbox.h" #include "ui/widgets/buttons.h" @@ -33,7 +33,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/confirm_box.h" #include "boxes/about_box.h" #include "core/file_utilities.h" -#include "langloaderplain.h" +#include "lang/lang_file_parser.h" #include "autoupdater.h" namespace Settings { @@ -213,7 +213,7 @@ void GeneralWidget::chooseCustomLang() { } _testLanguage = QFileInfo(result.paths.front()).absoluteFilePath(); - LangLoaderPlain loader(_testLanguage, langLoaderRequest(lng_sure_save_language, lng_cancel, lng_box_ok)); + LangLoaderPlain loader(_testLanguage, { lng_sure_save_language, lng_cancel, lng_box_ok }); if (loader.errors().isEmpty()) { LangLoaderResult result = loader.found(); auto text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)), diff --git a/Telegram/SourceFiles/settings/settings_info_widget.cpp b/Telegram/SourceFiles/settings/settings_info_widget.cpp index c1c7dc8fd..587dbdb8c 100644 --- a/Telegram/SourceFiles/settings/settings_info_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_info_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_info_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/widgets/labels.h" #include "ui/effects/widget_slide_wrap.h" #include "boxes/username_box.h" diff --git a/Telegram/SourceFiles/settings/settings_notifications_widget.cpp b/Telegram/SourceFiles/settings/settings_notifications_widget.cpp index 554191160..60f4268fa 100644 --- a/Telegram/SourceFiles/settings/settings_notifications_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_notifications_widget.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "settings/settings_notifications_widget.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "ui/effects/widget_slide_wrap.h" #include "ui/widgets/checkbox.h" diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index ebcafae10..bb409ed9d 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "settings/settings_privacy_controllers.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "apiwrap.h" #include "observer_peer.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp index f35b4814c..ca5f61af5 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_widget.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/effects/widget_slide_wrap.h" #include "ui/widgets/buttons.h" #include "styles/style_settings.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "platform/platform_specific.h" #include "boxes/sessions_box.h" diff --git a/Telegram/SourceFiles/settings/settings_scale_widget.cpp b/Telegram/SourceFiles/settings/settings_scale_widget.cpp index 4a509040a..a0b8d01fb 100644 --- a/Telegram/SourceFiles/settings/settings_scale_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_scale_widget.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_boxes.h" #include "styles/style_settings.h" #include "ui/widgets/checkbox.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "storage/localstorage.h" #include "mainwindow.h" #include "boxes/confirm_box.h" diff --git a/Telegram/SourceFiles/settings/settings_widget.cpp b/Telegram/SourceFiles/settings/settings_widget.cpp index e1318e31b..c976cf303 100644 --- a/Telegram/SourceFiles/settings/settings_widget.cpp +++ b/Telegram/SourceFiles/settings/settings_widget.cpp @@ -32,7 +32,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "storage/localstorage.h" #include "boxes/confirm_box.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "messenger.h" #include "mtproto/mtp_instance.h" #include "mtproto/dc_options.h" diff --git a/Telegram/SourceFiles/storage/localimageloader.cpp b/Telegram/SourceFiles/storage/localimageloader.cpp index 4465ef3b2..b2d1f51ff 100644 --- a/Telegram/SourceFiles/storage/localimageloader.cpp +++ b/Telegram/SourceFiles/storage/localimageloader.cpp @@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "media/media_clip_reader.h" #include "mainwidget.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "boxes/confirm_box.h" namespace { diff --git a/Telegram/SourceFiles/storage/localstorage.cpp b/Telegram/SourceFiles/storage/localstorage.cpp index b977b46ff..dda780cea 100644 --- a/Telegram/SourceFiles/storage/localstorage.cpp +++ b/Telegram/SourceFiles/storage/localstorage.cpp @@ -27,7 +27,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "observer_peer.h" #include "mainwidget.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "media/media_audio.h" #include "ui/widgets/input_fields.h" #include "mtproto/dc_options.h" diff --git a/Telegram/SourceFiles/structs.cpp b/Telegram/SourceFiles/structs.cpp index 7b0978ac0..0050b89e3 100644 --- a/Telegram/SourceFiles/structs.cpp +++ b/Telegram/SourceFiles/structs.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "structs.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "inline_bots/inline_bot_layout_item.h" #include "observer_peer.h" #include "mainwidget.h" diff --git a/Telegram/SourceFiles/ui/countryinput.cpp b/Telegram/SourceFiles/ui/countryinput.cpp index b9a8fc221..e0024215e 100644 --- a/Telegram/SourceFiles/ui/countryinput.cpp +++ b/Telegram/SourceFiles/ui/countryinput.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "ui/countryinput.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "application.h" #include "ui/widgets/scroll_area.h" #include "ui/widgets/multi_select.h" diff --git a/Telegram/SourceFiles/ui/text/text.cpp b/Telegram/SourceFiles/ui/text/text.cpp index dbc2b0db0..22b75f1cd 100644 --- a/Telegram/SourceFiles/ui/text/text.cpp +++ b/Telegram/SourceFiles/ui/text/text.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "core/click_handler_types.h" #include "ui/text/text_block.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "platform/platform_specific.h" #include "boxes/confirm_box.h" #include "mainwindow.h" diff --git a/Telegram/SourceFiles/ui/widgets/checkbox.cpp b/Telegram/SourceFiles/ui/widgets/checkbox.cpp index de4f10f5b..9a9a762ce 100644 --- a/Telegram/SourceFiles/ui/widgets/checkbox.cpp +++ b/Telegram/SourceFiles/ui/widgets/checkbox.cpp @@ -20,7 +20,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "ui/widgets/checkbox.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/effects/ripple_animation.h" namespace Ui { diff --git a/Telegram/SourceFiles/ui/widgets/dropdown_menu.cpp b/Telegram/SourceFiles/ui/widgets/dropdown_menu.cpp index 58dc7c73a..28a20b000 100644 --- a/Telegram/SourceFiles/ui/widgets/dropdown_menu.cpp +++ b/Telegram/SourceFiles/ui/widgets/dropdown_menu.cpp @@ -18,7 +18,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/dropdown_menu.h" #include "application.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Ui { diff --git a/Telegram/SourceFiles/ui/widgets/input_fields.cpp b/Telegram/SourceFiles/ui/widgets/input_fields.cpp index 57cb1f59c..49703bb70 100644 --- a/Telegram/SourceFiles/ui/widgets/input_fields.cpp +++ b/Telegram/SourceFiles/ui/widgets/input_fields.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwindow.h" #include "ui/countryinput.h" #include "window/themes/window_theme.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "numbers.h" #include "messenger.h" diff --git a/Telegram/SourceFiles/ui/widgets/labels.cpp b/Telegram/SourceFiles/ui/widgets/labels.cpp index 44d0f6ff8..28287ecdc 100644 --- a/Telegram/SourceFiles/ui/widgets/labels.cpp +++ b/Telegram/SourceFiles/ui/widgets/labels.cpp @@ -22,7 +22,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/popup_menu.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Ui { namespace { diff --git a/Telegram/SourceFiles/ui/widgets/multi_select.cpp b/Telegram/SourceFiles/ui/widgets/multi_select.cpp index 2c53f88d2..c560c2963 100644 --- a/Telegram/SourceFiles/ui/widgets/multi_select.cpp +++ b/Telegram/SourceFiles/ui/widgets/multi_select.cpp @@ -25,7 +25,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/input_fields.h" #include "ui/widgets/scroll_area.h" #include "ui/effects/cross_animation.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Ui { namespace { diff --git a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp index df9c28189..7391b07ce 100644 --- a/Telegram/SourceFiles/ui/widgets/popup_menu.cpp +++ b/Telegram/SourceFiles/ui/widgets/popup_menu.cpp @@ -21,7 +21,7 @@ #include "platform/platform_specific.h" #include "application.h" #include "mainwindow.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Ui { diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index c874917dc..37beb8174 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "window/notifications_manager_default.h" #include "media/media_audio_track.h" #include "media/media_audio.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "mainwindow.h" #include "mainwidget.h" #include "apiwrap.h" diff --git a/Telegram/SourceFiles/window/notifications_manager_default.cpp b/Telegram/SourceFiles/window/notifications_manager_default.cpp index 51a59b497..a53eba58f 100644 --- a/Telegram/SourceFiles/window/notifications_manager_default.cpp +++ b/Telegram/SourceFiles/window/notifications_manager_default.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "platform/platform_notifications_manager.h" #include "application.h" #include "messenger.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/widgets/buttons.h" #include "ui/widgets/input_fields.h" #include "dialogs/dialogs_layout.h" diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp index 58facba91..fc1b6993a 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor.cpp @@ -40,7 +40,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/toast/toast.h" #include "core/file_utilities.h" #include "boxes/edit_color_box.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Window { namespace Theme { diff --git a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp index a3056745f..45e76988d 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_editor_block.cpp @@ -23,7 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "styles/style_window.h" #include "ui/effects/ripple_animation.h" #include "boxes/edit_color_box.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Window { namespace Theme { diff --git a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp index e18ea61a8..6066bcedb 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_preview.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_preview.cpp @@ -21,7 +21,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "window/themes/window_theme_preview.h" #include "window/themes/window_theme.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "platform/platform_window_title.h" #include "styles/style_widgets.h" #include "styles/style_window.h" diff --git a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp index 5c7836aaf..35db9b554 100644 --- a/Telegram/SourceFiles/window/themes/window_theme_warning.cpp +++ b/Telegram/SourceFiles/window/themes/window_theme_warning.cpp @@ -24,7 +24,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "ui/widgets/buttons.h" #include "ui/widgets/shadow.h" #include "window/themes/window_theme.h" -#include "lang.h" +#include "lang/lang_keys.h" namespace Window { namespace Theme { diff --git a/Telegram/SourceFiles/window/top_bar_widget.cpp b/Telegram/SourceFiles/window/top_bar_widget.cpp index ccd296aca..f916a63ab 100644 --- a/Telegram/SourceFiles/window/top_bar_widget.cpp +++ b/Telegram/SourceFiles/window/top_bar_widget.cpp @@ -26,7 +26,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "mainwidget.h" #include "mainwindow.h" #include "shortcuts.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "ui/special_buttons.h" #include "ui/widgets/buttons.h" #include "ui/widgets/dropdown_menu.h" diff --git a/Telegram/SourceFiles/window/window_main_menu.cpp b/Telegram/SourceFiles/window/window_main_menu.cpp index 907db320d..000623dc9 100644 --- a/Telegram/SourceFiles/window/window_main_menu.cpp +++ b/Telegram/SourceFiles/window/window_main_menu.cpp @@ -31,7 +31,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org #include "boxes/about_box.h" #include "boxes/peer_list_box.h" #include "calls/calls_box_controller.h" -#include "lang.h" +#include "lang/lang_keys.h" #include "core/click_handler_types.h" #include "observer_peer.h" #include "auth_session.h" diff --git a/Telegram/gyp/telegram_sources.txt b/Telegram/gyp/telegram_sources.txt index 069aa3015..96928b759 100644 --- a/Telegram/gyp/telegram_sources.txt +++ b/Telegram/gyp/telegram_sources.txt @@ -177,6 +177,10 @@ <(src_loc)/intro/introsignup.h <(src_loc)/intro/introstart.cpp <(src_loc)/intro/introstart.h +<(src_loc)/lang/lang_keys.cpp +<(src_loc)/lang/lang_keys.h +<(src_loc)/lang/lang_file_parser.cpp +<(src_loc)/lang/lang_file_parser.h <(src_loc)/media/player/media_player_button.cpp <(src_loc)/media/player/media_player_button.h <(src_loc)/media/player/media_player_cover.cpp @@ -519,10 +523,6 @@ <(src_loc)/history.h <(src_loc)/historywidget.cpp <(src_loc)/historywidget.h -<(src_loc)/lang.cpp -<(src_loc)/lang.h -<(src_loc)/langloaderplain.cpp -<(src_loc)/langloaderplain.h <(src_loc)/layerwidget.cpp <(src_loc)/layerwidget.h <(src_loc)/layout.cpp