+
{selectedCategories?.map((category) => (
({
ref={inputRef}
value={filterValue}
onChange={handleFilterChange}
- placeholder={filterPlaceholder || lang('SelectChat')}
+ placeholder={filterPlaceholder || oldLang('SelectChat')}
/>
)}
diff --git a/src/components/common/profile/UserBirthday.tsx b/src/components/common/profile/UserBirthday.tsx
index a33f06899..7be5298be 100644
--- a/src/components/common/profile/UserBirthday.tsx
+++ b/src/components/common/profile/UserBirthday.tsx
@@ -140,7 +140,7 @@ const UserBirthday = ({
const value = useMemo(() => {
if (age) {
return lang(
- `ProfileBirthday${isToday ? 'Today' : ''}ValueYear`,
+ `ProfileBirthday${isToday ? 'Today' : ''}ValueAge`,
{ date: formattedDate, age },
{ pluralValue: age },
);
diff --git a/src/components/middle/composer/AttachmentModal.tsx b/src/components/middle/composer/AttachmentModal.tsx
index 12752ce25..8788d28e8 100644
--- a/src/components/middle/composer/AttachmentModal.tsx
+++ b/src/components/middle/composer/AttachmentModal.tsx
@@ -1,6 +1,4 @@
-import type React from '../../../lib/teact/teact';
-import type { FC } from '../../../lib/teact/teact';
-import { memo, useEffect, useMemo, useRef, useState } from '../../../lib/teact/teact';
+import { type FC, memo, useEffect, useMemo, useRef, useState } from '../../../lib/teact/teact';
import { getActions, withGlobal } from '../../../global';
import type { ApiAttachment, ApiChatMember, ApiMessage, ApiSticker } from '../../../api/types';
@@ -37,7 +35,6 @@ import useFlag from '../../../hooks/useFlag';
import useGetSelectionRange from '../../../hooks/useGetSelectionRange';
import useLang from '../../../hooks/useLang';
import useLastCallback from '../../../hooks/useLastCallback';
-import useOldLang from '../../../hooks/useOldLang';
import usePreviousDeprecated from '../../../hooks/usePreviousDeprecated';
import useResizeObserver from '../../../hooks/useResizeObserver';
import useScrolledState from '../../../hooks/useScrolledState';
@@ -74,6 +71,9 @@ export type OwnProps = {
shouldForceAsFile?: boolean;
isForCurrentMessageList?: boolean;
forceDarkTheme?: boolean;
+ canScheduleUntilOnline?: boolean;
+ canSchedule?: boolean;
+ paidMessagesStars?: number;
onCaptionUpdate: (html: string) => void;
onSend: (sendCompressed: boolean, sendGrouped: boolean, isInvertedMedia?: true) => void;
onFileAppend: (files: File[], isSpoiler?: boolean) => void;
@@ -84,10 +84,7 @@ export type OwnProps = {
onCustomEmojiSelect: (emoji: ApiSticker) => void;
onRemoveSymbol: VoidFunction;
onEmojiSelect: (emoji: string) => void;
- canScheduleUntilOnline?: boolean;
- canSchedule?: boolean;
onSendWhenOnline?: NoneToVoidFunction;
- paidMessagesStars?: number;
};
type StateProps = {
@@ -109,7 +106,7 @@ const DROP_LEAVE_TIMEOUT_MS = 150;
const MAX_LEFT_CHARS_TO_SHOW = 100;
const CLOSE_MENU_ANIMATION_DURATION = 200;
-const AttachmentModal: FC
= ({
+const AttachmentModal = ({
chatId,
threadId,
attachments,
@@ -134,6 +131,9 @@ const AttachmentModal: FC = ({
shouldForceAsFile,
isForCurrentMessageList,
forceDarkTheme,
+ canScheduleUntilOnline,
+ canSchedule,
+ paidMessagesStars,
onAttachmentsUpdate,
onCaptionUpdate,
onSend,
@@ -144,16 +144,12 @@ const AttachmentModal: FC = ({
onCustomEmojiSelect,
onRemoveSymbol,
onEmojiSelect,
- canScheduleUntilOnline,
- canSchedule,
onSendWhenOnline,
- paidMessagesStars,
-}) => {
+}: OwnProps & StateProps) => {
const ref = useRef();
const svgRef = useRef();
const { addRecentCustomEmoji, addRecentEmoji, updateAttachmentSettings } = getActions();
- const oldLang = useOldLang();
const lang = useLang();
const mainButtonRef = useRef();
@@ -444,7 +440,7 @@ const AttachmentModal: FC = ({
requestMutation(() => {
input.style.setProperty('--margin-for-scrollbar', `${width}px`);
});
- }, [oldLang, isOpen]);
+ }, [lang, isOpen]);
const MoreMenuButton: FC<{ onTrigger: () => void; isOpen?: boolean }> = useMemo(() => {
return ({ onTrigger, isOpen: isMenuOpen }) => (
@@ -515,13 +511,29 @@ const AttachmentModal: FC = ({
let title = '';
const attachmentsLength = renderingAttachments.length;
if (areAllPhotos) {
- title = oldLang(isEditing ? 'EditMessageReplacePhoto' : 'PreviewSender.SendPhoto', attachmentsLength, 'i');
+ title = lang(
+ `Attachment${isEditing ? 'Replace' : 'Send'}Photo`,
+ { count: attachmentsLength },
+ { pluralValue: attachmentsLength },
+ );
} else if (areAllVideos) {
- title = oldLang(isEditing ? 'EditMessageReplaceVideo' : 'PreviewSender.SendVideo', attachmentsLength, 'i');
+ title = lang(
+ `Attachment${isEditing ? 'Replace' : 'Send'}Video`,
+ { count: attachmentsLength },
+ { pluralValue: attachmentsLength },
+ );
} else if (areAllAudios) {
- title = oldLang(isEditing ? 'EditMessageReplaceAudio' : 'PreviewSender.SendAudio', attachmentsLength, 'i');
+ title = lang(
+ `Attachment${isEditing ? 'Replace' : 'Send'}Audio`,
+ { count: attachmentsLength },
+ { pluralValue: attachmentsLength },
+ );
} else {
- title = oldLang(isEditing ? 'EditMessageReplaceFile' : 'PreviewSender.SendFile', attachmentsLength, 'i');
+ title = lang(
+ `Attachment${isEditing ? 'Replace' : 'Send'}File`,
+ { count: attachmentsLength },
+ { pluralValue: attachmentsLength },
+ );
}
function renderHeader() {
@@ -548,7 +560,7 @@ const AttachmentModal: FC = ({
positionX="right"
>
{Boolean(!editingMessage) && (
-
+
)}
{hasMedia && (
<>
@@ -569,12 +581,12 @@ const AttachmentModal: FC = ({
!shouldForceAsFile && !shouldForceCompression && (isSendingCompressed ? (
) : (
))
}
@@ -589,11 +601,11 @@ const AttachmentModal: FC = ({
{isSendingCompressed && hasAnySpoilerable && Boolean(!editingMessage) && (
hasSpoiler ? (
) : (
)
)}
@@ -606,12 +618,12 @@ const AttachmentModal: FC = ({
onClick={() => setShouldSendGrouped(false)}
>
- Ungroup All Media
+ {lang('AttachmentMenuUngroupAllMedia')}
) : (
)
)}
@@ -629,7 +641,7 @@ const AttachmentModal: FC = ({
className: styles.sendButtonStar,
asFont: true,
},
- ) : oldLang('Send');
+ ) : lang('Send');
return (
= ({
onDragOver={handleDragOver}
onDragLeave={handleDragLeave}
onClick={unmarkHovered}
- data-attach-description={oldLang('Preview.Dragging.AddItems', 10)}
+ data-attach-description={lang('AttachmentDragAddItems')}
data-dropzone
>