Browse Source

Support different languages of TelegramTips

master
Eduard Kuzmenko 2 years ago
parent
commit
d270d58e89
  1. 7
      src/components/sidebarLeft/index.ts
  2. 1
      src/lang.ts
  3. 8
      src/lib/appManagers/appImManager.ts

7
src/components/sidebarLeft/index.ts

@ -24,7 +24,7 @@ import AppNewChannelTab from "./tabs/newChannel"; @@ -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 { @@ -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',

1
src/lang.ts

@ -689,6 +689,7 @@ const lang = { @@ -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",

8
src/lib/appManagers/appImManager.ts

@ -828,6 +828,14 @@ export class AppImManager { @@ -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',

Loading…
Cancel
Save