From 0c0dc3fde88aa5356a2623926b3b21a93cbb53f2 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu <alexeyzavar@gmail.com> Date: Thu, 22 Jun 2023 23:55:56 +0300 Subject: [PATCH] fix: sync languages & change URL --- Telegram/Resources/langs/lang.strings | 27 +++++++++-- Telegram/SourceFiles/ayu/ayu_lang.cpp | 4 +- .../chat_helpers/stickers_list_widget.cpp | 2 +- ayu-scripts/.gitignore | 1 - ayu-scripts/desktop-specific.json | 11 ----- ayu-scripts/requirements.txt | 9 ---- ayu-scripts/sync-translations.py | 47 ------------------- 7 files changed, 27 insertions(+), 74 deletions(-) delete mode 100644 ayu-scripts/.gitignore delete mode 100644 ayu-scripts/desktop-specific.json delete mode 100644 ayu-scripts/requirements.txt delete mode 100644 ayu-scripts/sync-translations.py diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index d95996c6c..ebc840dd3 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3857,8 +3857,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_SpyEssentialsHeader" = "Spy essentials"; "ayu_KeepDeletedMessages" = "Keep deleted messages"; "ayu_KeepMessagesHistory" = "Keep edits history"; -"ayu_QoLTogglesHeader" = "QoL toggles"; -"ayu_RealForwardTime" = "Show real forward time"; +"ayu_QoLTogglesHeader" = "Useful features"; "ayu_ShowFromChannel" = "Show «channel» label"; "ayu_KeepAliveService" = "Keep Alive Service"; "ayu_EnableAds" = "Enable ads"; @@ -3866,17 +3865,39 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_DeletedMarkText" = "Deleted mark"; "ayu_EditedMarkText" = "Edited mark"; "ayu_ShowGhostToggleInDrawer" = "Show ghost mode toggle"; +"ayu_ShowKllButtonInDrawer" = "Show kill app button"; +"ayu_AyuSyncHeader" = "AyuSync"; +"ayu_AyuSyncStatusTitle" = "Sync status"; +"ayu_AyuSyncStatusOk" = "connected"; +"ayu_AyuSyncStatusErrorDisconnected" = "disconnected"; +"ayu_AyuSyncStatusErrorNotRegistered" = "not registered"; +"ayu_AyuSyncStatusErrorNoToken" = "no token"; +"ayu_AyuSyncStatusErrorInvalidToken" = "invalid token"; +"ayu_AyuSyncStatusErrorNoMVP" = "no MVP"; +"ayu_AyuSyncServerURL" = "AyuSync URL"; +"ayu_AyuSyncServerToken" = "AyuSync token"; +"ayu_AyuSyncEnable" = "Enable synchronization"; +"ayu_AyuSyncVisitProfile" = "Visit profile"; +"ayu_AyuSyncForceSync" = "Force sync clients"; +"ayu_AyuSyncDeviceIdentifier" = "Device identifier"; +"ayu_AyuSyncLastEventSent" = "Last sent event"; +"ayu_AyuSyncLastEventReceived" = "Last received event"; +"ayu_AyuSyncLastEventNever" = "never"; +"ayu_AyuSyncUseSecureConnection" = "Use HTTPS & WSS"; +"ayu_AyuSyncIdentifierCopied" = "Identifier copied to clipboard."; "ayu_CleanDatabase" = "Clean database"; "ayu_WALMode" = "Enable WAL mode"; "ayu_CleanDatabaseNotification" = "AyuGram database cleaned"; "ayu_EnableGhostMode" = "Enable Ghost"; "ayu_DisableGhostMode" = "Disable Ghost"; +"ayu_KillApp" = "Kill App"; "ayu_GhostModeEnabled" = "Ghost mode turned on"; "ayu_GhostModeDisabled" = "Ghost mode turned off"; "ayu_EditsHistoryTitle" = "Edits history"; "ayu_EditsHistoryMenuText" = "History"; "ayu_ReadUntilMenuText" = "Read until"; -"ayu_ForwardsRestrictedInfoDeleted" = "Forwarding of deleted message is not supported."; +"ayu_ForwardsRestrictedInfoDeleted" = "Forwarding of a deleted message is not supported."; +"ayu_DeleteDateMenuText" = "Delete Date"; "ayu_LikelyOfflineStatus" = "offline ?"; "ayu_GhostModeShortcut" = "Enter with Ghost"; "ayu_SettingsWatermark" = "AyuGram developed and maintained by Radolyn Labs."; diff --git a/Telegram/SourceFiles/ayu/ayu_lang.cpp b/Telegram/SourceFiles/ayu/ayu_lang.cpp index ba03424eb..e7c1c8464 100644 --- a/Telegram/SourceFiles/ayu/ayu_lang.cpp +++ b/Telegram/SourceFiles/ayu/ayu_lang.cpp @@ -35,10 +35,10 @@ void CustomLangPack::fetchCustomLangPack(const QString &langPackId, const QStrin QUrl url; if (!finalLangPackId.isEmpty() && !langPackBaseId.isEmpty() && !needFallback) { - url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/localization/translations/desktop/%1.json").arg( + url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/Languages/main/values/langs/%1/Shared.json").arg( finalLangPackId)); } else { - url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/localization/translations/desktop/%1.json").arg( + url.setUrl(qsl("https://raw.githubusercontent.com/AyuGram/Languages/main/values/langs/%1/Shared.json").arg( needFallback ? langPackBaseId : finalLangPackId)); } _chkReply = networkManager.get(QNetworkRequest(url)); diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp index 327eac5ca..b0d591d69 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_widget.cpp @@ -1726,7 +1726,7 @@ void StickersListWidget::mouseReleaseEvent(QMouseEvent *e) { }; Ui::show(Ui::MakeConfirmBox({ - .text = rpl::single(QString("Do you want to send sticker?")), + .text = rpl::single(QString("Do you want to send this sticker?")), .confirmed = sendStickerCallback, .confirmText = rpl::single(QString("Send")), })); diff --git a/ayu-scripts/.gitignore b/ayu-scripts/.gitignore deleted file mode 100644 index 5ceb3864c..000000000 --- a/ayu-scripts/.gitignore +++ /dev/null @@ -1 +0,0 @@ -venv diff --git a/ayu-scripts/desktop-specific.json b/ayu-scripts/desktop-specific.json deleted file mode 100644 index b2cc4edcf..000000000 --- a/ayu-scripts/desktop-specific.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "SettingsWatermark": "AyuGram developed and maintained by Radolyn Labs.", - "SettingsCustomizationHint": "After making changes to the \"Customization\" section, you must restart the application.", - "SettingsRecentStickersCount": "Recent stickers count", - "SettingsShowID": "Show peer ID", - "SettingsShowID_Hide": "Hide", - "SettingsShowMessageSeconds": "Show message seconds", - "ContextCopyID": "Copy ID", - "IDCopiedToast": "ID copied to clipboard.", - "DrawerGhostModeToggle": "Ghost Mode" -} \ No newline at end of file diff --git a/ayu-scripts/requirements.txt b/ayu-scripts/requirements.txt deleted file mode 100644 index b50fb414e..000000000 --- a/ayu-scripts/requirements.txt +++ /dev/null @@ -1,9 +0,0 @@ -beautifulsoup4==4.12.2 -bs4==0.0.1 -certifi==2023.5.7 -charset-normalizer==3.1.0 -idna==3.4 -lxml==4.9.2 -requests==2.31.0 -soupsieve==2.4.1 -urllib3==2.0.2 diff --git a/ayu-scripts/sync-translations.py b/ayu-scripts/sync-translations.py deleted file mode 100644 index b4348c2c4..000000000 --- a/ayu-scripts/sync-translations.py +++ /dev/null @@ -1,47 +0,0 @@ -import json -import os.path -import sys - -import bs4 -import requests - -if os.path.exists('desktop-specific.json'): - os.chdir('../') - -req = requests.get( - 'https://raw.githubusercontent.com/AyuGram/AyuGram4A/rewrite/TMessagesProj/src/main/res/values/ayu.xml' -) - -tree = bs4.BeautifulSoup(req.text, 'xml') - -strings = {} -for string in tree.find_all('string'): - t = string.attrs['name'] - strings[f'ayu_{t}'] = string.text - -with open('./ayu-scripts/desktop-specific.json') as f: - data = json.load(f) - - for k, v in data.items(): - strings[f'ayu_{k}'] = v - -req = requests.get( - 'https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/Telegram/Resources/langs/lang.strings' -) - -data = req.text - -data += ''' - -// AyuGram keys generated - -''' - -for k, v in strings.items(): - escaped = v.replace('"', '\\"') - data += f'"{k}" = "{escaped}";\n' - -with open(os.path.realpath('./Telegram/Resources/langs/lang.strings'), 'w', encoding='utf-8') as f: - f.write(data) - -print('Done.')