//! Verbatim official Yandex Music Desktop 5.129.0 RU & EN localization dictionary. //! Every string is extracted verbatim from `original_yandex_music/beautified/i18n/{ru,en}.json` //! and `original_yandex_music/decompiled/themes_i18n_icons_spec.md`. use crate::config::{Language, ThemeMode}; pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); /// Lightweight zero-allocation localization helper bound to a `Language`. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct I18n { pub lang: Language, } pub const fn tr(lang: Language) -> I18n { I18n { lang } } impl I18n { #[inline] pub const fn is_ru(self) -> bool { matches!(self.lang, Language::Ru) } #[inline] pub const fn pick(self, ru: &'static str, en: &'static str) -> &'static str { if self.is_ru() { ru } else { en } } // ------------------------------------------------------------------------- // Window Title, App Name & Caption Tooltips (§2.1) // ------------------------------------------------------------------------- pub const fn app_name(self) -> &'static str { self.pick("Яндекс Музыка", "Yandex Music") } pub const fn roll_up(self) -> &'static str { self.pick("Свернуть", "Hide") } pub const fn unwrap(self) -> &'static str { self.pick("Развернуть", "Expand") } pub const fn close(self) -> &'static str { self.pick("Закрыть", "Close") } pub const fn quit_app(self) -> &'static str { self.pick("Закрыть приложение", "Close app") } // ------------------------------------------------------------------------- // Sidebar Navigation & Collection Tabs (§2.4) // ------------------------------------------------------------------------- pub const fn search(self) -> &'static str { self.pick("Поиск", "Search") } pub const fn my_vibe(self) -> &'static str { self.pick("Моя волна", "My Vibe") } pub const fn for_you_and_trends(self) -> &'static str { self.pick("Для вас и Тренды", "For you and Trends") } pub const fn for_you(self) -> &'static str { self.pick("Для вас", "For You") } pub const fn trends(self) -> &'static str { self.pick("Тренды", "Trends") } pub const fn concerts(self) -> &'static str { self.pick("Концерты", "Concerts") } pub const fn books_and_podcasts(self) -> &'static str { self.pick("Книги и подкасты", "Books & Podcasts") } pub const fn podcasts_and_books(self) -> &'static str { self.pick("Подкасты и книги", "Podcasts and books") } pub const fn collection(self) -> &'static str { self.pick("Коллекция", "My Collection") } pub const fn kids(self) -> &'static str { self.pick("Детям", "For Kids") } pub const fn chart(self) -> &'static str { self.pick("Чарт", "Chart") } pub const fn liked_playlist(self) -> &'static str { self.pick("Мне нравится", "My Favorites") } pub const fn tracks(self) -> &'static str { self.pick("Треки", "Tracks") } pub const fn liked_tracks_tab(self) -> &'static str { self.pick("Любимые треки", "My Favorites") } pub const fn playlists(self) -> &'static str { self.pick("Плейлисты", "Playlists") } pub const fn my_playlists(self) -> &'static str { self.pick("Мои плейлисты", "My playlists") } pub const fn favourite_playlists(self) -> &'static str { self.pick("Любимые плейлисты", "Favorite playlists") } pub const fn albums(self) -> &'static str { self.pick("Альбомы", "Albums") } pub const fn favourite_albums(self) -> &'static str { self.pick("Любимые альбомы", "Favorite albums") } pub const fn artists(self) -> &'static str { self.pick("Исполнители", "Artists") } pub const fn downloaded(self) -> &'static str { self.pick("Скачанное", "Downloaded") } pub const fn downloaded_tracks(self) -> &'static str { self.pick("Скачанные треки", "Downloaded tracks") } pub const fn history(self) -> &'static str { self.pick("История", "History") } pub const fn listening_history(self) -> &'static str { self.pick("История прослушивания", "Listening history") } pub const fn my_dislikes(self) -> &'static str { self.pick("Мои дизлайки", "My dislikes") } pub const fn pinned(self) -> &'static str { self.pick("Закрепленное", "Pinned") } pub const fn plus_badge(self) -> &'static str { self.pick("Плюс", "Plus") } // ------------------------------------------------------------------------- // Profile Menu, Auth & Theme (§2.5) // ------------------------------------------------------------------------- pub const fn account_management(self) -> &'static str { self.pick("Управление аккаунтом", "Account management") } pub const fn settings(self) -> &'static str { self.pick("Настройки", "Settings") } pub const fn support_chat(self) -> &'static str { self.pick("Чат с поддержкой", "Support chat") } pub const fn language_name(self) -> &'static str { self.pick("Русский", "English") } pub const fn appearance(self) -> &'static str { self.pick("Оформление", "Appearance") } pub const fn theme_system(self) -> &'static str { self.pick("Как в системе", "System") } pub const fn theme_dark(self) -> &'static str { self.pick("Тёмная", "Dark") } pub const fn theme_light(self) -> &'static str { self.pick("Светлая", "Light") } pub const fn theme_label(self, mode: ThemeMode) -> &'static str { match mode { ThemeMode::System => self.theme_system(), ThemeMode::Dark => self.theme_dark(), ThemeMode::Light => self.theme_light(), } } pub const fn sign_out(self) -> &'static str { self.pick("Выйти", "Sign out") } pub const fn log_in(self) -> &'static str { self.pick("Войти", "Log in") } pub const fn login_title(self) -> &'static str { self.pick("Войдите в аккаунт", "Log in to your account") } pub const fn login_subtitle(self) -> &'static str { self.pick( "Чтобы слушать музыку и подкасты без ограничений", "To listen to music and podcasts without restrictions", ) } // ------------------------------------------------------------------------- // Search Page (§2.3) // ------------------------------------------------------------------------- pub const fn search_all(self) -> &'static str { self.pick("Все", "All") } pub const fn search_top(self) -> &'static str { self.pick("Топ", "Top") } pub const fn search_best_results(self) -> &'static str { self.pick("Лучшие результаты", "Top results") } pub const fn search_other_results(self) -> &'static str { self.pick("Другие результаты", "More results") } pub const fn search_not_found_title(self) -> &'static str { self.pick("Ничего не нашли", "Couldn't find anything") } pub const fn search_not_found_desc(self) -> &'static str { self.pick("Попробуйте написать по-другому", "Try changing your query") } pub const fn search_placeholder(self) -> &'static str { self.pick("Трек, альбом, исполнитель", "Track, album, artist") } pub const fn search_placeholder_q2v(self) -> &'static str { self.pick("Что вы чувствуете или ищете?", "What do you feel or search for?") } pub const fn track_search_placeholder(self) -> &'static str { self.pick("Поиск трека", "Track search") } pub const fn playlist_search_placeholder(self) -> &'static str { self.pick("Найти плейлист", "Playlist search") } pub const fn search_history_empty(self) -> &'static str { self.pick("История поиска пуста", "Your search history is empty") } pub const fn search_recent_fallback(self) -> &'static str { self.pick( "Здесь будут ваши недавние запросы", "Your recent queries will appear here", ) } pub const fn clear_history(self) -> &'static str { self.pick("Очистить историю", "Clear history") } pub const fn clear(self) -> &'static str { self.pick("Очистить", "Clear") } pub const fn clear_search(self) -> &'static str { self.pick("Очистить поиск", "Clear search") } pub const fn popular_among_users(self) -> &'static str { self.pick("Популярно у слушателей", "Popular") } pub const fn mixes(self) -> &'static str { self.pick("Миксы", "Mixes") } pub const fn selections(self) -> &'static str { self.pick("Подборки", "Selections") } pub const fn discover_playlists(self) -> &'static str { self.pick("Откройте для себя плейлисты", "Discover these playlists") } pub const fn loading(self) -> &'static str { self.pick("Контент загружается", "Loading...") } // ------------------------------------------------------------------------- // Entities, Headers & Promo (§2.6) // ------------------------------------------------------------------------- pub const fn listen(self) -> &'static str { self.pick("Слушать", "Listen") } pub const fn play(self) -> &'static str { self.pick("Воспроизведение", "Play") } pub const fn pause(self) -> &'static str { self.pick("Пауза", "Pause") } pub const fn album(self) -> &'static str { self.pick("Альбом", "Album") } pub const fn artist(self) -> &'static str { self.pick("Исполнитель", "Artist") } pub const fn playlist(self) -> &'static str { self.pick("Плейлист", "Playlist") } pub const fn single(self) -> &'static str { self.pick("Сингл", "Single") } pub const fn track(self) -> &'static str { self.pick("Трек", "Track") } pub const fn popular_tracks(self) -> &'static str { self.pick("Популярные треки", "Popular tracks") } pub const fn similar_artists(self) -> &'static str { self.pick("Похожие исполнители", "Similar artists") } pub const fn monthly_listeners(self) -> &'static str { self.pick("Слушателей за месяц", "Monthly listeners") } pub const fn recommended_by_artist(self) -> &'static str { self.pick("Артист рекомендует", "Recommended by the Artist") } pub const fn made_for_you(self) -> &'static str { self.pick("Собрано для вас", "Mixed into an AI set") } pub const fn continue_listening(self) -> &'static str { self.pick("Продолжить слушать", "Continue listening") } pub const fn audiobooks(self) -> &'static str { self.pick("Аудиокниги", "Audiobooks") } pub const fn new_releases(self) -> &'static str { self.pick("Новые релизы", "New releases") } pub const fn popular_playlists(self) -> &'static str { self.pick("Популярные плейлисты", "Popular playlists") } pub const fn filter_all(self) -> &'static str { self.pick("Все", "All") } // ------------------------------------------------------------------------- // Context Menu Items & Overlays (§2.2) // ------------------------------------------------------------------------- pub const fn play_next(self) -> &'static str { self.pick("Играть следующим", "Play next") } pub const fn play_last(self) -> &'static str { self.pick("Добавить в конец очереди", "Add to the end of the queue") } pub const fn remove_from_queue(self) -> &'static str { self.pick("Удалить из очереди", "Remove from queue") } pub const fn add_to_playlist(self) -> &'static str { self.pick("Добавить в плейлист", "Add to playlist") } pub const fn add_to_another_playlist(self) -> &'static str { self.pick("Добавить в другой плейлист", "Add to another playlist") } pub const fn remove_from_playlist(self) -> &'static str { self.pick("Удалить из плейлиста", "Remove from playlist") } pub const fn share(self) -> &'static str { self.pick("Поделиться", "Share") } pub const fn copy_link(self) -> &'static str { self.pick("Скопировать ссылку", "Copy link") } pub const fn html_code(self) -> &'static str { self.pick("HTML-код", "HTML code") } pub const fn download(self) -> &'static str { self.pick("Скачать", "Download") } pub const fn stop_download(self) -> &'static str { self.pick("Остановить скачивание", "Stop download") } pub const fn delete_from_device(self) -> &'static str { self.pick("Удалить с устройства", "Delete from device") } pub const fn vibe_by_track(self) -> &'static str { self.pick("Моя волна по треку", "My Vibe by track") } pub const fn vibe_by_album(self) -> &'static str { self.pick("Моя волна по альбому", "My Vibe by album") } pub const fn vibe_by_artist(self) -> &'static str { self.pick("Моя волна по артисту", "My Vibe by artist") } pub const fn vibe_by_playlist(self) -> &'static str { self.pick("Моя волна по плейлисту", "My Vibe by playlist") } pub const fn go_to_track(self) -> &'static str { self.pick("Перейти к треку", "Go to track") } pub const fn view_album(self) -> &'static str { self.pick("Перейти к альбому", "View album") } pub const fn go_to_artist(self) -> &'static str { self.pick("Перейти к исполнителю", "Go to artist") } pub const fn go_to_artists(self) -> &'static str { self.pick("Перейти к исполнителям", "Go to artists") } pub const fn like(self) -> &'static str { self.pick("Нравится", "Like") } pub const fn dislike(self) -> &'static str { self.pick("Не нравится", "I don't like it") } pub const fn pin(self) -> &'static str { self.pick("Закрепить", "Pin") } pub const fn unpin(self) -> &'static str { self.pick("Открепить", "Unpin") } pub const fn pin_my_vibe(self) -> &'static str { self.pick("Закрепить Мою волну", "Pin My Vibe") } pub const fn unpin_my_vibe(self) -> &'static str { self.pick("Открепить Мою волну", "Unpin My Vibe") } pub const fn create_playlist(self) -> &'static str { self.pick("Создать плейлист", "Create playlist") } pub const fn new_playlist_default(self) -> &'static str { self.pick("Новый плейлист", "New playlist") } pub const fn edit(self) -> &'static str { self.pick("Редактировать", "Edit") } pub const fn rename(self) -> &'static str { self.pick("Переименовать", "Rename") } pub const fn delete_playlist(self) -> &'static str { self.pick("Удалить плейлист", "Delete playlist") } pub const fn private_playlist(self) -> &'static str { self.pick("Приватный плейлист", "Private playlist") } pub const fn track_details(self) -> &'static str { self.pick("О треке", "Track details") } pub const fn open_sync_lyrics(self) -> &'static str { self.pick("Включить текстомузыку", "Turn on Music and lyrics") } pub const fn hide_sync_lyrics(self) -> &'static str { self.pick("Скрыть текстомузыку", "Hide Music and lyrics") } pub const fn show_lyrics(self) -> &'static str { self.pick("Показать текст песни", "Show lyrics") } pub const fn lyrics(self) -> &'static str { self.pick("Текст песни", "Lyrics") } pub const fn open_queue(self) -> &'static str { self.pick("Открыть очередь", "Open queue") } pub const fn queue(self) -> &'static str { self.pick("Очередь", "Queue") } pub const fn sound_settings(self) -> &'static str { self.pick("Настройки звука", "Sound settings") } pub const fn volume(self) -> &'static str { self.pick("Громкость", "Volume") } pub const fn fullscreen_player(self) -> &'static str { self.pick("Полноэкранный плеер", "Fullscreen player") } pub const fn shuffle(self) -> &'static str { self.pick("Перемешать", "Shuffle") } pub const fn repeat(self) -> &'static str { self.pick("Повторять", "Repeat") } pub const fn save(self) -> &'static str { self.pick("Сохранить", "Save") } pub const fn cancel(self) -> &'static str { self.pick("Отмена", "Cancel") } pub const fn delete(self) -> &'static str { self.pick("Удалить", "Delete") } pub const fn unknown_artist(self) -> &'static str { self.pick("Неизвестный исполнитель", "Unknown artist") } // ------------------------------------------------------------------------- // Official 5.129.0 AI WordsCard Strings // ------------------------------------------------------------------------- pub const fn words_feedback_like(self) -> &'static str { self.pick("Спасибо за оценку", "Thank you for your rating!") } pub const fn words_feedback_dislike(self) -> &'static str { self.pick( "Спасибо, что помогаете мне стать лучше", "Thank you for making me become better!", ) } pub const fn words_more_similar(self) -> &'static str { self.pick("Больше такого", "More similar replies") } pub const fn words_not_cool(self) -> &'static str { self.pick("Мимо", "Not cool") } pub const fn words_ai_disclaimer(self) -> &'static str { self.pick( "AI может ошибаться, проверяйте важное", "AI may make mistakes, be sure to double-check important information", ) } // ------------------------------------------------------------------------- // Formatted Labels & Official Toasts (§2.7) // ------------------------------------------------------------------------- pub fn count_tracks(self, count: usize) -> String { if self.is_ru() { let m100 = count % 100; let m10 = count % 10; let word = if (11..=14).contains(&m100) { "треков" } else if m10 == 1 { "трек" } else if (2..=4).contains(&m10) { "трека" } else { "треков" }; format!("{} {}", count, word) } else if count == 1 { "1 track".to_string() } else { format!("{} tracks", count) } } pub const fn toast_repeat_off(self) -> &'static str { self.pick("Повтор выключен", "Repeat off") } pub const fn toast_repeat_all(self) -> &'static str { self.pick("Повтор списка воспроизведения включен", "Repeat playlist on") } pub const fn toast_repeat_one(self) -> &'static str { self.pick("Повтор трека включен", "Repeat track on") } pub const fn toast_shuffle_on(self) -> &'static str { self.pick("Случайный порядок", "Shuffle play") } pub const fn toast_shuffle_off(self) -> &'static str { self.pick("Воспроизведение подряд", "Auto-play") } pub const fn toast_shuffle_vibe_managed(self) -> &'static str { self.pick( "В «Моей волне» порядок подбирается автоматически", "Shuffle is managed automatically in My Vibe", ) } pub fn toast_play_next(self, title: &str) -> String { if self.is_ru() { format!("Трек {} добавлен в начало очереди", title) } else { format!("Track {} added to the beginning of the queue", title) } } pub fn toast_play_last(self, title: &str) -> String { if self.is_ru() { format!("Трек {} добавлен в конец очереди", title) } else { format!("Track {} added to the end of the queue", title) } } pub fn toast_removed_from_queue(self, title: &str) -> String { if self.is_ru() { format!("Трек {} удалён из очереди", title) } else { format!("The track {} was removed from the queue", title) } } pub fn toast_track_liked(self, title: &str) -> String { if self.is_ru() { format!("Трек {} добавлен в плейлист «Мне нравится»", title) } else { format!("Track {} was added to 'My Favorites'", title) } } pub fn toast_track_unliked(self, title: &str) -> String { if self.is_ru() { format!("Трек {} удален из плейлиста «Мне нравится»", title) } else { format!("Track {} was removed from 'My Favorites'", title) } } pub const fn toast_track_disliked(self) -> &'static str { self.pick( "Трек больше не будет появляться в ваших рекомендациях", "Track will no longer appear in your recommendations", ) } pub const fn toast_track_undisliked(self) -> &'static str { self.pick( "Теперь трек сможет появляться в ваших рекомендациях", "Now the track will be able to appear in your recommendations", ) } pub fn toast_pinned(self, kind: &str, title: &str) -> String { if self.is_ru() { match kind { "album" => format!("Альбом {} закреплен в боковом меню", title), "artist" => format!("Исполнитель {} закреплен в боковом меню", title), "wave" => format!("Моя волна {} закреплена в боковом меню", title), _ => format!("Плейлист {} закреплен в боковом меню", title), } } else { match kind { "album" => format!("Album {} was pinned to the side menu", title), "artist" => format!("Artist {} was pinned to the side menu", title), "wave" => format!("My vibe {} was pinned to the side menu", title), _ => format!("Playlist {} was pinned to the side menu", title), } } } pub fn toast_unpinned(self, kind: &str, title: &str) -> String { if self.is_ru() { match kind { "album" => format!("Альбом {} удален из бокового меню", title), "artist" => format!("Исполнитель {} удален из бокового меню", title), "wave" => format!("Моя волна {} удалена из бокового меню", title), _ => format!("Плейлист {} удален из бокового меню", title), } } else { match kind { "album" => format!("Album {} was removed from the side menu", title), "artist" => format!("Artist {} was removed from the side menu", title), "wave" => format!("My vibe {} was removed from the side menu", title), _ => format!("Playlist {} was removed from the side menu", title), } } } pub fn toast_link_copied(self, kind: &str) -> String { if self.is_ru() { let prefix = match kind { "album" => "Ссылка на альбом", "playlist" => "Ссылка на плейлист", "artist" => "Ссылка на артиста", _ => "Ссылка на трек", }; format!("{} скопирована", prefix) } else { let prefix = match kind { "album" => "Link to the album", "playlist" => "Link to the playlist", "artist" => "Link to the artist", _ => "Link to the track", }; format!("{} copied", prefix) } } pub const fn toast_html_copied(self) -> &'static str { self.pick("HTML-код скопирован", "HTML code copied") } pub fn toast_track_downloaded(self, title: &str) -> String { if self.is_ru() { format!("Трек скачан: {}", title) } else { format!("Track downloaded: {}", title) } } pub const fn toast_download_error(self) -> &'static str { self.pick( "При скачивании трека произошла ошибка", "An error occurred while downloading the track", ) } pub const fn toast_download_stopped(self) -> &'static str { self.pick("Загрузка остановлена", "Download stopped") } pub fn toast_deleted_from_device(self, title: &str) -> String { if self.is_ru() { format!("Удалено с устройства: {}", title) } else { format!("Deleted from device: {}", title) } } pub fn toast_added_to_playlist(self, track: &str, playlist: &str) -> String { if self.is_ru() { format!("Трек {} добавлен в плейлист «{}»", track, playlist) } else { format!("Track {} was added to {}", track, playlist) } } pub fn toast_removed_from_playlist(self, track: &str, playlist: &str) -> String { if self.is_ru() { format!("Трек {} удален из плейлиста «{}»", track, playlist) } else { format!("Track {} removed from the {} playlist", track, playlist) } } pub fn toast_playlist_created(self, title: &str) -> String { if self.is_ru() { format!("Создан плейлист «{}»", title) } else { format!("Created playlist \"{}\"", title) } } pub fn toast_playlist_renamed(self, title: &str) -> String { if self.is_ru() { format!("Плейлист переименован в «{}»", title) } else { format!("Playlist renamed to \"{}\"", title) } } pub const fn toast_playlist_deleted(self) -> &'static str { self.pick("Плейлист удалён", "Playlist deleted") } pub const fn toast_history_cleared(self) -> &'static str { self.pick("История удалена", "History deleted") } pub fn toast_checking_updates(self) -> String { if self.is_ru() { format!("Проверка обновлений… (версия {})", APP_VERSION) } else { format!("Checking for updates… (version {})", APP_VERSION) } } pub fn toast_up_to_date(self) -> String { if self.is_ru() { format!("Установлена последняя версия {}", APP_VERSION) } else { format!("You are running the latest version ({})", APP_VERSION) } } pub fn toast_latest_version(self) -> String { self.toast_up_to_date() } pub fn toast_update_available(self, newer: &str) -> String { if self.is_ru() { format!( "Доступно обновление: {} (текущая {}) — нажмите снова, чтобы открыть", newer, APP_VERSION ) } else { format!( "Update available: {} (current {}) — click again to open", newer, APP_VERSION ) } } pub const fn toast_update_check_failed(self) -> &'static str { self.pick( "Не удалось проверить обновления", "Failed to check for updates", ) } pub const fn toast_signed_out(self) -> &'static str { self.pick("Вы вышли из аккаунта", "Signed out") } pub fn toast_welcome(self, name: &str) -> String { if self.is_ru() { format!("Добро пожаловать, {}!", name) } else { format!("Welcome, {}!", name) } } pub const fn toast_sign_in_required(self) -> &'static str { self.pick( "Войдите в аккаунт Яндекс ID, чтобы слушать треки", "Sign in with Yandex ID to play tracks", ) } pub const fn toast_vibe_updated(self) -> &'static str { self.pick("Настройки «Моей волны» обновлены", "My Vibe settings updated") } pub const fn toast_cover_cache_cleared(self) -> &'static str { self.pick("Память устройства очищена", "Device memory cleared") } pub const fn toast_action_error(self) -> &'static str { self.pick( "При выполнении действия произошла ошибка", "Something went wrong when performing the action", ) } pub fn toast_quality_changed(self, quality_label: &str) -> String { if self.is_ru() { format!("Включено {} качество звука", quality_label) } else { format!("{} sound quality on", quality_label) } } pub const fn toast_opening_oauth(self) -> &'static str { self.pick( "Открыто окно входа Яндекс ID…", "Opening Yandex ID sign-in window…", ) } pub const fn toast_signing_in(self) -> &'static str { self.pick("Вход в Яндекс Музыку…", "Signing in to Yandex Music…") } pub const fn toast_invalid_token(self) -> &'static str { self.pick("Не удалось распознать OAuth-токен", "Could not parse OAuth token") } }