Bots: Use localized name for attached bots (#4330)

This commit is contained in:
Alexander Zinchuk 2024-03-01 14:02:50 -05:00
parent 3c7b07d07f
commit 45d019b5f8
5 changed files with 6 additions and 3 deletions

View File

@ -70,7 +70,7 @@ export async function init(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs)
const {
userAgent, platform, sessionData, isTest, isWebmSupported, maxBufferSize, webAuthToken, dcId,
mockScenario, shouldForceHttpTransport, shouldAllowHttpTransport,
shouldDebugExportedSenders,
shouldDebugExportedSenders, langCode,
} = initialArgs;
const session = new sessions.CallbackSession(sessionData, onSessionUpdate);
@ -94,6 +94,7 @@ export async function init(_onUpdate: OnApiUpdate, initialArgs: ApiInitialArgs)
shouldAllowHttpTransport,
testServers: isTest,
dcId,
langCode,
} as any,
);

View File

@ -15,6 +15,7 @@ export interface ApiInitialArgs {
shouldAllowHttpTransport?: boolean;
shouldForceHttpTransport?: boolean;
shouldDebugExportedSenders?: boolean;
langCode: string;
}
export interface ApiOnProgress {

View File

@ -532,7 +532,7 @@ const WebAppModal: FC<OwnProps & StateProps> = ({
>
<div className={backButtonClassName} />
</Button>
<div className="modal-title">{bot?.firstName}</div>
<div className="modal-title">{attachBot?.shortName ?? bot?.firstName}</div>
<DropdownMenu
className="web-app-more-menu with-menu-transitions"
trigger={MoreMenuButton}

View File

@ -60,6 +60,7 @@ addActionHandler('initApi', async (global, actions): Promise<void> => {
shouldAllowHttpTransport: global.settings.byKey.shouldAllowHttpTransport,
shouldForceHttpTransport: global.settings.byKey.shouldForceHttpTransport,
shouldDebugExportedSenders: global.settings.byKey.shouldDebugExportedSenders,
langCode: global.settings.byKey.language,
});
void setShouldEnableDebugLog(Boolean(global.settings.byKey.shouldCollectDebugLogs));

View File

@ -157,7 +157,7 @@ class TelegramClient {
.toString() || '1.0',
appVersion: args.appVersion || '1.0',
langCode: args.langCode,
langPack: '', // this should be left empty.
langPack: 'weba',
systemLangCode: args.systemLangCode,
query: x,
proxy: undefined, // no proxies yet.