From aafdc5b7829d16e4221945aabcd5af46c3d81ca5 Mon Sep 17 00:00:00 2001 From: John Preston Date: Sun, 21 Dec 2014 00:33:08 +0300 Subject: [PATCH] 0.7.3 - italian and spanish languages added --- Telegram/PrepareWin.bat | 6 ++-- Telegram/Resources/lang.strings | 2 ++ Telegram/SourceFiles/app.cpp | 13 ++++++-- Telegram/SourceFiles/application.cpp | 22 +++++++------- Telegram/SourceFiles/boxes/languagebox.cpp | 8 ++--- Telegram/SourceFiles/config.h | 7 ++--- Telegram/SourceFiles/gui/button.cpp | 1 + Telegram/SourceFiles/gui/button.h | 6 ++++ Telegram/SourceFiles/intro/introsteps.cpp | 6 ++-- Telegram/SourceFiles/lang.h | 13 +------- Telegram/SourceFiles/langs/lang_es.strings | 22 +++++++------- Telegram/SourceFiles/langs/lang_it.strings | 14 +++++---- Telegram/SourceFiles/main.cpp | 9 ------ Telegram/SourceFiles/settings.cpp | 1 + Telegram/SourceFiles/settings.h | 1 + Telegram/SourceFiles/settingswidget.cpp | 31 +++++++++++++++++++- Telegram/SourceFiles/settingswidget.h | 3 ++ Telegram/SourceFiles/types.h | 1 + Telegram/Telegram.plist | 2 +- Telegram/Telegram.rc | Bin 5532 -> 5532 bytes Telegram/Telegram.vcxproj | 1 + Telegram/Telegram.vcxproj.filters | 3 ++ Telegram/Telegram.xcodeproj/project.pbxproj | 12 ++++---- Telegram/Version.sh | 2 +- 24 files changed, 111 insertions(+), 75 deletions(-) diff --git a/Telegram/PrepareWin.bat b/Telegram/PrepareWin.bat index beed1f8f1c..a3f507e61a 100644 --- a/Telegram/PrepareWin.bat +++ b/Telegram/PrepareWin.bat @@ -1,8 +1,8 @@ @echo OFF -set "AppVersionStrSmall=0.7.2" -set "AppVersionStr=0.7.2" -set "AppVersionStrFull=0.7.2.0" +set "AppVersionStrSmall=0.7.3" +set "AppVersionStr=0.7.3" +set "AppVersionStrFull=0.7.3.0" echo. echo Preparing version %AppVersionStr%.. diff --git a/Telegram/Resources/lang.strings b/Telegram/Resources/lang.strings index a2cec8054e..0052f03fca 100644 --- a/Telegram/Resources/lang.strings +++ b/Telegram/Resources/lang.strings @@ -456,6 +456,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_new_authorization" = "{name},\nWe detected a login into your account from a new device on {day}, {date} at {time}\n\nDevice: {device}\nLocation: {location}\n\nIf this wasn't you, you can go to Settings — Terminate other sessions.\n\nThanks,\nThe Telegram Team"; +"lng_new_version7003" = "Telegram Desktop was updated to version {version}\n\n — Italian and Spanish languages added.\n\nFull version history is available here:\n{link}"; + // Mac specific "lng_mac_choose_app" = "Choose Application"; diff --git a/Telegram/SourceFiles/app.cpp b/Telegram/SourceFiles/app.cpp index 67d1a8b458..95713e8d6b 100644 --- a/Telegram/SourceFiles/app.cpp +++ b/Telegram/SourceFiles/app.cpp @@ -1453,6 +1453,7 @@ namespace App { configStream << quint32(dbiLastUpdateCheck) << qint32(cLastUpdateCheck()); configStream << quint32(dbiScale) << qint32(cConfigScale()); configStream << quint32(dbiLang) << qint32(cLang()); + configStream << quint32(dbiLangFile) << cLangFile(); configStream << quint32(dbiConnectionType) << qint32(cConnectionType()); if (cConnectionType() == dbictHttpProxy || cConnectionType() == dbictTcpProxy) { @@ -1556,8 +1557,8 @@ namespace App { p.port = uint32(port); cSetConnectionProxy(p); } - cSetConnectionType(DBIConnectionType(v)); - break; + cSetConnectionType(DBIConnectionType(v)); + break; case dbictHttpAuto: default: cSetConnectionType(dbictAuto); break; }; @@ -1600,11 +1601,17 @@ namespace App { case dbiLang: { qint32 v; configStream >> v; - if (v == languageTestlang || (v >= 0 && v < languageCount)) { + if (v == languageTest || (v >= 0 && v < languageCount)) { cSetLang(v); } } break; + case dbiLangFile: { + QString v; + configStream >> v; + cSetLangFile(v); + } break; + case dbiWindowPosition: { TWindowPos pos; configStream >> pos.x >> pos.y >> pos.w >> pos.h >> pos.moncrc >> pos.maximized; diff --git a/Telegram/SourceFiles/application.cpp b/Telegram/SourceFiles/application.cpp index 2040b896f5..0446e42039 100644 --- a/Telegram/SourceFiles/application.cpp +++ b/Telegram/SourceFiles/application.cpp @@ -129,12 +129,12 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv), cSetIntRetinaFactor(int32(cRetinaFactor())); } - if (cLang() < languageTestlang) { + if (cLang() < languageTest) { cSetLang(languageId()); } - if (cLang() == languageTestlang) { - if (QFileInfo(TestLangFile).exists()) { - LangLoaderPlain loader(TestLangFile); + if (cLang() == languageTest) { + if (QFileInfo(cLangFile()).exists()) { + LangLoaderPlain loader(cLangFile()); cSetLangErrors(loader.errors()); if (!cLangErrors().isEmpty()) { LOG(("Lang load errors: %1").arg(cLangErrors())); @@ -142,9 +142,9 @@ Application::Application(int &argc, char **argv) : PsApplication(argc, argv), LOG(("Lang load warnings: %1").arg(loader.warnings())); } } else { - cSetLang(languageEnglish); + cSetLang(languageDefault); } - } else if (cLang() > languageEnglish && cLang() < languageCount) { + } else if (cLang() > languageDefault && cLang() < languageCount) { LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[cLang()] + qsl(".strings")); if (!loader.errors().isEmpty()) { LOG(("Lang load errors: %1").arg(loader.errors())); @@ -695,10 +695,10 @@ void Application::startApp() { } QNetworkProxyFactory::setUseSystemConfiguration(true); - if (Local::oldMapVersion() < AppVersion) { + if (Local::oldMapVersion() < AppVersion || true) { psRegisterCustomScheme(); - if (Local::oldMapVersion() && Local::oldMapVersion() < FeaturesNotifyVersion) { - QString versionFeatures(QString::fromUtf8(FeaturesNotify).arg(QString::fromStdWString(AppVersionStr))); + if (Local::oldMapVersion() && Local::oldMapVersion() < 7003 || true) { + QString versionFeatures(lng_new_version7003(lt_version, QString::fromStdWString(AppVersionStr), lt_link, qsl("https://desktop.telegram.org/#changelog"))); if (!versionFeatures.isEmpty()) { window->serviceNotification(versionFeatures); } @@ -706,7 +706,7 @@ void Application::startApp() { } if (!cLangErrors().isEmpty()) { - window->showLayer(new ConfirmBox("Lang failed: " + QLatin1String(TestLangFile) + "\n\nError: " + cLangErrors(), true, lang(lng_close))); + window->showLayer(new ConfirmBox("Custom lang failed :(\n\nError: " + cLangErrors(), true, lang(lng_close))); } } @@ -859,7 +859,7 @@ int32 Application::languageId() { return i; } } - return languageEnglish; + return languageDefault; } MainWidget *Application::main() { diff --git a/Telegram/SourceFiles/boxes/languagebox.cpp b/Telegram/SourceFiles/boxes/languagebox.cpp index 90344d88ff..ca7bf97de5 100644 --- a/Telegram/SourceFiles/boxes/languagebox.cpp +++ b/Telegram/SourceFiles/boxes/languagebox.cpp @@ -29,7 +29,7 @@ LanguageBox::LanguageBox() : _done(this, lang(lng_about_done), st::langsCloseButton), _hiding(false), a_opacity(0, 1) { - bool haveTestLang = QFileInfo(TestLangFile).exists() || (cLang() == languageTestlang); + bool haveTestLang = (cLang() == languageTest); _width = st::langsWidth; _height = st::addContactTitleHeight + st::langsPadding.top() + st::langsPadding.bottom() + (languageCount + (haveTestLang ? 1 : 0)) * (st::langPadding.top() + st::rbDefFlat.height + st::langPadding.bottom()) + _done.height(); @@ -37,7 +37,7 @@ _hiding(false), a_opacity(0, 1) { int32 y = st::addContactTitleHeight + st::langsPadding.top(); _langs.reserve(languageCount + (haveTestLang ? 1 : 0)); if (haveTestLang) { - _langs.push_back(new FlatRadiobutton(this, qsl("lang"), languageTestlang, TestLangFile, (cLang() == languageTestlang), st::langButton)); + _langs.push_back(new FlatRadiobutton(this, qsl("lang"), languageTest, qsl("Custom Lang"), (cLang() == languageTest), st::langButton)); _langs.back()->move(st::langsPadding.left() + st::langPadding.left(), y + st::langPadding.top()); y += st::langPadding.top() + _langs.back()->height() + st::langPadding.bottom(); connect(_langs.back(), SIGNAL(changed()), this, SLOT(onChange())); @@ -138,8 +138,8 @@ void LanguageBox::onChange() { if (langId > 0) { LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[langId] + qsl(".strings"), LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue)); result = loader.found(); - } else if (langId == languageTestlang) { - LangLoaderPlain loader(TestLangFile, LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue)); + } else if (langId == languageTest) { + LangLoaderPlain loader(cLangFile(), LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue)); result = loader.found(); } QString text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)), diff --git a/Telegram/SourceFiles/config.h b/Telegram/SourceFiles/config.h index 4ba267f44a..286930c213 100644 --- a/Telegram/SourceFiles/config.h +++ b/Telegram/SourceFiles/config.h @@ -17,8 +17,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -static const int32 AppVersion = 7002; -static const wchar_t *AppVersionStr = L"0.7.2"; +static const int32 AppVersion = 7003; +static const wchar_t *AppVersionStr = L"0.7.3"; static const wchar_t *AppNameOld = L"Telegram Win (Unofficial)"; static const wchar_t *AppName = L"Telegram Desktop"; @@ -26,9 +26,6 @@ static const wchar_t *AppName = L"Telegram Desktop"; static const wchar_t *AppId = L"{53F49750-6209-4FBF-9CA8-7A333C87D1ED}"; // used in updater.cpp and Setup.iss for Windows static const wchar_t *AppFile = L"Telegram"; -static const int32 FeaturesNotifyVersion = 7000; -extern const char *FeaturesNotify; - #include "settings.h" enum { diff --git a/Telegram/SourceFiles/gui/button.cpp b/Telegram/SourceFiles/gui/button.cpp index a7c39c73e6..1dd71e00e6 100644 --- a/Telegram/SourceFiles/gui/button.cpp +++ b/Telegram/SourceFiles/gui/button.cpp @@ -68,6 +68,7 @@ void Button::mouseReleaseEvent(QMouseEvent *e) { _state &= ~StateDown; emit stateChanged(oldState, ButtonByPress); if (oldState & StateOver) { + _modifiers = e->modifiers(); emit clicked(); } else { leaveEvent(e); diff --git a/Telegram/SourceFiles/gui/button.h b/Telegram/SourceFiles/gui/button.h index b473dd256b..232fb4de95 100644 --- a/Telegram/SourceFiles/gui/button.h +++ b/Telegram/SourceFiles/gui/button.h @@ -43,6 +43,10 @@ public: void mouseMoveEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); + Qt::KeyboardModifiers clickModifiers() const { + return _modifiers; + } + void enterEvent(QEvent *e); void leaveEvent(QEvent *e); @@ -58,11 +62,13 @@ public: void setAcceptBoth(bool acceptBoth = true); signals: + void clicked(); void stateChanged(int oldState, ButtonStateChangeSource source); protected: + Qt::KeyboardModifiers _modifiers; int _state; bool _acceptBoth; diff --git a/Telegram/SourceFiles/intro/introsteps.cpp b/Telegram/SourceFiles/intro/introsteps.cpp index f981f9d09a..6b87c08f62 100644 --- a/Telegram/SourceFiles/intro/introsteps.cpp +++ b/Telegram/SourceFiles/intro/introsteps.cpp @@ -32,9 +32,9 @@ _changeLang(this, QString()), _next(this, lang(lng_start_msgs), st::btnIntroNext) { _changeLang.hide(); - if (cLang() == languageEnglish) { + if (cLang() == languageDefault) { int32 l = App::app()->languageId(); - if (l != languageEnglish) { + if (l != languageDefault) { LangLoaderPlain loader(qsl(":/langs/lang_") + LanguageCodes[l] + qsl(".strings"), LangLoaderRequest(lng_switch_to_this)); QString text = loader.found().value(lng_switch_to_this); if (!text.isEmpty()) { @@ -45,7 +45,7 @@ _next(this, lang(lng_start_msgs), st::btnIntroNext) { } } else { _changeLang.setText(langOriginal(lng_switch_to_this)); - parent->langChangeTo(languageEnglish); + parent->langChangeTo(languageDefault); _changeLang.show(); } diff --git a/Telegram/SourceFiles/lang.h b/Telegram/SourceFiles/lang.h index 80aabb7736..6d2be0f7e9 100644 --- a/Telegram/SourceFiles/lang.h +++ b/Telegram/SourceFiles/lang.h @@ -17,23 +17,12 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org */ #pragma once -enum Languages { - languageTestlang = -1, - - languageEnglish = 0, - languageItalian, - languageSpanish, - - languageCount -}; - static const char *LanguageCodes[] = { "en", "it", "es", }; - -static const char *TestLangFile = "testlang.strings"; +static const int languageTest = -1, languageDefault = 0, languageCount = sizeof(LanguageCodes) / sizeof(LanguageCodes[0]); class LangString : public QString { public: diff --git a/Telegram/SourceFiles/langs/lang_es.strings b/Telegram/SourceFiles/langs/lang_es.strings index 963f08aea0..73a2c4df43 100644 --- a/Telegram/SourceFiles/langs/lang_es.strings +++ b/Telegram/SourceFiles/langs/lang_es.strings @@ -92,7 +92,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_flood_error" = "Muchos intentos. Por favor, prueba más tarde."; "lng_deleted" = "Desconocido"; -"lng_intro" = "Te damos la bienvenida a la app oficial para PC de [a href=\"https://telegram.org/\"]Telegram[/a].\nEs [b]rápida[/b] y [b]segura[/b]."; +"lng_intro" = "La app oficial para PC de [a href=\"https://telegram.org/\"]Telegram[/a].\nEs [b]rápida[/b] y [b]segura[/b]."; "lng_start_msgs" = "EMPEZAR A CONVERSAR"; "lng_intro_next" = "SIGUIENTE"; @@ -205,9 +205,9 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_download_path_default" = "carpeta por defecto"; "lng_download_path_clear" = "Borrar todo"; "lng_download_path_header" = "Elegir ruta de la descarga"; -"lng_download_path_default_radio" = "Carpeta de Telegram en las «Descargas» del sistema"; -"lng_download_path_temp_radio" = "Carpeta temporal, borrada al cerrar la sesión o desinstalar"; -"lng_download_path_dir_radio" = "Carpeta personalizada, borrada sólo manualmente"; +"lng_download_path_default_radio" = "Carpeta de Telegram en «Descargas» del sistema"; +"lng_download_path_temp_radio" = "Carpeta temporal, borrada al cerrar sesión"; +"lng_download_path_dir_radio" = "Carpeta personalizada, se borra manualmente"; "lng_download_path_choose" = "Elegir ruta de la descarga"; "lng_sure_clear_downloads" = "¿Quieres eliminar todos los archivos descargados desde la carpeta temporal? Es hecho automáticamente al cerrar sesión o desinstalar el programa."; "lng_download_path_failed" = "La descarga del archivo no se pudo iniciar. Podría provocarse por una ubicación errónea de la descarga.\n\nPuedes cambiar la ruta de la descarga en Ajustes."; @@ -267,7 +267,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_profile_delete_contact" = "Eliminar"; "lng_profile_set_group_photo" = "Poner foto"; "lng_profile_add_participant" = "Añadir miembro"; -"lng_profile_delete_and_exit" = "Abandonar"; +"lng_profile_delete_and_exit" = "Dejar grupo"; "lng_profile_kick" = "Expulsar"; "lng_profile_sure_kick" = "¿Quieres expulsar a {user} del grupo?"; "lng_profile_loading" = "Cargando..."; @@ -340,7 +340,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_empty_history" = ""; "lng_willbe_history" = "Por favor, elige un chat para comenzar a conversar"; "lng_message_with_from" = "[c]{from}:[/c] {message}"; -"lng_from_you" = "Tu"; +"lng_from_you" = "Tú"; "lng_typing" = "escribiendo"; "lng_user_typing" = "{user} está escribiendo"; @@ -381,7 +381,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_context_forward_file" = "Reenviar archivo"; "lng_context_delete_file" = "Eliminar archivo"; "lng_context_close_file" = "Cerrar archivo"; -"lng_context_copy_text" = "Copiar el texto del mensaje"; +"lng_context_copy_text" = "Copiar el texto"; "lng_context_to_msg" = "Ir al mensaje"; "lng_context_forward_msg" = "Reenviar mensaje"; "lng_context_delete_msg" = "Eliminar mensaje"; @@ -437,10 +437,10 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_emoji_no_recent" = "Los emojis recientes estarán aquí"; "lng_about_version" = "Versión {version}"; -"lng_about_text" = "Aplicación oficial de mensajería gratuita, basada en [a href=\"https://core.telegram.org/mtproto\"]MTProto[/a] y la\n[a href=\"https://core.telegram.org/api\"]API de Telegram[/a] para velocidad y seguridad\n\nEste software está bajo licencia [a href=\"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\"]GNU GPL[/a] versión 3,\nel código de fuente está disponible en [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a]."; +"lng_about_text" = "Aplicación oficial basada en [a href=\"https://core.telegram.org/mtproto\"]MTProto[/a] y la [a href=\"https://core.telegram.org/api\"]\nAPI de Telegram[/a] para velocidad y seguridad.\n\nSoftware bajo licencia [a href=\"https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE\"]GNU GPL[/a] versión 3.\nCódigo de fuente disponible en [a href=\"https://github.com/telegramdesktop/tdesktop\"]GitHub[/a]."; "lng_about_done" = "Hecho"; -"lng_search_found_results" = "{count:No messages found|Found # mensaje|Found # mensajes}"; +"lng_search_found_results" = "{count:No se encontraron mensajes|Found # mensaje|Found # mensajes}"; "lng_search_global_results" = "Resultados de la búsqueda global"; "lng_mediaview_save" = "Descargar"; @@ -452,10 +452,12 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_mediaview_n_of_count" = "Foto {n} de {count}"; "lng_mediaview_doc_image" = "Archivo"; -"lng_mediaview_saved" = "La imagen fue guardada en tu carpeta de [c]Descargas[/c]"; +"lng_mediaview_saved" = "La imagen fue guardada en tu carpeta [c]Descargas[/c]"; "lng_new_authorization" = "{name},\nDetectamos un inicio de sesión en tu cuenta desde un nuevo dispositivo el {day}, {date} a las {time}\n\nDispositivo: {device}\nUbicación: {location}\n\nSi no eras tú, puedes ir a Ajustes — Cerrar todas las otras sesiones.\n\nGracias.\nEl equipo de Telegram"; +"lng_new_version7003" = "Telegram Desktop se actualizó a la versión {version}\n\n— Fueron añadidos los idiomas español e italiano.\n\nLa versión completa del historial está aquí:\n{link}"; + // Mac specific "lng_mac_choose_app" = "Elegir aplicación"; diff --git a/Telegram/SourceFiles/langs/lang_it.strings b/Telegram/SourceFiles/langs/lang_it.strings index 92ac58e082..0fc306f5cc 100644 --- a/Telegram/SourceFiles/langs/lang_it.strings +++ b/Telegram/SourceFiles/langs/lang_it.strings @@ -172,7 +172,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_settings_section_general" = "Generali"; "lng_settings_change_lang" = "Cambia lingua"; "lng_languages" = "Lingue"; -"lng_sure_save_language" = "Telegram si riavvierà\nper cambiare lingua"; +"lng_sure_save_language" = "Telegram si riavvierà per cambiare lingua"; "lng_settings_auto_update" = "Aggiorna automaticamente"; "lng_settings_current_version" = "Versione {version}"; "lng_settings_check_now" = "Controlla gli update"; @@ -241,11 +241,11 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_connection_password_ph" = "Password"; "lng_connection_save" = "Salva"; "lng_settings_reset" = "Termina le altre sessioni"; -"lng_settings_reset_sure" = "Sei sicuro di volere terminare tutte le altre sessioni?"; +"lng_settings_reset_sure" = "Sicuro di voler terminare tutte le altre sessioni?"; "lng_settings_reset_button" = "Chiudi"; "lng_settings_reset_done" = "Altre sessioni terminate"; "lng_settings_logout" = "Disconnetti"; -"lng_sure_logout" = "Sei sicuro di volerti disconnettere?"; +"lng_sure_logout" = "Sicuro di volerti disconnettere?"; "lng_settings_need_restart" = "Devi riavviare per applicare\nalcune delle modifiche. Riavviare ora?"; "lng_settings_restart_now" = "Riavvia"; @@ -290,10 +290,10 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_create_group_next" = "Avanti"; "lng_create_group_title" = "Nuovo gruppo"; -"lng_sure_delete_contact" = "Sei sicuro di volere eliminare {contact} dalla tua lista dei contatti?"; -"lng_sure_delete_history" = "Sei sicuro di voler eliminare tutta la cronologia dei messaggi con {contact}?\n\nQuesta azione non può essere annullata."; +"lng_sure_delete_contact" = "Sicuro di volere eliminare {contact} dalla tua lista dei contatti?"; +"lng_sure_delete_history" = "Sicuro di voler eliminare tutta la cronologia dei messaggi con {contact}?\n\nQuesta azione non può essere annullata."; -"lng_sure_delete_and_exit" = "Sei sicuro di voler eliminare tutta la cronologia dei messaggi e abbandonare «{group}»?\n\nQuesta azione non può essere annullata."; +"lng_sure_delete_and_exit" = "Sicuro di voler eliminare tutta la cronologia dei messaggi e abbandonare «{group}»?\n\nQuesta azione non può essere annullata."; "lng_sure_enable_debug" = "Vuoi attivare la modalità DEBUG?\n\nTutti gli eventi di rete verranno registrati."; @@ -456,6 +456,8 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org "lng_new_authorization" = "{name},\nAbbiamo rilevato un accesso al tuo account da un nuovo dispositivo il {day}, {date} alle {time}\n\nDispositivo: {device}\nPosizione: {location}\n\nSe non sei tu, puoi andare su Impostazioni – Termina tutte le sessioni. \n\nGrazie, \nIl Team di Telegram"; +"lng_new_version7003" = "Telegram desktop si è aggiornato alla versione {version}\n\n— Aggiunti l'Italiano e lo Spagnolo\n\nLa cronologia degli update è disponibile qui:\n{link}"; + // Mac specific "lng_mac_choose_app" = "Scegli applicazione"; diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 56bb7e255e..7fe9471ff5 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -19,15 +19,6 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "application.h" #include "pspecific.h" -const char *FeaturesNotify = "\ -Telegram Desktop was updated to version %1\n\ -\n\ - \xe2\x80\x94 Improved single column navigation.\n\ - \xe2\x80\x94 Improved image viewer for large documents.\n\ -\n\ -Full version history is available here:\n\ -https://desktop.telegram.org/#changelog"; - int main(int argc, char *argv[]) { #ifdef _NEED_WIN_GENERATE_DUMP _oldWndExceptionFilter = SetUnhandledExceptionFilter(_exceptionFilter); diff --git a/Telegram/SourceFiles/settings.cpp b/Telegram/SourceFiles/settings.cpp index 400b3d6a45..3137c28ad5 100644 --- a/Telegram/SourceFiles/settings.cpp +++ b/Telegram/SourceFiles/settings.cpp @@ -73,6 +73,7 @@ RecentEmojiPack gRecentEmojis; RecentEmojiPreload gRecentEmojisPreload; int32 gLang = -2; // auto +QString gLangFile; bool gRetina = false; float64 gRetinaFactor = 1.; diff --git a/Telegram/SourceFiles/settings.h b/Telegram/SourceFiles/settings.h index b8a3d61d3b..ff7c046076 100644 --- a/Telegram/SourceFiles/settings.h +++ b/Telegram/SourceFiles/settings.h @@ -146,6 +146,7 @@ DeclareSetting(RecentEmojiPreload, RecentEmojisPreload); const RecentEmojiPack &cGetRecentEmojis(); DeclareSetting(int32, Lang); +DeclareSetting(QString, LangFile); DeclareSetting(QStringList, SendPaths); DeclareSetting(QString, StartUrl); diff --git a/Telegram/SourceFiles/settingswidget.cpp b/Telegram/SourceFiles/settingswidget.cpp index 76ec4e8020..232dcc786f 100644 --- a/Telegram/SourceFiles/settingswidget.cpp +++ b/Telegram/SourceFiles/settingswidget.cpp @@ -30,6 +30,7 @@ Copyright (c) 2014 John Preston, https://desktop.telegram.org #include "boxes/downloadpathbox.h" #include "boxes/usernamebox.h" #include "boxes/languagebox.h" +#include "langloaderplain.h" #include "gui/filedialog.h" #include "localstorage.h" @@ -903,7 +904,35 @@ void SettingsInner::doneResetSessions(const MTPBool &res) { } void SettingsInner::onChangeLanguage() { - App::wnd()->showLayer(new LanguageBox()); + if ((_changeLanguage.clickModifiers() & Qt::ShiftModifier) && (_changeLanguage.clickModifiers() & Qt::AltModifier)) { + QString file; + QByteArray arr; + if (filedialogGetOpenFile(file, arr, qsl("Choose language .strings file"), qsl("Language files (*.strings)"))) { + _testlang = QFileInfo(file).absoluteFilePath(); + LangLoaderPlain loader(_testlang, LangLoaderRequest(lng_sure_save_language, lng_cancel, lng_continue)); + if (loader.errors().isEmpty()) { + LangLoaderResult result = loader.found(); + QString text = result.value(lng_sure_save_language, langOriginal(lng_sure_save_language)), + save = result.value(lng_continue, langOriginal(lng_continue)), + cancel = result.value(lng_cancel, langOriginal(lng_cancel)); + ConfirmBox *box = new ConfirmBox(text, save, cancel); + connect(box, SIGNAL(confirmed()), this, SLOT(onSaveTestLang())); + App::wnd()->showLayer(box); + } else { + App::wnd()->showLayer(new ConfirmBox("Custom lang failed :(\n\nError: " + cLangErrors(), true, lang(lng_close))); + } + } + } else { + App::wnd()->showLayer(new LanguageBox()); + } +} + +void SettingsInner::onSaveTestLang() { + cSetLangFile(_testlang); + cSetLang(languageTest); + App::writeConfig(); + cSetRestarting(true); + App::quit(); } void SettingsInner::onAutoUpdate() { diff --git a/Telegram/SourceFiles/settingswidget.h b/Telegram/SourceFiles/settingswidget.h index 741a998a51..f81b960c9b 100644 --- a/Telegram/SourceFiles/settingswidget.h +++ b/Telegram/SourceFiles/settingswidget.h @@ -143,6 +143,7 @@ public slots: void onPhotoUpdateStart(); void onChangeLanguage(); + void onSaveTestLang(); private: @@ -151,6 +152,8 @@ private: void setScale(DBIScale newScale); + QString _testlang; + UserData *_self; UserData *self() const { return App::self() ? _self : static_cast(0); diff --git a/Telegram/SourceFiles/types.h b/Telegram/SourceFiles/types.h index f80001b3bf..fc0e4884ec 100644 --- a/Telegram/SourceFiles/types.h +++ b/Telegram/SourceFiles/types.h @@ -255,6 +255,7 @@ enum DataBlockId { dbiSendToMenu = 29, dbiCompressPastedImage = 30, dbiLang = 31, + dbiLangFile = 32, dbiEncryptedWithSalt = 333, dbiEncrypted = 444, diff --git a/Telegram/Telegram.plist b/Telegram/Telegram.plist index 6fc60c5fb5..cd9d01bb41 100644 --- a/Telegram/Telegram.plist +++ b/Telegram/Telegram.plist @@ -11,7 +11,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.7.2 + 0.7.3 CFBundleSignature ???? CFBundleURLTypes diff --git a/Telegram/Telegram.rc b/Telegram/Telegram.rc index 7503b2bd38b45008c609ee767e3e79b0bb06bf61..618634620643c61d5e988fe49a33a0154ae8ef81 100644 GIT binary patch delta 50 zcmbQEJx6;(0WYKR + diff --git a/Telegram/Telegram.vcxproj.filters b/Telegram/Telegram.vcxproj.filters index cd432a29b8..2ecce7cae9 100644 --- a/Telegram/Telegram.vcxproj.filters +++ b/Telegram/Telegram.vcxproj.filters @@ -1048,5 +1048,8 @@ langs + + langs + \ No newline at end of file diff --git a/Telegram/Telegram.xcodeproj/project.pbxproj b/Telegram/Telegram.xcodeproj/project.pbxproj index 19a19ca949..820ed95e5c 100644 --- a/Telegram/Telegram.xcodeproj/project.pbxproj +++ b/Telegram/Telegram.xcodeproj/project.pbxproj @@ -1591,7 +1591,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.7.2; + CURRENT_PROJECT_VERSION = 0.7.3; DEBUG_INFORMATION_FORMAT = dwarf; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1609,7 +1609,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 0.7.2; + CURRENT_PROJECT_VERSION = 0.7.3; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_OPTIMIZATION_LEVEL = fast; GCC_PREFIX_HEADER = ./SourceFiles/stdafx.h; @@ -1635,10 +1635,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.7.2; + CURRENT_PROJECT_VERSION = 0.7.3; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.7; - DYLIB_CURRENT_VERSION = 0.7.2; + DYLIB_CURRENT_VERSION = 0.7.3; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; @@ -1778,10 +1778,10 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 0.7.2; + CURRENT_PROJECT_VERSION = 0.7.3; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 0.7; - DYLIB_CURRENT_VERSION = 0.7.2; + DYLIB_CURRENT_VERSION = 0.7.3; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = ""; GCC_GENERATE_DEBUGGING_SYMBOLS = YES; diff --git a/Telegram/Version.sh b/Telegram/Version.sh index 2da12a80cc..d433d5cbeb 100755 --- a/Telegram/Version.sh +++ b/Telegram/Version.sh @@ -1,2 +1,2 @@ -echo 7002 0.7.2 +echo 7003 0.7.3