From f125d432cb8596f9cfb510320877f6ca4b5210fd Mon Sep 17 00:00:00 2001 From: morethanwords Date: Thu, 25 Mar 2021 13:51:57 +0400 Subject: [PATCH] temp --- src/components/chat/bubbles.ts | 2 +- src/config/app.ts | 1 + src/lang.ts | 4 ++-- src/lib/langPack.ts | 15 ++++++++++----- src/scripts/out/langPack.strings | 21 ++++++++++++--------- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index 6cdac6c3..13e3ec6e 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -50,7 +50,7 @@ import serverTimeManager from "../../lib/mtproto/serverTimeManager"; import PeerTitle from "../peerTitle"; const USE_MEDIA_TAILS = false; -const IGNORE_ACTIONS = ['messageActionHistoryClear']; +const IGNORE_ACTIONS: Message.messageService['action']['_'][] = [/* 'messageActionHistoryClear' */]; const TEST_SCROLL_TIMES: number = undefined; let TEST_SCROLL = TEST_SCROLL_TIMES; diff --git a/src/config/app.ts b/src/config/app.ts index adddbea8..7bc5f770 100644 --- a/src/config/app.ts +++ b/src/config/app.ts @@ -2,6 +2,7 @@ const App = { id: 1025907, hash: '452b0359b988148995f22ff0f4229750', version: '0.4.0', + langPackVersion: '0.0.1', domains: [] as string[], baseDcId: 2 }; diff --git a/src/lang.ts b/src/lang.ts index 5bc99088..c59f0957 100644 --- a/src/lang.ts +++ b/src/lang.ts @@ -195,7 +195,7 @@ const lang = { "PrivacySettingsController.P2p.Desc": "Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality.", "PrivacySettingsController.PhoneCallDescription": "You can restrict who can call you with granular precision.", "PrivacySettingsController.ProfilePhoto.CustomHelp": "You can restrict who can see your profile photo with granular precision.", - "PrivacySettingsController.LastSeenDescription": "You won\"t see Last Seen and Online statuses for people with whom you don\"t share yours. Approximate last seen will be shown instead (recently, within a week, within a month).", + "PrivacySettingsController.LastSeenDescription": "You won't see Last Seen and Online statuses for people with whom you don't share yours. Approximate last seen will be shown instead (recently, within a week, within a month).", "PrivacySettingsController.PeerInfo": "You can add users or entire groups as exceptions that will override the settings above.", "PrivacySettingsController.Everbody": "Everybody", "PrivacySettingsController.MyContacts": "My Contacts", @@ -208,7 +208,7 @@ const lang = { "one_value": "%d user", "other_value": "%d users" }, - "RecentSessions.Error.FreshReset": "For security reasons, you can\"t terminate older sessions from a device that you\"ve just connected. Please use an earlier connection or wait for a few hours." + "RecentSessions.Error.FreshReset": "For security reasons, you can't terminate older sessions from a device that you've just connected. Please use an earlier connection or wait for a few hours." }; export default lang; diff --git a/src/lib/langPack.ts b/src/lib/langPack.ts index 2373a821..6afff72a 100644 --- a/src/lib/langPack.ts +++ b/src/lib/langPack.ts @@ -5,6 +5,7 @@ import type lang from "../lang"; import { LangPackDifference, LangPackString } from "../layer"; import apiManager from "./mtproto/mtprotoworker"; import sessionStorage from "./sessionStorage"; +import App from "../config/app"; export const langPack: {[actionType: string]: LangPackKey} = { "messageActionChatCreate": "ActionCreateGroup", @@ -48,8 +49,10 @@ namespace I18n { sessionStorage.get('langPack'), polyfillPromise ]).then(([langPack]) => { - if(!langPack || true) { + if(!langPack/* || true */) { return getLangPack('en'); + } else if(langPack.appVersion !== App.langPackVersion) { + return getLangPack(langPack.lang_code); } if(!lastRequestedLangCode) { @@ -101,6 +104,8 @@ namespace I18n { } langPack.strings = strings; + // @ts-ignore + langPack.appVersion = App.langPackVersion; return sessionStorage.set({langPack}).then(() => { applyLangPack(langPack); @@ -193,12 +198,12 @@ namespace I18n { } else if(str._ === 'langPackString') { input = str.value; } else { - input = '[' + key + ']'; - //input = key; + //input = '[' + key + ']'; + input = key; } } else { - input = '[' + key + ']'; - //input = key; + //input = '[' + key + ']'; + input = key; } if(plain) { diff --git a/src/scripts/out/langPack.strings b/src/scripts/out/langPack.strings index 6fc9f369..3650bf03 100644 --- a/src/scripts/out/langPack.strings +++ b/src/scripts/out/langPack.strings @@ -28,8 +28,8 @@ "General.SendShortcut.NewLine.Enter" = "New line by Enter"; "General.AutoplayMedia" = "Auto-Play Media"; "ChatBackground.UploadWallpaper" = "Upload Wallpaper"; -"ChatBackground.SetColor" = "Upload Wallpaper"; -"ChatBackground.Blur" = "Upload Wallpaper"; +"ChatBackground.SetColor" = "Set a Color"; +"ChatBackground.Blur" = "Blur Wallpaper Image"; "Notifications.Sound" = "Notification Sound"; "Notifications.MessagePreview" = "Message preview"; "Checkbox.Enabled" = "Enabled"; @@ -128,6 +128,13 @@ "ArchivedChats" = "Archived Chats"; "Cancel" = "Cancel"; "HistoryCleared" = "History was cleared"; +"AccountSettings.Filters" = "Chat Folders"; +"AccountSettings.Notifications" = "Notifications and Sounds"; +"AccountSettings.PrivacyAndSecurity" = "Privacy and Security"; +"AccountSettings.Language" = "Language"; +"Bio.Description" = "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco"; +"Chat.Date.ScheduledFor" = "Scheduled for %@"; +"Chat.Date.ScheduledForToday" = "Scheduled for today"; "Chat.Service.PeerJoinedTelegram" = "%@ joined Telegram"; "Chat.Service.Channel.UpdatedTitle" = "Channel renamed to \"%@\""; "Chat.Service.Channel.UpdatedPhoto" = "Channel photo updated"; @@ -151,15 +158,11 @@ "ChatList.Filter.MutedChats" = "Muted"; "ChatList.Filter.ReadChats" = "Read"; "ChatList.Filter.Archive" = "Archived"; -"Bio.Description" = "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco"; +"Date.Today" = "Today"; "EditAccount.Username" = "Username"; "EditAccount.Title" = "Edit Profile"; "EditAccount.Logout" = "Log Out"; "Login.Register.LastName.Placeholder" = "Last Name"; -"AccountSettings.Filters" = "Chat Folders"; -"AccountSettings.Notifications" = "Notifications and Sounds"; -"AccountSettings.PrivacyAndSecurity" = "Privacy and Security"; -"AccountSettings.Language" = "Language"; "Telegram.GeneralSettingsViewController" = "General Settings"; "Telegram.InstalledStickerPacksController" = "Stickers"; "Telegram.NotificationSettingsViewController" = "Notifications"; @@ -176,7 +179,7 @@ "PrivacySettingsController.P2p.Desc" = "Disabling peer-to-peer will relay all calls through Telegram servers to avoid revealing your IP address, but may slightly decrease audio and video quality."; "PrivacySettingsController.PhoneCallDescription" = "You can restrict who can call you with granular precision."; "PrivacySettingsController.ProfilePhoto.CustomHelp" = "You can restrict who can see your profile photo with granular precision."; -"PrivacySettingsController.LastSeenDescription" = "You won\"t see Last Seen and Online statuses for people with whom you don\"t share yours. Approximate last seen will be shown instead (recently, within a week, within a month)."; +"PrivacySettingsController.LastSeenDescription" = "You won't see Last Seen and Online statuses for people with whom you don't share yours. Approximate last seen will be shown instead (recently, within a week, within a month)."; "PrivacySettingsController.PeerInfo" = "You can add users or entire groups as exceptions that will override the settings above."; "PrivacySettingsController.Everbody" = "Everybody"; "PrivacySettingsController.MyContacts" = "My Contacts"; @@ -187,4 +190,4 @@ "PrivacySettingsController.AlwaysAllow" = "Always Allow"; "PrivacySettingsController.UserCount_one" = "%d user"; "PrivacySettingsController.UserCount_other" = "%d users"; -"RecentSessions.Error.FreshReset" = "For security reasons, you can\"t terminate older sessions from a device that you\"ve just connected. Please use an earlier connection or wait for a few hours."; +"RecentSessions.Error.FreshReset" = "For security reasons, you can't terminate older sessions from a device that you've just connected. Please use an earlier connection or wait for a few hours.";