diff --git a/scripts/generate-android.py b/scripts/generate-android.py index dc488245..f9601658 100644 --- a/scripts/generate-android.py +++ b/scripts/generate-android.py @@ -1,19 +1,21 @@ +import re + from lxml import etree as et import json import os.path +mappings = { + 'zh-hans': 'zh-rCN', + 'zh-hant': 'zh-rTW', + 'he': 'iw' +} + if not os.path.exists('./values'): os.chdir('../') -langs = [ - 'en', - 'ru', - 'be', - 'pt', - 'es', - 'uk' -] +langs = [f for f in os.listdir('./values/langs') if os.path.isdir(f'./values/langs/{f}')] +langs.sort() if not os.path.exists('./out'): os.mkdir('./out') @@ -28,17 +30,38 @@ root = et.Element('resources') for k, v in strings.items(): + if k + '_Android' in strings: + continue + + if k.endswith('_PC'): + continue + + if k.endswith('_Android'): + k = k.replace('_Android', '') + + if k == 'HideAllChats': + continue + string = et.SubElement(root, 'string', {'name': k}) - string.text = v + string.text = v.replace('\'', '\\\'') tree = et.ElementTree(root) + lang = mappings.get(lang, lang) suffix = f'-{lang}' if lang != 'en' else '' if not os.path.exists(f'./out/android/values{suffix}'): os.mkdir(f'./out/android/values{suffix}') - tree.write(f'./out/android/values{suffix}/ayu.xml', pretty_print=True, xml_declaration=True, encoding="utf-8") + tree.write(f'./out/android/values{suffix}/ayu.xml', pretty_print=True, xml_declaration=True, encoding='utf-8') + + # fix CDATA + with open(f'./out/android/values{suffix}/ayu.xml', encoding='utf-8') as f: + data = f.read() + data = re.sub(r'<!\[CDATA\[<a href="(.+?)">(.+?)</a>\]\]>', r'\2]]>', data) + + with open(f'./out/android/values{suffix}/ayu.xml', 'w', encoding='utf-8') as f: + f.write(data) print(f'Processed "{lang}"') diff --git a/scripts/generate-desktop.py b/scripts/generate-desktop.py index 8398f259..1f5f7b8c 100644 --- a/scripts/generate-desktop.py +++ b/scripts/generate-desktop.py @@ -1,16 +1,28 @@ import json import os.path +import re import requests if not os.path.exists('./values'): os.chdir('../') -with open('./values/langs/en/Shared.json') as f: +with open('./values/langs/en/Shared.json', encoding='utf-8') as f: strings = json.load(f) + +def parse_latest_tag(): + r = requests.get('https://github.com/telegramdesktop/tdesktop/tags') + regex = re.compile(r']]> to test and debug your regular expression.", + "RegexFiltersAddAction_Android": "Open regex101", + "RegexFiltersAddError": "Regex syntax error", + "RegexFilterQuickAdd": "Add Filter", + "RegexFilterBulletinText": "Filter added to the **Shared filters**.", + "RegexFilterBulletinAction": "To Current Chat", + "RegexFiltersListEmpty": "No filters here yet.", + "FiltersQuickShadowBan": "Shadow Ban", + "FiltersQuickUnshadowBan": "Unshadow Ban", + + "FiltersMenuSelectChat": "Select Chat", + "FiltersMenuImport": "Import", + "FiltersMenuExport": "Export", + "FiltersMenuClear": "Clear", + + "FiltersImportTitle": "Select a way to import filters", + "FiltersImportClipboard": "Paste from Clipboard", + "FiltersImportURL": "Import from URL", + "FiltersImportAction": "Import", + + "FiltersExportTitle": "Select a way to export filters", + "FiltersExportClipboard": "Copy to Clipboard", + "FiltersExportURL": "Publish on dpaste.com", + + "FiltersToastFailPublish": "Failed to publish filters.", + "FiltersToastFailFetch": "Failed to fetch filters.", + "FiltersToastFailImport": "Failed to import filters.", + "FiltersToastFailNoChanges": "Filters are the same as current.", + "FiltersToastSuccess": "Filters successfully imported.", + + "FiltersSheetTitle": "Apply filter changes?", + + "FiltersSheetNewFilters_zero": "**%1$d** new filters", + "FiltersSheetNewFilters_one": "**%1$d** new filter", + "FiltersSheetNewFilters_two": "**%1$d** new filters", + "FiltersSheetNewFilters_few": "**%1$d** new filters", + "FiltersSheetNewFilters_many": "**%1$d** new filters", + "FiltersSheetNewFilters_other": "**%1$d** new filters", + + "FiltersSheetRemovedFilters_zero": "**%1$d** removed filters", + "FiltersSheetRemovedFilters_one": "**%1$d** removed filter", + "FiltersSheetRemovedFilters_two": "**%1$d** removed filters", + "FiltersSheetRemovedFilters_few": "**%1$d** removed filters", + "FiltersSheetRemovedFilters_many": "**%1$d** removed filters", + "FiltersSheetRemovedFilters_other": "**%1$d** removed filters", + + "FiltersSheetUpdatedFilters_zero": "**%1$d** updated filters", + "FiltersSheetUpdatedFilters_one": "**%1$d** updated filter", + "FiltersSheetUpdatedFilters_two": "**%1$d** updated filters", + "FiltersSheetUpdatedFilters_few": "**%1$d** updated filters", + "FiltersSheetUpdatedFilters_many": "**%1$d** updated filters", + "FiltersSheetUpdatedFilters_other": "**%1$d** updated filters", + + "FiltersSheetNewExclusions_zero": "**%1$d** new exclusions", + "FiltersSheetNewExclusions_one": "**%1$d** new exclusion", + "FiltersSheetNewExclusions_two": "**%1$d** new exclusions", + "FiltersSheetNewExclusions_few": "**%1$d** new exclusions", + "FiltersSheetNewExclusions_many": "**%1$d** new exclusions", + "FiltersSheetNewExclusions_other": "**%1$d** new exclusions", + + "FiltersSheetRemovedExclusions_zero": "**%1$d** removed exclusions", + "FiltersSheetRemovedExclusions_one": "**%1$d** removed exclusion", + "FiltersSheetRemovedExclusions_two": "**%1$d** removed exclusions", + "FiltersSheetRemovedExclusions_few": "**%1$d** removed exclusions", + "FiltersSheetRemovedExclusions_many": "**%1$d** removed exclusions", + "FiltersSheetRemovedExclusions_other": "**%1$d** removed exclusions", + + "FiltersSheetDialogsToResolve_zero": "**%1$d** dialogs to resolve", + "FiltersSheetDialogsToResolve_one": "**%1$d** dialog to resolve", + "FiltersSheetDialogsToResolve_two": "**%1$d** dialogs to resolve", + "FiltersSheetDialogsToResolve_few": "**%1$d** dialogs to resolve", + "FiltersSheetDialogsToResolve_many": "**%1$d** dialogs to resolve", + "FiltersSheetDialogsToResolve_other": "**%1$d** dialogs to resolve", + + "FiltersClearPopupTitle": "Clear filters", + "FiltersClearPopupText": "Are you sure you want to clear all filters?", + "FiltersClearPopupActionText": "Clear", + "FiltersClearPopupAltActionText": "Clear unknown", + + "IconDefault": "Default", + "IconAlternative": "AyuGram Alt", + "IconDiscord": "Discord", + "IconSpotify": "Spotify", + "IconExtera": "extera", + "IconNothing": "Nothing", + "IconBard": "Google Bard", + "IconYaPlus": "Yandex Plus", + "IconAyuTyan": "AyuTyan", + "WALMode": "Enable WAL mode", - "CleanDatabaseNotification": "AyuGram database cleaned", + "PushNotificationCount": "FCM notifications received", + + "AyuAttachments": "AyuGram Attachments Folder", + "AyuDatabase": "AyuGram Messages Database", + "TelegramCacheDatabase": "Telegram Messages Database", + + "ConfirmationsTitle": "Confirmations", + "StickerConfirmation": "For Stickers", + "GIFConfirmation": "For GIFs", + "VoiceConfirmation": "For Voice Messages", + + "MessageDetailsPC": "Details", + "MessageDetailsViewsPC": "Views", + "MessageDetailsSharesPC": "Shares", + "MessageDetailsDatePC": "Date", + "MessageDetailsEditedDatePC": "Edit Date", + "MessageDetailsForwardedDatePC": "Forward Date", + "MessageDetailsFileSizePC": "File Size", + "MessageDetailsFileNamePC": "File Name", + "MessageDetailsFilePathPC": "File Path", + "MessageDetailsResolutionPC": "Resolution", + "MessageDetailsBitratePC": "Bitrate", + "MessageDetailsMimeTypePC": "Mime Type", + "MessageDetailsDatacenterPC": "Datacenter", + "MessageDetailsPackOwnerPC": "Pack Owner", + "MessageDetailsPackOwnerFetchingPC": "fetching...", + "MessageDetailsPackOwnerNotFoundPC": "not found", + + "KillApp": "Kill App", + + "LReadMessages": "Read on Local", + "SReadMessages": "Read on Server", + + "GhostModeToggle": "Ghost Mode", "EnableGhostMode": "Enable Ghost", "DisableGhostMode": "Disable Ghost", - "KillApp": "Kill App", - "GhostModeEnabled": "Ghost mode turned on", - "GhostModeDisabled": "Ghost mode turned off", - "EditsHistoryTitle": "Edits history", + "EnableGhostModeTray": "Enable Ghost Mode", + "DisableGhostModeTray": "Disable Ghost Mode", + "GhostModeEnabled": "Ghost Mode turned on", + "GhostModeDisabled": "Ghost Mode turned off", + + "GhostModeGlobalSettings": "Global Settings", + "GhostModeGlobalSettingsDescription": "Same for all accounts", + "GhostModeSwitchedToGlobalSettings": "Switched to same settings for all accounts.", + "GhostModeSwitchedToIndividualSettings": "Switched to individual settings for each account.", + + "StreamerModeToggle": "Streamer Mode", + "EnableStreamerModeTray": "Enable Streamer Mode", + "DisableStreamerModeTray": "Disable Streamer Mode", + + "EditsHistoryTitle": "Edits History", "EditsHistoryMenuText": "History", - "ReadUntilMenuText": "Read until", - "ForwardsRestrictedInfoDeleted": "Forwarding of a deleted message is not supported.", + + "PeekOnlineMenuText": "Peek Online", + "ClearDeletedMenuText": "Clear Deleted", + "ViewDeletedMenuText": "View Deleted", + "ViewFiltersMenuText": "View Filters", + "ReadExclusionMenuText": "Read Exclusion", + "TypingExclusionMenuText": "Typing Exclusion", + + "ExclusionTitle": "Select exclusion type", + "ExclusionUseDefault": "Default", + "ExclusionDontRead": "Never Read", + "ExclusionAlwaysRead": "Always Read", + "ExclusionDontType": "Never Type", + "ExclusionAlwaysType": "Always Type", + + "PeekOnlineSuccess": "Peeked via", + + "OneViewTTL": "one view", + "OnePlayTTL": "one play", + + "UserMessagesMenuText": "User Messages", + "ReadUntilMenuText": "Read Message", + + "DeleteKeepLocally": "Keep locally", + + "BoxActionReset": "Reset", + + "ReadConfirmationBoxQuestion": "Do you want to read all messages?", + "ReadConfirmationBoxActionText": "Read", + + "ClearDeletedMessagesTitle": "Clear deleted messages", + "ClearDeletedMessagesText": "Are you sure you want to clear all deleted messages in this chat?", + "ClearDeletedMessagesActionText": "Clear", + + "DeleteOwnMessages": "Delete own messages", + "DeleteOwnMessagesConfirmation": "Are you sure you want to delete all your messages from this group?", + + "SuggestGhostModeTitle": "Ghost Mode", + "SuggestGhostModeStoryText": "Do you want to enable **Ghost Mode** before viewing the story?", + "SuggestGhostModeStoryActionTextYes": "Yes", + "SuggestGhostModeStoryActionTextNo": "No", + + "FirstLaunchAlert": "AyuGram is **free** software and should only be obtained from our **official sources**. You assume **full responsibility** for using this application with your account.", + "LocalPremiumAlert": "With local Telegram Premium, you won't get increased limits or be able to send animated emojis. Other users won't see your premium emoji and quote color.", + "ExteraChatsAlert": "Don't ask questions related to **AyuGram** in **exteraGram** chats. If you need help, ask in the official **AyuGram** chat.", + + "HideNextViewsDescriptionAyu": "Hide my views forever, until Ghost Mode is disabled.", + "EnableGhostModeStories": "Enable Ghost Mode", + "GhostModeIsActive": "Ghost Mode is Active", + + "SimpleQuotesAndReplies": "Disable Colorful Replies", + + "DisableSimilarChannels": "Disable Similar Channels", + "CollapseSimilarChannels": "Collapse Similar Channels", + "HideSimilarChannelsTab": "Hide Similar Channels Tab", + + "UploadSpeedBoostPC": "Upload Speed Boost", + + "MainFont": "Application Font", + "MonospaceFont": "Monospace Font", + "FontDefault": "Default", + "CustomizeFontTitle": "Customize Font", + + "MessageShotTopBarText": "Shot", + "MessageShotPreview": "Preview", + "MessageShotPreferences": "Preferences", + "MessageShotCopy": "Copy", + "MessageShotSave": "Save", + "MessageShotTheme": "Theme", + "MessageShotThemeDefault": "Default", + "MessageShotThemeSelectTitle": "Select message theme", + "MessageShotThemeApply": "Apply", + "MessageShotShowBackground": "Show background", + "MessageShotShowDate": "Show date", + "MessageShotShowReactions": "Show reactions", + "MessageShotShowColorfulReplies": "Show colorful replies", + + "SendAsSticker": "Send as Sticker", + + "SendWithSound": "Send With Sound", + + "AyuForwardStatusPreparing": "Forwarding messages", + "AyuForwardStatusLoadingMedia": "Loading media", + "AyuForwardStatusForwarding": "Forwarding messages", + "AyuForwardStatusFinished": "Done", + "AyuForwardStatusSentCount": "sent %1$d of %2$d", + "AyuForwardStatusChunkCount": "chunk %1$d of %2$d", + + "JumpToBeginning": "To Beginning", + + "ExpireMediaContextMenuText": "Burn", + "ExpiringVoiceMessageNote": "This voice message can be played as many times as you want.", + "ExpiringVideoMessageNote": "This video message can be played as many times as you want.", + + "UserNotFoundMessage": "User not found.", + "DeleteDateMenuText": "Delete Date", + "ReadDateMenuText": "Read Date", + "ContentsReadDateMenuText": "Contents Read Date", + + "UnforwardableContextMenuText": "Plain forwarding is not allowed.", + "LikelyOfflineStatus": "offline ?", + "GhostModeShortcut": "Enter with Ghost", - "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", + + "SettingsShowMessageSeconds": "Show Message Seconds", + + "ShowOnlyAddedEmojisAndStickers": "Show Only Added Emojis & Stickers", + "ContextCopyID": "Copy ID", "IDCopiedToast": "ID copied to clipboard.", - "DrawerGhostModeToggle": "Ghost Mode" -} \ No newline at end of file + "ContextHideMessage": "Hide", + + "ContextCopyCallbackData": "Copy Callback Data", + + "RegisterURLScheme": "Register URL Scheme", + + "SessionTerminated": "Session **%1$s** was terminated. You may still browse cached messages.", + + "LocalPremiumNotice_PC": "You're using **local** Telegram Premium.\nIt **won't** give you any benefits.\n**Enjoy the star near your nickname!**", + "LocalPremiumNotice_Android": "You're using **local** Telegram Premium.\nYou may use it for a rate-limited translator and some **local** Telegram Premium stuff.", + + "DonateInfoV0_Android": "Buy us a coffee or keep our update server running. If you need a badge, look above — we don't give it at the moment.", + "DonateInfoV1_Android": "Buy us a coffee or keep our update server running.", + "DonateInfoV2_Android": "Buy us a coffee or keep our update server running. Write to **%1$s** after **donation**.", + + "DeveloperPopup": "**{item}** is a member of the **exteraGram** development team.", + "SupporterPopup": "**{item}** supported the development of **exteraGram** or **AyuGram** and received an exclusive badge.", + + "SettingsWatermark": "AyuGram is developed and maintained by Radolyn Labs.", + "SettingsDescription_Android": "Just an exteraGram based client with ToS-breaking features in mind.", + + "SecretMessageTecno_Android": "Tecno phones are the best.", + "SecretMessageXiaomiSuccess_Android": "You're using a good phone.", + "SecretMessageXiaomiWarning_Android": "Buy Pixel, don't mess with Xiaomi.", + "SecretMessageXiaomiFailure_Android": "Install custom ROM.", + "SecretMessageNekogram_Android": "Sorry, but it's not Nekogram.", + + "ConfirmationSticker": "Do you want to send this sticker?", + "ConfirmationGIF": "Do you want to send this GIF?", + "ConfirmationVoice": "Do you want to send this voice message?", + + "IntroAbout": "Welcome to the AyuGram Desktop.\nMake Telegram your own.", + + "AboutText1": "ToS breaking Telegram client based on {api_link}.", + + "UpdateAyuGram": "Update AyuGram", + + "UtilityRestartRequired": "The app will close in 5 seconds." +} diff --git a/values/langs/kk/Shared.json b/values/langs/kk/Shared.json new file mode 100644 index 00000000..90be3964 --- /dev/null +++ b/values/langs/kk/Shared.json @@ -0,0 +1,65 @@ +{ + "AyuPreferences": "AyuGram баптаулары", + "GhostEssentialsHeader": "Жасырындық күйі", + "SendReadPackets": "Оқылған деп белгілеу", + "SendOnlinePackets": "Желіде куйін жіберу", + "SendUploadProgress": "Теру/жүктеу күйін жіберу", + "SendOfflinePacketAfterOnline": "Желіге кіргенде «желіден тыс» деп белгілеу", + "MarkReadAfterSend": "Жауаптан соң оқыған деп белгілеу", + "UseScheduledMessages": "Кестелі хабарлар", + "SpyEssentialsHeader": "Анду күйі", + "KeepDeletedMessages": "Жойылған мазмүнды сақтау", + "KeepMessagesHistory": "Өңдеу тарихын сақтау", + "QoLTogglesHeader": "Пайдалы қызметтер", + "ShowFromChannel": "Арна екенін көрсету", + "KeepAliveService": "Артта әрекет ету", + "EnableAds": "Жарнаманы қосу", + "CustomizationHeader": "Теңшеу", + "DeletedMarkText": "Жойылды", + "EditedMarkText": "Өңделді", + "ShowGhostToggleInDrawer": "Бүйір мәзірде жасырын күйі", + "ShowKllButtonInDrawer": "Бүйір мәзірде жабу түймесі", + "AyuSyncHeader": "AyuSync", + "AyuSyncStatusTitle": "Үйлестіру мәртебесі", + "AyuSyncStatusOk": "Қосулы", + "AyuSyncStatusErrorDisconnected": "Қосылым жоқ", + "AyuSyncStatusErrorNotRegistered": "Тіркелмеген", + "AyuSyncStatusErrorNoToken": "Токен жоқ", + "AyuSyncStatusErrorInvalidToken": "Токен жарамсыз", + "AyuSyncStatusErrorNoMVP": "MVP табылмады", + "AyuSyncServerURL": "AyuSync тарабы (URL)", + "AyuSyncServerToken": "AyuSync токені", + "AyuSyncEnable": "Үйлестіруді қосу", + "AyuSyncVisitProfile": "Бейнімді ашу", + "AyuSyncForceSync": "Міндетті түрде үйлестіру", + "AyuSyncDeviceIdentifier": "Құрылғы бірегей сандары", + "AyuSyncLastEventSent": "Соңғы жіберілген оқиға", + "AyuSyncLastEventReceived": "Соңғы қабылданған оқиға", + "AyuSyncLastEventNever": "Ешқашан", + "AyuSyncUseSecureConnection": "HTTPS/WSS арқылы қауіпсіз қосылым", + "AyuSyncIdentifierCopied": "Бірегей сандар ара жадыға көшірілді", + "CleanDatabase": "Дерек қорды тазалау", + "WALMode": "WAL куйін қосу", + "CleanDatabaseNotification": "AyuGram хат қоры тазаланды", + "EnableGhostMode": "Жасырындық күйін қосу", + "DisableGhostMode": "Жасырындық куйін өшіру", + "KillApp": "Қолданбаны жабу", + "GhostModeEnabled": "Жасырын куйі қосылды", + "GhostModeDisabled": "Жасырын куйі өшірілді", + "EditsHistoryTitle": "Өңдеу тарихы", + "EditsHistoryMenuText": "Тарих", + "ReadUntilMenuText": "Оқылғанға дейін", + "ForwardsRestrictedInfoDeleted": "Жойылған мазмұнды қайта жіберу мүмкін емес", + "DeleteDateMenuText": "Жою күні", + "LikelyOfflineStatus": "Мүмкін желіден тыс", + "GhostModeShortcut": "Жасырындық куйімен кіру", + "SettingsWatermark": "AyuGram'ды Radolyn Labs әзірлеп, қолдайды", + "SettingsCustomizationHint": "Теңшеулерді өзгерткеннен кейін қосымшаны қайта іске қосыңыз", + "SettingsRecentStickersCount": "Жуырдағы стикерлер саны", + "SettingsShowID": "Талқы ID'ың көрсету", + "SettingsShowID_Hide": "Жасыру", + "SettingsShowMessageSeconds": "Хат уақытында секундтарды көрсету", + "ContextCopyID": "ID көшіру", + "IDCopiedToast": "ID ара жадыға көшірілді.", + "DrawerGhostModeToggle": "Жасырындық куйі" +} \ No newline at end of file