Left Menu: Use own translations (#6202)
This commit is contained in:
parent
ca8260c309
commit
ef4c20c96a
@ -1410,6 +1410,17 @@
|
|||||||
"MenuBetaChangelog" = "Beta Changelog";
|
"MenuBetaChangelog" = "Beta Changelog";
|
||||||
"MenuSwitchToK" = "Switch to K Version";
|
"MenuSwitchToK" = "Switch to K Version";
|
||||||
"MenuInstallApp" = "Install App";
|
"MenuInstallApp" = "Install App";
|
||||||
|
"MenuMyProfile" = "My Profile";
|
||||||
|
"MenuSavedMessages" = "Saved Messages";
|
||||||
|
"MenuArchivedChats" = "Archived Chats";
|
||||||
|
"MenuContacts" = "Contacts";
|
||||||
|
"MenuSettings" = "Settings";
|
||||||
|
"MenuNightMode" = "Night Mode";
|
||||||
|
"AriaMenuEnableNightMode" = "Enable night mode";
|
||||||
|
"AriaMenuDisableNightMode" = "Disable night mode";
|
||||||
|
"MenuAnimationsSwitch" = "Animations";
|
||||||
|
"MenuTelegramFeatures" = "Telegram Features";
|
||||||
|
"TelegramFeaturesUsername" = "TelegramTips";
|
||||||
"RemoveEffect" = "Remove effect";
|
"RemoveEffect" = "Remove effect";
|
||||||
"ReplyInPrivateMessage" = "Reply In Private Message";
|
"ReplyInPrivateMessage" = "Reply In Private Message";
|
||||||
"ProfileOpenAppAbout" = "By launching this mini app, you agree to the {terms}.";
|
"ProfileOpenAppAbout" = "By launching this mini app, you agree to the {terms}.";
|
||||||
|
|||||||
@ -33,7 +33,6 @@ import { switchPermanentWebVersion } from '../../../util/permanentWebVersion';
|
|||||||
import { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager';
|
import { useFolderManagerForUnreadCounters } from '../../../hooks/useFolderManager';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import useLastCallback from '../../../hooks/useLastCallback';
|
import useLastCallback from '../../../hooks/useLastCallback';
|
||||||
import useOldLang from '../../../hooks/useOldLang';
|
|
||||||
|
|
||||||
import AttachBotItem from '../../middle/composer/AttachBotItem';
|
import AttachBotItem from '../../middle/composer/AttachBotItem';
|
||||||
import MenuItem from '../../ui/MenuItem';
|
import MenuItem from '../../ui/MenuItem';
|
||||||
@ -82,7 +81,6 @@ const LeftSideMenuItems = ({
|
|||||||
openUrl,
|
openUrl,
|
||||||
openChatWithInfo,
|
openChatWithInfo,
|
||||||
} = getActions();
|
} = getActions();
|
||||||
const oldLang = useOldLang();
|
|
||||||
const lang = useLang();
|
const lang = useLang();
|
||||||
|
|
||||||
const animationLevelValue = animationLevel !== ANIMATION_LEVEL_MIN
|
const animationLevelValue = animationLevel !== ANIMATION_LEVEL_MIN
|
||||||
@ -134,7 +132,7 @@ const LeftSideMenuItems = ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleOpenTipsChat = useLastCallback(() => {
|
const handleOpenTipsChat = useLastCallback(() => {
|
||||||
openChatByUsername({ username: oldLang('Settings.TipsUsername') });
|
openChatByUsername({ username: lang('TelegramFeaturesUsername') });
|
||||||
});
|
});
|
||||||
|
|
||||||
const handleBugReportClick = useLastCallback(() => {
|
const handleBugReportClick = useLastCallback(() => {
|
||||||
@ -157,20 +155,20 @@ const LeftSideMenuItems = ({
|
|||||||
icon="user"
|
icon="user"
|
||||||
onClick={handleSelectMyProfile}
|
onClick={handleSelectMyProfile}
|
||||||
>
|
>
|
||||||
{oldLang('My Profile')}
|
{lang('MenuMyProfile')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="saved-messages"
|
icon="saved-messages"
|
||||||
onClick={handleSelectSaved}
|
onClick={handleSelectSaved}
|
||||||
>
|
>
|
||||||
{oldLang('SavedMessages')}
|
{lang('MenuSavedMessages')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
{archiveSettings.isHidden && (
|
{archiveSettings.isHidden && (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="archive"
|
icon="archive"
|
||||||
onClick={onSelectArchived}
|
onClick={onSelectArchived}
|
||||||
>
|
>
|
||||||
<span className="menu-item-name">{oldLang('ArchivedChats')}</span>
|
<span className="menu-item-name">{lang('MenuArchivedChats')}</span>
|
||||||
{archivedUnreadChatsCount > 0 && (
|
{archivedUnreadChatsCount > 0 && (
|
||||||
<div className="right-badge">{archivedUnreadChatsCount}</div>
|
<div className="right-badge">{archivedUnreadChatsCount}</div>
|
||||||
)}
|
)}
|
||||||
@ -180,7 +178,7 @@ const LeftSideMenuItems = ({
|
|||||||
icon="group"
|
icon="group"
|
||||||
onClick={onSelectContacts}
|
onClick={onSelectContacts}
|
||||||
>
|
>
|
||||||
{oldLang('Contacts')}
|
{lang('MenuContacts')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
{bots.map((bot) => (
|
{bots.map((bot) => (
|
||||||
<AttachBotItem
|
<AttachBotItem
|
||||||
@ -196,16 +194,16 @@ const LeftSideMenuItems = ({
|
|||||||
icon="settings"
|
icon="settings"
|
||||||
onClick={onSelectSettings}
|
onClick={onSelectSettings}
|
||||||
>
|
>
|
||||||
{oldLang('Settings')}
|
{lang('MenuSettings')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="darkmode"
|
icon="darkmode"
|
||||||
onClick={handleDarkModeToggle}
|
onClick={handleDarkModeToggle}
|
||||||
>
|
>
|
||||||
<span className="menu-item-name">{oldLang('lng_menu_night_mode')}</span>
|
<span className="menu-item-name">{lang('MenuNightMode')}</span>
|
||||||
<Switcher
|
<Switcher
|
||||||
id="darkmode"
|
id="darkmode"
|
||||||
label={oldLang(theme === 'dark' ? 'lng_settings_disable_night_theme' : 'lng_settings_enable_night_theme')}
|
label={lang(theme === 'dark' ? 'AriaMenuDisableNightMode' : 'AriaMenuEnableNightMode')}
|
||||||
checked={theme === 'dark'}
|
checked={theme === 'dark'}
|
||||||
noAnimation
|
noAnimation
|
||||||
/>
|
/>
|
||||||
@ -214,14 +212,14 @@ const LeftSideMenuItems = ({
|
|||||||
icon="animations"
|
icon="animations"
|
||||||
onClick={handleAnimationLevelChange}
|
onClick={handleAnimationLevelChange}
|
||||||
>
|
>
|
||||||
<span className="menu-item-name capitalize">{oldLang('Appearance.Animations').toLowerCase()}</span>
|
<span className="menu-item-name capitalize">{lang('MenuAnimationsSwitch')}</span>
|
||||||
<Toggle value={animationLevelValue} />
|
<Toggle value={animationLevelValue} />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="help"
|
icon="help"
|
||||||
onClick={handleOpenTipsChat}
|
onClick={handleOpenTipsChat}
|
||||||
>
|
>
|
||||||
{oldLang('TelegramFeatures')}
|
{lang('MenuTelegramFeatures')}
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
icon="bug"
|
icon="bug"
|
||||||
|
|||||||
10
src/types/language.d.ts
vendored
10
src/types/language.d.ts
vendored
@ -1202,6 +1202,16 @@ export interface LangPair {
|
|||||||
'MenuBetaChangelog': undefined;
|
'MenuBetaChangelog': undefined;
|
||||||
'MenuSwitchToK': undefined;
|
'MenuSwitchToK': undefined;
|
||||||
'MenuInstallApp': undefined;
|
'MenuInstallApp': undefined;
|
||||||
|
'MenuMyProfile': undefined;
|
||||||
|
'MenuSavedMessages': undefined;
|
||||||
|
'MenuArchivedChats': undefined;
|
||||||
|
'MenuContacts': undefined;
|
||||||
|
'MenuSettings': undefined;
|
||||||
|
'AriaMenuEnableNightMode': undefined;
|
||||||
|
'AriaMenuDisableNightMode': undefined;
|
||||||
|
'MenuAnimationsSwitch': undefined;
|
||||||
|
'MenuTelegramFeatures': undefined;
|
||||||
|
'TelegramFeaturesUsername': undefined;
|
||||||
'RemoveEffect': undefined;
|
'RemoveEffect': undefined;
|
||||||
'ReplyInPrivateMessage': undefined;
|
'ReplyInPrivateMessage': undefined;
|
||||||
'ProfileOpenAppTerms': undefined;
|
'ProfileOpenAppTerms': undefined;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user