Browse Source

Support different languages of TelegramTips

master
Eduard Kuzmenko 3 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";
import AppContactsTab from "./tabs/contacts"; import AppContactsTab from "./tabs/contacts";
import AppArchivedTab from "./tabs/archivedTab"; import AppArchivedTab from "./tabs/archivedTab";
import AppAddMembersTab from "./tabs/addMembers"; 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 AppPeopleNearbyTab from "./tabs/peopleNearby";
import { ButtonMenuItemOptions } from "../buttonMenu"; import { ButtonMenuItemOptions } from "../buttonMenu";
import CheckboxField from "../checkboxField"; import CheckboxField from "../checkboxField";
@ -175,9 +175,8 @@ export class AppSidebarLeft extends SidebarSlider {
icon: 'help', icon: 'help',
text: 'TelegramFeatures', text: 'TelegramFeatures',
onClick: () => { onClick: () => {
appImManager.openUsername({ const url = I18n.format('TelegramFeaturesUrl', true);
userName: 'TelegramTips' appImManager.openUrl(url);
});
} }
}, { }, {
icon: 'bug', icon: 'bug',

1
src/lang.ts

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

8
src/lib/appManagers/appImManager.ts

@ -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: { private addAnchorListener<Params extends {pathnameParams?: any, uriParams?: any}>(options: {
name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' | name: 'showMaskedAlert' | 'execBotCommand' | 'searchByHashtag' | 'addstickers' | 'im' |
'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join', 'resolve' | 'privatepost' | 'addstickers' | 'voicechat' | 'joinchat' | 'join',

Loading…
Cancel
Save