[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 ChatFolderModal } from '../components/left/ChatFolderModal';
// eslint-disable-next-line import/no-cycle
export { default as ContextMenuContainer } from '../components/middle/message/ContextMenuContainer';
export { default as SponsoredMessageContextMenuContainer }
from '../components/middle/message/SponsoredMessageContextMenuContainer';

View File

@ -59,7 +59,7 @@ const FullNameTitle: FC<OwnProps> = ({
return (
<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 />}
{!noFake && peer.fakeType && <FakeIcon fakeType={peer.fakeType} />}
{withEmojiStatus && emojiStatus && (

View File

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

View File

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

View File

@ -172,7 +172,7 @@ const PremiumLimitReachedModal: FC<OwnProps & StateProps> = ({
)}
<div>
{renderText(description, ['simple_markdown', 'br'])}
{renderText(description || '', ['simple_markdown', 'br'])}
</div>
<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) {
return Math.ceil(msLeft / 1000);
return Math.ceil(msLeft / 1000).toString();
} 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) {
return lang('MessageTimer.ShortHours', Math.ceil(msLeft / (60 * 60 * 1000)));
} else {

View File

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