From 4e558131ebecbd2e70f4744eeff4ec396ac15fe4 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Wed, 30 Jun 2021 00:23:07 +0300 Subject: [PATCH] Translation: Get rid of extra lang packs --- src/assets/lang/en-extra.json | 102 ------------------ src/assets/lang/es-extra.json | 75 ------------- src/assets/lang/it-extra.json | 75 ------------- src/assets/lang/pl-extra.json | 79 -------------- src/assets/lang/ru-extra.json | 76 ------------- .../left/settings/SettingsGeneral.tsx | 4 +- .../left/settings/SettingsHeader.tsx | 2 +- .../left/settings/SettingsNotifications.tsx | 16 +-- src/config.ts | 2 +- src/util/langProvider.ts | 32 +----- 10 files changed, 15 insertions(+), 448 deletions(-) delete mode 100644 src/assets/lang/en-extra.json delete mode 100644 src/assets/lang/es-extra.json delete mode 100644 src/assets/lang/it-extra.json delete mode 100644 src/assets/lang/pl-extra.json delete mode 100644 src/assets/lang/ru-extra.json diff --git a/src/assets/lang/en-extra.json b/src/assets/lang/en-extra.json deleted file mode 100644 index 4950a3527..000000000 --- a/src/assets/lang/en-extra.json +++ /dev/null @@ -1,102 +0,0 @@ -{ - "ActionSendTTLPhoto": "un1 sent a self-destructing photo. Please view it on your mobile", - "ActionSendTTLVideo": "un1 sent a self-destructing video. Please view it on your mobile", - "ActionYouSendTTLPhoto": "You sent a self-destructing photo. Please view it on your mobile", - "ActionYouSendTTLVideo": "You sent a self-destructing video. Please view it on your mobile", - "Activity": "Activity", - "AnimalsNature": "Animals & Nature", - "AppName": "Telegram", - "Archived": "Archived", - "BioAbout": "Any details such as age, occupation or city.\nExample: 23 y.o. designer from San Francisco.", - "ChannelInfo": "Channel Info", - "ChatInfo": "Chat Info", - "ChatsAndContacts": "Chats and contacts", - "ChooseDefaultSkinTone": "Choose your default skin tone", - "Connecting": "Connecting...", - "ConnectingToProxy": "Connecting to proxy...", - "ContactJoinedDisabled": "Disabled", - "ContactJoinedEnabled": "Enabled", - "ContinueOnThisLanguage": "Continue in English", - "CopyMessageLink": "Copy Message Link", - "Country": "Country", - "Custom": "Custom", - "DeletedMessage": "Deleted message", - "DragToReposition": "Drag to Reposition", - "EditProfile": "Edit Profile", - "Emoji": "EMOJI", - "EnterFullScreen": "Enter full screen", - "EnterPassword": "Enter a Password", - "ExitFullScreen": "Exit full screen", - "FilterChooseChats": "Please choose at least one chat for this folder.", - "FilterCreateError": "Sorry, you can't add more than 10 folders.", - "Flags": "Flags", - "FoodDrink": "Food & Drink", - "GeneralSettings": "General Settings", - "GoToMessage": "Go to message", - "InputDevice": "Input Device", - "InvalidPassword": "Invalid password. Please check the password and try again.", - "InvalidPhoneNumber": "Invalid phone number. Please check the number and try again.", - "KeepMeSignedIn": "Keep me signed in", - "Keyboard": "Keyboard", - "LeftChannel": "Left channel", - "LeftGroup": "Left group", - "Loading": "Loading...", - "LogInByPhone": "Or log in by using your phone number", - "LogInViaQR": "Quick log in using QR code", - "Microphone": "Microphone", - "More": "More", - "Next": "Next", - "NewLineByEnter": "New line by Enter", - "NewLineByShiftEnter": "New line by Shift + Enter", - "NewVersionText": "New and improved version of Telegram is ready for use.", - "NewVersionTitle": "Update available", - "NotEmojiFound": "No Emoji Found", - "NotificationsDisabled": "Disabled", - "NotificationsEnabled": "Enabled", - "Objects": "Objects", - "OutputDevice": "Output Device", - "PaymentsNotSupported": "Sorry, this Telegram client doesn't support payments yet. Please use one of our mobile apps to do this.", - "PhoneNumber": "Phone Number", - "PhotosTitle": "Photos", - "PollQuizOneRightAnswer": "Quiz has only one right answer.", - "PreviewDisabled": "Disabled", - "PreviewEnabled": "Enabled", - "QRHint": "1. Open Telegram on your phone\n2. Go to Settings > Devices > Scan QR\n3. Scan this image to Log in", - "Recent": "Frequently Used", - "RecordDeniedDescription": "You must allow your browser to access your microphone before being able to record voice notes. Click on the padlock icon next to the URL and then make sure you click Allow in the microphone settings to enable Telegram to access your microphone.", - "RecordDeniedTitle": "Permission Denied", - "Saved": "Saved", - "Search": "Search", - "SearchMessagesIn": "Search messages in", - "SearchResults": "Search Results", - "SelectChatToStartMessaging": "Please select a chat to start messaging", - "SendAsFile": "Send as a file", - "SendAsPhoto": "Send as a photo", - "SendByCommandEnter": "Send by Cmd + Enter", - "SendByControlEnter": "Send by Ctrl + Enter", - "SendByEnter": "Send by Enter", - "SendFileConfirmation": "Are you sure you want to send file?", - "SendFilesConfirmation": "Are you sure you want to send files?", - "SendMessage": "Send Message", - "SignInToTelegram": "Sign in to Telegram", - "SmileysPeople": "Smileys & People", - "StartScreenSharing": "Start screen sharing", - "StartText": "Please confirm your country code and enter your phone number.", - "Stickers": "STICKERS", - "StopScreenSharing": "Stop screen sharing", - "Symbols": "Symbols", - "Text": "Text", - "TravelPlaces": "Travel & Places", - "UnpinAllMessagesAlert": "Do you want to unpin all messages?", - "UpdateDraftConfirmation": "Are you sure you want to update draft?", - "Updating": "Updating...", - "VideosTitle": "Videos", - "ViewChannelInfo": "View channel info", - "ViewGroupInfo": "View group info", - "ViewProfile": "View profile", - "VoiceTitle": "Voice messages", - "WaitingForNetwork": "Waiting for network...", - "WriteChatCant": "Sorry, no way to write here :(", - "YourAccountProtectedWithPassword": "Your account is protected with an additional password.", - "YourPhone": "Your Phone" -} diff --git a/src/assets/lang/es-extra.json b/src/assets/lang/es-extra.json deleted file mode 100644 index df73d7250..000000000 --- a/src/assets/lang/es-extra.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Activity": "Actividad", - "AnimalsNature": "Animales y naturaleza", - "AppName": "Telegram", - "Archived": "Archivados", - "BioAbout": "Datos como la edad, ocupación o ciudad. Ejemplo: Diseñador de Chicago. 23 años.", - "ChannelInfo": "Info. del canal", - "ChatInfo": "Info. del chat", - "ChatsAndContacts": "Chats y contactos", - "ChooseDefaultSkinTone": "Elige el tono de piel por defecto", - "Connecting": "Conectando...", - "ConnectingToProxy": "Conectando al proxy...", - "ContactJoinedDisabled": "Desactivado", - "ContactJoinedEnabled": "Activado", - "ContinueOnThisLanguage": "Continuar en español", - "CopyMessageLink": "Copiar enlace del mensaje", - "Country": "País", - "Custom": "Personalizado", - "DeletedMessage": "Mensaje eliminado", - "DragToReposition": "Arrastra para posicionar", - "EditProfile": "Editar perfil", - "Emoji": "EMOJIS", - "EnterPassword": "Pon una contraseña", - "Flags": "Banderas", - "FoodDrink": "Comida y bebida", - "GeneralSettings": "General", - "GoToMessage": "Ir al mensaje", - "InvalidPhoneNumber": "Número de teléfono inválido. Por favor, revisa el número y reinténtalo.", - "KeepMeSignedIn": "Recordarme", - "LeftChannel": "Salió del canal", - "LeftGroup": "Salió del grupo", - "Loading": "Cargando...", - "LogInByPhone": "Or log in by using your phone number", - "LogInViaQR": "Quick log in using QR code", - "More": "Más", - "Next": "Siguiente", - "NotEmojiFound": "No se encontraron emojis", - "NotificationsDisabled": "Desactivadas", - "NotificationsEnabled": "Activadas", - "Objects": "Objetos", - "PhoneNumber": "Número de teléfono", - "PhotosTitle": "Fotos", - "PollQuizOneRightAnswer": "Un cuestionario tiene sólo una respuesta correcta.", - "PreviewDisabled": "Desactivada", - "PreviewEnabled": "Activada", - "QRHint": "1. Open Telegram on your phone\n2. Go to Settings > Devices > Scan QR\n3. Scan this image to Log in", - "Recent": "Uso frecuente", - "Saved": "Guardados", - "Search": "Buscar", - "SearchMessagesIn": "Buscar mensajes en", - "SearchResults": "Resultados de búsqueda", - "SelectChatToStartMessaging": "Elige un chat para comenzar", - "SendAsFile": "Enviar como archivo", - "SendAsPhoto": "Enviar como foto", - "SendFileConfirmation": "¿Quieres enviar el archivo?", - "SendFilesConfirmation": "¿Quieres enviar los archivos?", - "SendMessage": "Enviar mensaje", - "SignInToTelegram": "Iniciar sesión en Telegram", - "SmileysPeople": "Emoticonos y personas", - "StartText": "Por favor, confirma el código de tu país y pon tu número de teléfono.", - "Stickers": "STICKERS", - "Symbols": "Símbolos", - "Text": "Texto", - "TravelPlaces": "Viajes y destinos", - "UpdateDraftConfirmation": "¿Quieres actualizar el borrador?", - "Updating": "Actualizando...", - "VideosTitle": "Videos", - "ViewChannelInfo": "Ver info. del canal", - "ViewGroupInfo": "Ver info. del grupo", - "ViewProfile": "Ver perfil", - "VoiceTitle": "Mensajes de voz", - "WaitingForNetwork": "Esperando red...", - "YourAccountProtectedWithPassword": "Tu cuenta está protegida con una contraseña adicional.", - "YourPhone": "Tu teléfono" -} diff --git a/src/assets/lang/it-extra.json b/src/assets/lang/it-extra.json deleted file mode 100644 index 874a31a62..000000000 --- a/src/assets/lang/it-extra.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "Activity": "Attività", - "AnimalsNature": "Animali e Natura", - "AppName": "Telegram", - "Archived": "Chat archiviate", - "BioAbout": "Qualsiasi dettaglio come età, lavoro o città.\nEsempio: Designer di 23 anni da San Francisco.", - "ChannelInfo": "Info canale", - "ChatInfo": "Info chat", - "ChatsAndContacts": "Chat e contatti", - "ChooseDefaultSkinTone": "Scegli ", - "Connecting": "Connetto...", - "ConnectingToProxy": "Connetto al proxy...", - "ContactJoinedDisabled": "Disattivato", - "ContactJoinedEnabled": "Attivato", - "ContinueOnThisLanguage": "Continue in English", - "CopyMessageLink": "Copia link messaggio", - "Country": "Paese", - "Custom": "Custom", - "DeletedMessage": "Messaggi cancellati", - "DragToReposition": "Trascina per riposizionare", - "EditProfile": "Modifica profilo", - "Emoji": "EMOJI", - "EnterPassword": "Inserisci password", - "Flags": "Bandiere", - "FoodDrink": "Cibo e Bevande", - "GeneralSettings": "Impostazioni generali", - "GoToMessage": "Vai al messaggio", - "InvalidPhoneNumber": "Numero di telefono non valido. Per favore controlla il numero e riprova.", - "KeepMeSignedIn": "Mantieni l'accesso", - "LeftChannel": "Canale abbandonato", - "LeftGroup": "Gruppo abbandonato", - "Loading": "Carico...", - "LogInByPhone": "Or log in by using your phone number", - "LogInViaQR": "Quick log in using QR code", - "More": "Altro", - "Next": "Avanti", - "NotEmojiFound": "Emoji non trovato", - "NotificationsDisabled": "Disattivate", - "NotificationsEnabled": "Attivate", - "Objects": "Oggetti", - "PhoneNumber": "Numero di telefono", - "PhotosTitle": "Foto", - "PollQuizOneRightAnswer": "Il quiz ha solo una risposta esatta.", - "PreviewDisabled": "Disattivata", - "PreviewEnabled": "Attivata", - "QRHint": "1. Open Telegram on your phone\n2. Go to Settings > Devices > Scan QR\n3. Scan this image to Log in", - "Recent": "Usati di recente", - "Saved": "Messaggi salvati", - "Search": "Cerca", - "SearchMessagesIn": "Cerca messaggi in", - "SearchResults": "Risultati di ricerca", - "SelectChatToStartMessaging": "Seleziona una chat per iniziare a messaggiare", - "SendAsFile": "Invia come file", - "SendAsPhoto": "Invia come immagine", - "SendFileConfirmation": "Sei sicuro di voler mandare il file?", - "SendFilesConfirmation": "Sei sicuro di voler mandare i file?", - "SendMessage": "Invia messaggio", - "SignInToTelegram": "Accedi a Telegram", - "SmileysPeople": "Faccine e Persone", - "StartText": "Conferma il prefisso internazionale e inserisci il tuo numero di telefono.", - "Stickers": "STICKER", - "Symbols": "Simboli", - "Text": "Testo", - "TravelPlaces": "Viaggi e Luoghi", - "UpdateDraftConfirmation": "Sei sicuro di voler aggiornare la bozza?", - "Updating": "Aggiorno...", - "VideosTitle": "Video", - "ViewChannelInfo": "Visualizza info canale", - "ViewGroupInfo": "Visualizza info gruppo", - "ViewProfile": "Visualizza profilo", - "VoiceTitle": "Messaggi vocali", - "WaitingForNetwork": "Attendo la rete...", - "YourAccountProtectedWithPassword": "Il tuo account è protetto con una password aggiuntiva.", - "YourPhone": "Il tuo numero" -} diff --git a/src/assets/lang/pl-extra.json b/src/assets/lang/pl-extra.json deleted file mode 100644 index 6d767c450..000000000 --- a/src/assets/lang/pl-extra.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "Activity": "Aktywność", - "AnimalsNature": "Zwierzęta i natura", - "AppName": "Telegram", - "Archived": "Zarchiwizowane", - "BioAbout": "Różne szczegóły takie jak wiek, zawód lub miasto.\nPrzykład: 23 lata, projektant z Warszawy.", - "ChannelInfo": "Info o kanale", - "ChatInfo": "Info o grupie", - "ChatsAndContacts": "Czaty i kontakty", - "ChooseDefaultSkinTone": "Wybierz domyślny odcień skóry", - "Connecting": "Łączenie…", - "ConnectingToProxy": "Łączenie z proxy…", - "ContactJoinedDisabled": "Wyłączone", - "ContactJoinedEnabled": "Włączone", - "ContinueOnThisLanguage": "Kontynuuj po angielsku", - "CopyMessageLink": "Kopiuj link wiadomości", - "Country": "Kraj", - "Custom": "Własne", - "DeletedMessage": "Usunięta wiadomość", - "DragToReposition": "Przeciągnij, aby zmienić położenie", - "EditProfile": "Edytuj profil", - "Emoji": "EMOJI", - "EnterPassword": "Wprowadź hasło", - "FilterChooseChats": "Wybierz co najmniej jeden czat dla tego folderu.", - "FilterCreateError": "Nie można dodać więcej niż 10 folderów.", - "Flags": "Flagi", - "FoodDrink": "Jedzenie i picie", - "GeneralSettings": "Ustawienia ogólne", - "GoToMessage": "Idź do wiadomości", - "InvalidPhoneNumber": "Nieprawidłowy numer telefonu. Sprawdź numer i spróbuj ponownie.", - "KeepMeSignedIn": "Nie wylogowuj mnie", - "LeftChannel": "Opuszczono kanał", - "LeftGroup": "Opuszczono grupę", - "Loading": "Wczytywanie…", - "LogInByPhone": "Lub zaloguj się, używając swojego numeru telefonu", - "LogInViaQR": "Szybkie logowanie przy użyciu kodu QR", - "More": "Więcej", - "Next": "Dalej", - "NotEmojiFound": "Nie znaleziono emoji", - "NotificationsDisabled": "Wyłączone", - "NotificationsEnabled": "Włączone", - "Objects": "Obiekty", - "PhoneNumber": "Numer telefonu", - "PhotosTitle": "Zdjęcia", - "PollQuizOneRightAnswer": "Quiz ma tylko jedną poprawną odpowiedź.", - "PreviewDisabled": "Wyłączony", - "PreviewEnabled": "Włączony", - "QRHint": "1. Otwórz Telegram na swoim telefonie\n2. Przejdź do Ustawienia » Urządzenia » Zeskanuj kod QR\n3. Zeskanuj ten obraz, aby się zalogować", - "Recent": "Często używane", - "RecordDeniedDescription": "Zanim będzie można nagrywać notatki głosowe, należy zezwolić przeglądarce na dostęp do mikrofonu. Kliknij na ikonę kłódki obok adresu URL, a następnie upewnij się, że jest wybrane Zezwól w ustawieniach mikrofonu, aby umożliwić dostęp do twojego mikrofonu.", - "RecordDeniedTitle": "Odmowa dostępu", - "Saved": "Zapisane", - "Search": "Szukaj", - "SearchMessagesIn": "Szukaj wiadomości w", - "SearchResults": "Wyniki wyszukiwania", - "SelectChatToStartMessaging": "Wybierz czat, aby rozpocząć rozmowę", - "SendAsFile": "Wyślij jako plik", - "SendAsPhoto": "Wyślij jako zdjęcie", - "SendFileConfirmation": "Czy na pewno chcesz wysłać plik?", - "SendFilesConfirmation": "Czy na pewno chcesz wysłać pliki?", - "SendMessage": "Wyślij wiadomość", - "SignInToTelegram": "Zaloguj się do Telegrama", - "SmileysPeople": "Uśmieszki i ludzie", - "StartText": "Potwierdź kod twojego kraju i podaj swój numer telefonu.", - "Stickers": "NAKLEJKI", - "Symbols": "Symbole", - "Text": "Tekst", - "TravelPlaces": "Podróże i miejsca", - "UpdateDraftConfirmation": "Czy na pewno chcesz zaktualizować wersję roboczą?", - "Updating": "Aktualizowanie…", - "VideosTitle": "Wideo", - "ViewChannelInfo": "Pokaż info o kanale", - "ViewGroupInfo": "Pokaż info o grupie", - "ViewProfile": "Pokaż profil", - "VoiceTitle": "Wiadomości głosowe", - "WaitingForNetwork": "Czekam na sieć…", - "YourAccountProtectedWithPassword": "Twoje konto jest zabezpieczone dodatkowym hasłem.", - "YourPhone": "Twój numer telefonu" -} diff --git a/src/assets/lang/ru-extra.json b/src/assets/lang/ru-extra.json deleted file mode 100644 index e34b4c3b2..000000000 --- a/src/assets/lang/ru-extra.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "Activity": "Активность", - "AnimalsNature": "Животные и природа", - "AppName": "Telegram", - "Archived": "Архив", - "BioAbout": "Любые подробности, например: возраст, род занятий или город.\nПример: 23 года, дизайнер из Санкт-Петербурга.", - "ChannelInfo": "Информация о канале", - "ChatInfo": "Информация о чате", - "ChatsAndContacts": "Чаты и контакты", - "ChooseDefaultSkinTone": "Выберите тон кожи по умолчанию", - "Connecting": "Соединение...", - "ConnectingToProxy": "Подключение к прокси...", - "ContactJoinedDisabled": "Выключено", - "ContactJoinedEnabled": "Включено", - "ContinueOnThisLanguage": "Продолжить на русском", - "CopyMessageLink": "Копировать ссылку на сообщение", - "Country": "Страна", - "Custom": "Пользовательские", - "DeletedMessage": "Удаленное сообщение", - "DragToReposition": "Перетащите, чтобы изменить положение", - "EditProfile": "Редактировать профиль", - "Emoji": "ЕМОДЗИ", - "EnterPassword": "Введите пароль", - "Flags": "Флаги", - "FoodDrink": "Еда и напитки", - "GeneralSettings": "Основные настройки", - "GoToMessage": "Перейти к сообщению", - "InvalidPhoneNumber": "Некорректный номер телефона. Пожалуйста, проверьте номер и попробуйте ещё раз.", - "KeepMeSignedIn": "Сохранить авторизацию", - "LeftChannel": "Канал покинут", - "LeftGroup": "Группа покинута", - "Loading": "Загрузка...", - "LogInByPhone": "Вход по номеру телефона", - "LogInViaQR": "Быстрый вход по QR-коду", - "More": "Ещё", - "Next": "Далее", - "NotEmojiFound": "Емодзи не найдены", - "NotificationsDisabled": "Выключены", - "NotificationsEnabled": "Включены", - "Objects": "Предметы", - "PhoneNumber": "Телефонный номер", - "PhotosTitle": "Фотографии", - "PollQuizOneRightAnswer": "В викторинах только один правильный ответ.", - "PreviewDisabled": "Выключено", - "PreviewEnabled": "Включено", - "QRHint": "1. Запустите Telegram на телефоне\n2. Откройте настройки > Устройства > Сканировать QR-код.\n3. Сканируйте этот код для авторизации", - "Recent": "Часто используемые", - "Saved": "Избранное", - "Search": "Поиск", - "SearchMessagesIn": "Искать сообщения в", - "SearchResults": "Результаты поиска", - "SelectChatToStartMessaging": "Пожалуйста, выберите, кому хотели бы написать", - "SendAsFile": "Отправить как файл", - "SendAsPhoto": "Отправить как фото", - "SendFileConfirmation": "Вы действительно хотите отправить файл?", - "SendFilesConfirmation": "Вы действительно хотите отправить файлы?", - "SendMessage": "Отправить сообщение", - "SignInToTelegram": "Вход в Telegram", - "SmileysPeople": "Смайлики и люди", - "StartText": "Пожалуйста, укажите код страны и свой номер телефона.", - "Stickers": "СТИКЕРЫ", - "Symbols": "Символы", - "Text": "Текст", - "TravelPlaces": "Путешествия и местности", - "UnpinAllMessagesAlert": "Хотите открепить все сообщения?", - "UpdateDraftConfirmation": "Вы действительно хотите обновить черновик сообщения?", - "Updating": "Обновление...", - "VideosTitle": "Видеозаписи", - "ViewChannelInfo": "Информация о канале", - "ViewGroupInfo": "Информация о группе", - "ViewProfile": "Показать профиль", - "VoiceTitle": "Голосовые сообщения", - "WaitingForNetwork": "Ожидание сети...", - "YourAccountProtectedWithPassword": "Ваш аккаунт защищен дополнительным паролем.", - "YourPhone": "Ваш телефон" -} diff --git a/src/components/left/settings/SettingsGeneral.tsx b/src/components/left/settings/SettingsGeneral.tsx index 413f7dba9..56f5dd750 100644 --- a/src/components/left/settings/SettingsGeneral.tsx +++ b/src/components/left/settings/SettingsGeneral.tsx @@ -158,7 +158,7 @@ const SettingsGeneral: FC = ({ {KEYBOARD_SEND_OPTIONS && (
-

{lang('Keyboard')}

+

{lang('VoiceOver.Keyboard')}

= ({ onCheck={(isChecked) => setSettingOption({ shouldAutoPlayGifs: isChecked })} /> setSettingOption({ shouldAutoPlayVideos: isChecked })} /> diff --git a/src/components/left/settings/SettingsHeader.tsx b/src/components/left/settings/SettingsHeader.tsx index aa3ff2483..dbfc2d2fe 100644 --- a/src/components/left/settings/SettingsHeader.tsx +++ b/src/components/left/settings/SettingsHeader.tsx @@ -132,7 +132,7 @@ const SettingsHeader: FC = ({ case SettingsScreens.TwoFaNewPassword: case SettingsScreens.TwoFaChangePasswordNew: case SettingsScreens.TwoFaChangePasswordConfirm: - return

{lang('EnterPassword')}

; + return

{lang('PleaseEnterCurrentPassword')}

; case SettingsScreens.TwoFaNewPasswordConfirm: return

{lang('PleaseReEnterPassword')}

; case SettingsScreens.TwoFaNewPasswordHint: diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index c7e73978b..051efcba4 100644 --- a/src/components/left/settings/SettingsNotifications.tsx +++ b/src/components/left/settings/SettingsNotifications.tsx @@ -82,13 +82,15 @@ const SettingsNotifications: FC = ({ { handleSettingsChange(e, 'contact', 'silent'); }} /> { handleSettingsChange(e, 'contact', 'showPreviews'); }} /> @@ -99,13 +101,13 @@ const SettingsNotifications: FC = ({ { handleSettingsChange(e, 'group', 'silent'); }} /> { handleSettingsChange(e, 'group', 'showPreviews'); }} /> @@ -116,13 +118,15 @@ const SettingsNotifications: FC = ({ { handleSettingsChange(e, 'broadcast', 'silent'); }} /> { handleSettingsChange(e, 'broadcast', 'showPreviews'); }} /> diff --git a/src/config.ts b/src/config.ts index 4f31f831a..3b96175b5 100644 --- a/src/config.ts +++ b/src/config.ts @@ -30,7 +30,7 @@ export const MEDIA_PROGRESSIVE_CACHE_DISABLED = false; export const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive'; export const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB export const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg'; -export const LANG_CACHE_NAME = 'tt-lang-packs-v4'; +export const LANG_CACHE_NAME = 'tt-lang-packs-v5'; export const ASSET_CACHE_NAME = 'tt-assets'; export const API_UPDATE_THROTTLE = 300; diff --git a/src/util/langProvider.ts b/src/util/langProvider.ts index fc01cb40d..e0c7c1883 100644 --- a/src/util/langProvider.ts +++ b/src/util/langProvider.ts @@ -1,16 +1,9 @@ import { ApiLangPack } from '../api/types'; -import { DEBUG, LANG_CACHE_NAME, LANG_PACKS } from '../config'; +import { LANG_CACHE_NAME, LANG_PACKS } from '../config'; import * as cacheApi from './cacheApi'; import { callApi } from '../api/gramjs'; import { createCallbackManager } from './callbacks'; -import { mapValues } from './iteratees'; - -import enExtraJson from '../assets/lang/en-extra.json'; -import esExtraJson from '../assets/lang/es-extra.json'; -import itExtraJson from '../assets/lang/it-extra.json'; -import plExtraJson from '../assets/lang/pl-extra.json'; -import ruExtraJson from '../assets/lang/ru-extra.json'; import { formatInteger } from './textFormat'; import { getGlobal } from '../lib/teact/teactn'; @@ -20,14 +13,6 @@ interface LangFn { isRtl?: boolean; } -const EXTRA_PACK_PATHS: Record = { - en: enExtraJson as unknown as string, - es: esExtraJson as unknown as string, - it: itExtraJson as unknown as string, - pl: plExtraJson as unknown as string, - ru: ruExtraJson as unknown as string, -}; - const PLURAL_OPTIONS = ['value', 'zeroValue', 'oneValue', 'twoValue', 'fewValue', 'manyValue', 'otherValue'] as const; const PLURAL_RULES = { /* eslint-disable max-len */ @@ -114,21 +99,6 @@ export async function setLanguage(langCode: string, callback?: NoneToVoidFunctio return; } - if (EXTRA_PACK_PATHS[langCode]) { - try { - const response = await fetch(EXTRA_PACK_PATHS[langCode]); - const pairs = await response.json(); - const extraLangPack = mapValues(pairs, (value, key) => ({ key, value })); - - Object.assign(newLangPack, extraLangPack); - } catch (err) { - if (DEBUG) { - // eslint-disable-next-line no-console - console.error(err); - } - } - } - cache.clear(); currentLangCode = langCode;