Support different languages of TelegramTips

This commit is contained in:
Eduard Kuzmenko 2022-04-05 17:00:15 +03:00
parent 01274e9943
commit d270d58e89
3 changed files with 12 additions and 4 deletions

View File

@ -24,7 +24,7 @@ import AppNewChannelTab from "./tabs/newChannel";
import AppContactsTab from "./tabs/contacts";
import AppArchivedTab from "./tabs/archivedTab";
import AppAddMembersTab from "./tabs/addMembers";
import { FormatterArguments, i18n, i18n_, LangPackKey } from "../../lib/langPack";
import I18n, { FormatterArguments, i18n, i18n_, LangPackKey } from "../../lib/langPack";
import AppPeopleNearbyTab from "./tabs/peopleNearby";
import { ButtonMenuItemOptions } from "../buttonMenu";
import CheckboxField from "../checkboxField";
@ -175,9 +175,8 @@ export class AppSidebarLeft extends SidebarSlider {
icon: 'help',
text: 'TelegramFeatures',
onClick: () => {
appImManager.openUsername({
userName: 'TelegramTips'
});
const url = I18n.format('TelegramFeaturesUrl', true);
appImManager.openUrl(url);
}
}, {
icon: 'bug',

View File

@ -689,6 +689,7 @@ const lang = {
"ReportChatIllegalDrugs": "Illegal Drugs",
"ReportChatPersonalDetails": "Personal Details",
"VoipPeerIncompatible": "**%1$s**'s app is using an incompatible protocol. They need to update their app before you can call them.",
"TelegramFeaturesUrl": "https://t.me/TelegramTips",
// * macos
"AccountSettings.Filters": "Chat Folders",

View File

@ -828,6 +828,14 @@ export class AppImManager {
}
}
public openUrl(url: string) {
const {url: wrappedUrl, onclick} = RichTextProcessor.wrapUrl(url);
const a = document.createElement('a');
a.href = wrappedUrl;
(window as any)[onclick](a);
}
private addAnchorListener<Params extends {pathnameParams?: any, uriParams?: any}>(options: {
name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' |
'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join',