[Dev] Localization: Fix function definition (#2206)

Co-authored-by: undrfined <undrfined@gmail.com>
This commit is contained in:
Alexander Zinchuk 2022-12-15 19:19:23 +01:00
parent 695e811606
commit 6657e23889
7 changed files with 9 additions and 8 deletions

View File

@ -40,6 +40,7 @@ export { default as NewChatStep2 } from '../components/left/newChat/NewChatStep2
export { default as ArchivedChats } from '../components/left/ArchivedChats'; export { default as ArchivedChats } from '../components/left/ArchivedChats';
export { default as ChatFolderModal } from '../components/left/ChatFolderModal'; export { default as ChatFolderModal } from '../components/left/ChatFolderModal';
// eslint-disable-next-line import/no-cycle
export { default as ContextMenuContainer } from '../components/middle/message/ContextMenuContainer'; export { default as ContextMenuContainer } from '../components/middle/message/ContextMenuContainer';
export { default as SponsoredMessageContextMenuContainer } export { default as SponsoredMessageContextMenuContainer }
from '../components/middle/message/SponsoredMessageContextMenuContainer'; from '../components/middle/message/SponsoredMessageContextMenuContainer';

View File

@ -59,7 +59,7 @@ const FullNameTitle: FC<OwnProps> = ({
return ( return (
<div className={buildClassName('title', styles.root, className)}> <div className={buildClassName('title', styles.root, className)}>
<h3 dir="auto" className="fullName">{renderText(title)}</h3> <h3 dir="auto" className="fullName">{renderText(title || '')}</h3>
{!noVerified && peer.isVerified && <VerifiedIcon />} {!noVerified && peer.isVerified && <VerifiedIcon />}
{!noFake && peer.fakeType && <FakeIcon fakeType={peer.fakeType} />} {!noFake && peer.fakeType && <FakeIcon fakeType={peer.fakeType} />}
{withEmojiStatus && emojiStatus && ( {withEmojiStatus && emojiStatus && (

View File

@ -27,7 +27,7 @@ const TypingStatus: FC<OwnProps & StateProps> = ({ typingStatus, typingUser }) =
const content = lang(typingStatus.action) const content = lang(typingStatus.action)
// Fix for translation "{user} is typing" // Fix for translation "{user} is typing"
.replace('{user}', '') .replace('{user}', '')
.replace('{emoji}', typingStatus.emoji).trim(); .replace('{emoji}', typingStatus.emoji || '').trim();
return ( return (
<p className="typing-status" dir={lang.isRtl ? 'rtl' : 'auto'}> <p className="typing-status" dir={lang.isRtl ? 'rtl' : 'auto'}>

View File

@ -28,7 +28,7 @@ const AttachBotInstallModal: FC<OwnProps> = ({
onClose={cancelAttachBotInstall} onClose={cancelAttachBotInstall}
confirmHandler={confirmAttachBotInstall} confirmHandler={confirmAttachBotInstall}
title={name} title={name}
textParts={lang('WebApp.AddToAttachmentText', name)} text={lang('WebApp.AddToAttachmentText', name)}
/> />
); );
}; };

View File

@ -172,7 +172,7 @@ const PremiumLimitReachedModal: FC<OwnProps & StateProps> = ({
)} )}
<div> <div>
{renderText(description, ['simple_markdown', 'br'])} {renderText(description || '', ['simple_markdown', 'br'])}
</div> </div>
<div className={styles.dialogButtons}> <div className={styles.dialogButtons}>

View File

@ -98,11 +98,11 @@ export function formatCountdown(
} }
} }
export function formatCountdownShort(lang: LangFn, msLeft: number) { export function formatCountdownShort(lang: LangFn, msLeft: number): string {
if (msLeft < 60 * 1000) { if (msLeft < 60 * 1000) {
return Math.ceil(msLeft / 1000); return Math.ceil(msLeft / 1000).toString();
} else if (msLeft < 60 * 60 * 1000) { } else if (msLeft < 60 * 60 * 1000) {
return Math.ceil(msLeft / (60 * 1000)); return Math.ceil(msLeft / (60 * 1000)).toString();
} else if (msLeft < MILLISECONDS_IN_DAY) { } else if (msLeft < MILLISECONDS_IN_DAY) {
return lang('MessageTimer.ShortHours', Math.ceil(msLeft / (60 * 60 * 1000))); return lang('MessageTimer.ShortHours', Math.ceil(msLeft / (60 * 60 * 1000)));
} else { } else {

View File

@ -12,7 +12,7 @@ import { createCallbackManager } from './callbacks';
import { formatInteger } from './textFormat'; import { formatInteger } from './textFormat';
interface LangFn { interface LangFn {
(key: string, value?: any, format?: 'i', pluralValue?: number): any; (key: string, value?: any, format?: 'i', pluralValue?: number): string;
isRtl?: boolean; isRtl?: boolean;
code?: LangCode; code?: LangCode;