fix: sync languages & change URL

This commit is contained in:
ZavaruKitsu 2023-06-22 23:55:56 +03:00
parent 6ebcd54c3a
commit 0c0dc3fde8
7 changed files with 27 additions and 74 deletions

View file

@ -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.";

View file

@ -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));

View file

@ -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")),
}));

View file

@ -1 +0,0 @@
venv

View file

@ -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"
}

View file

@ -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

View file

@ -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.')