diff --git a/Cargo.lock b/Cargo.lock index 52607dd..b4e2d5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -395,7 +395,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -415,7 +415,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "unicode-xid", ] @@ -611,7 +611,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1191,12 +1191,12 @@ dependencies = [ "scrypt", "serde", "serde_json", - "serde_yaml", "sha2", "sqlx", "subtle", "teloxide", "tokio", + "toml", "tracing", "tracing-subscriber", "trim-in-place", @@ -1263,7 +1263,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1692,7 +1692,7 @@ checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1707,6 +1707,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1741,19 +1750,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha1" version = "0.10.6" @@ -1932,7 +1928,7 @@ dependencies = [ "quote", "sqlx-core", "sqlx-macros-core", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -1955,7 +1951,7 @@ dependencies = [ "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", - "syn 2.0.74", + "syn 2.0.75", "tempfile", "tokio", "url", @@ -2100,9 +2096,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "f6af063034fc1935ede7be0122941bafa9bacb949334d090b77ca98b5817c7d9" dependencies = [ "proc-macro2", "quote", @@ -2247,7 +2243,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2277,9 +2273,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -2301,7 +2297,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2338,6 +2334,40 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.3" @@ -2364,7 +2394,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] @@ -2483,12 +2513,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -2583,7 +2607,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-shared", ] @@ -2617,7 +2641,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2837,6 +2861,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" @@ -2865,7 +2898,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.75", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 18d3041..53b3485 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ rand = { version = "0.8", default-features = false, features = [ scrypt = { version = "0.11", default-features = false, features = ["std"] } serde = { version = "1", features = ["derive"] } serde_json = "1" -serde_yaml = "0.9" sha2 = "0.10" sqlx = { version = "0.8", features = [ "mysql", @@ -61,6 +60,7 @@ tokio = { version = "1", features = [ "sync", "parking_lot", ] } +toml = "0.8" tracing = "0.1" tracing-subscriber = { version = "0.3", features = [ "parking_lot", diff --git a/locales/eng.toml b/locales/eng.toml new file mode 100644 index 0000000..6ce5955 --- /dev/null +++ b/locales/eng.toml @@ -0,0 +1,82 @@ +hide_button = "Hide" +change_name_button = "Change name" +change_login_button = "Change login" +change_password_button = "Change password" +delete_account_button = "Delete account" +couldnt_get_user_info_send_again = "Couldn't get user information. Send the message again" +unknown_command_use_help = "Unknown command. Use /help to get info on existing commands" +help_command = """ +These commands are supported: + +/start — displays the welcome message +/help — displays this text +/set_master_pass — sets the master password +/menu — gives you a menu to manage your accounts +/add_account — adds the account +/get_account — gets the account +/get_accounts — gets a list of accounts +/delete — deletes the account +/delete_all — deletes all the accounts and the master password +/export — exports all the accounts in a json file +/import — loads the accounts from a json file +/gen_password — generates 10 secure passwords +/cancel — cancels the current action +/change_language - allows you to change the language""" +no_file_send = "Expected you to send a file" +file_too_large = "File is larger that 200 MiB. Please split it into multiple files" +couldnt_get_file_name = "Couldn't get file name. Please try again" +following_accounts_have_problems = "Following accounts have problems:" +duplicate_names = "Duplicate names" +accounts_already_in_db = "Accounts with these names already exist in the database" +invalid_fields = "Accounts have invalid fields" +fix_that_and_send_again = "Fix those errors and send the file again" +error_downloading_file = "Error downloading the file" +error_getting_account_names = "Error getting existing account names" +error_parsing_json_file = "Error parsing the json file" +successfully_canceled = "Successfully canceled" +invalid_password = "The password is invalid. Change it and send it again" +couldnt_get_message_text = "Couldn't get the text of the message. Send the message again" +invalid_file_name = "Invalid file name. The program expected you to send a file with .json extension" +account_already_exists = "Account with that names already exists" +master_password_too_weak = "Master password is too weak" +no_lowercase = "It doesn't have any lowercase characters" +no_uppercase = "It doesn't have any uppercase characters" +no_numbers = "It doesn't have any numbers" +master_pass_too_short = "It is shorter than 8 characters" +change_master_password_and_send_again = "Change the master password and send it again" +wrong_master_password = "Wrong master password. Try again" +invalid_login = "Invalid login. Change it and send it again" +start_command = "Hi! This bot can be used to store the passwords securely. Use /help command to get the list of commands" +master_password_dont_match = "Master password didn't match. Use the command again" +success = "Success" +send_master_password_again = "Send the master password again" +master_password_is_set = "Master password has already been set" +send_new_master_password = "Send new master password" +no_accounts_found = "No accounts found" +choose_account = "Choose the account" +couldnt_create_following_accounts = "Couldn't create the following accounts" +send_master_password = "Send the master password" +something_went_wrong = "Something went wrong. Try again later" +nothing_to_cancel = "Nothing to cancel" +send_account_name = "Send account name" +send_login = "Send login" +error_deleting_message = "Error deleting the message" +account_not_found = "Account wasn't found" +send_new_name = "Send new name" +send_new_login = "Send new login" +send_new_password = "Send new password" +send_json_file = "Send the json file to import" +send_master_pass_to_delete_everything = "Send master password to delete EVERY ACCOUNT. THIS ACTION CANNOT BE UNDONE" +everything_was_deleted = "Every account was deleted" +send_password = "Send password" +send_master_pass_to_delete_account = "Send the master password to delete the account" +no_special_characters = "No special characters in the master password" +invalid_name = "Invalid name" +word_name = "Name" +word_login = "Login" +word_password = "Password" +decrypt_button = "Decrypt" +delete_message_button = "Delete message" +menu_button = "Back to the menu" +choose_language = "Choose the language" +master_password_is_not_set = "Master password is not set. Use /cancel to cancel the current action and /set_master_pass to set it" diff --git a/locales/eng.yaml b/locales/eng.yaml deleted file mode 100644 index c430e40..0000000 --- a/locales/eng.yaml +++ /dev/null @@ -1,82 +0,0 @@ -master_password_is_not_set: "Master password is not set. Use /cancel to cancel the current action and /set_master_pass to set it" -hide_button: "Hide" -change_name_button: "Change name" -change_login_button: "Change login" -change_password_button: "Change password" -delete_account_button: "Delete account" -couldnt_get_user_info_send_again: "Couldn't get user information. Send the message again" -unknown_command_use_help: "Unknown command. Use /help to get info on existing commands" -help_command: | - These commands are supported: - - /start — displays the welcome message - /help — displays this text - /set_master_pass — sets the master password - /menu — gives you a menu to manage your accounts - /add_account — adds the account - /get_account — gets the account - /get_accounts — gets a list of accounts - /delete — deletes the account - /delete_all — deletes all the accounts and the master password - /export — exports all the accounts in a json file - /import — loads the accounts from a json file - /gen_password — generates 10 secure passwords - /cancel — cancels the current action - /change_language - allows you to change the language -no_file_send: "Expected you to send a file" -file_too_large: "File is larger that 200 MiB. Please split it into multiple files" -couldnt_get_file_name: "Couldn't get file name. Please try again" -following_accounts_have_problems: "Following accounts have problems:" -duplicate_names: "Duplicate names" -accounts_already_in_db: "Accounts with these names already exist in the database" -invalid_fields: "Accounts have invalid fields" -fix_that_and_send_again: "Fix those errors and send the file again" -error_downloading_file: "Error downloading the file" -error_getting_account_names: "Error getting existing account names" -error_parsing_json_file: "Error parsing the json file" -successfully_canceled: "Successfully canceled" -invalid_password: "The password is invalid. Change it and send it again" -couldnt_get_message_text: "Couldn't get the text of the message. Send the message again" -invalid_file_name: "Invalid file name. The program expected you to send a file with .json extension" -account_already_exists: "Account with that names already exists" -master_password_too_weak: "Master password is too weak" -no_lowercase: "It doesn't have any lowercase characters" -no_uppercase: "It doesn't have any uppercase characters" -no_numbers: "It doesn't have any numbers" -master_pass_too_short: "It is shorter than 8 characters" -change_master_password_and_send_again: "Change the master password and send it again" -wrong_master_password: "Wrong master password. Try again" -invalid_login: "Invalid login. Change it and send it again" -start_command: "Hi! This bot can be used to store the passwords securely. Use /help command to get the list of commands" -master_password_dont_match: "Master password didn't match. Use the command again" -success: "Success" -send_master_password_again: "Send the master password again" -master_password_is_set: "Master password has already been set" -send_new_master_password: "Send new master password" -no_accounts_found: "No accounts found" -choose_account: "Choose the account" -couldnt_create_following_accounts: "Couldn't create the following accounts" -send_master_password: "Send the master password" -something_went_wrong: "Something went wrong. Try again later" -nothing_to_cancel: "Nothing to cancel" -send_account_name: "Send account name" -send_login: "Send login" -error_deleting_message: "Error deleting the message" -account_not_found: "Account wasn't found" -send_new_name: "Send new name" -send_new_login: "Send new login" -send_new_password: "Send new password" -send_json_file: "Send the json file to import" -send_master_pass_to_delete_everything: "Send master password to delete EVERY ACCOUNT. THIS ACTION CANNOT BE UNDONE" -everything_was_deleted: "Every account was deleted" -send_password: "Send password" -send_master_pass_to_delete_account: "Send the master password to delete the account" -no_special_characters: "No special characters in the master password" -invalid_name: "Invalid name" -word_name: "Name" -word_login: "Login" -word_password: "Password" -decrypt_button: "Decrypt" -delete_message_button: "Delete message" -menu_button: "Back to the menu" -choose_language: "Choose the language" diff --git a/locales/ru.toml b/locales/ru.toml new file mode 100644 index 0000000..a1fb614 --- /dev/null +++ b/locales/ru.toml @@ -0,0 +1,82 @@ +master_password_is_not_set = "Мастер-пароль не установлен. Используйте /cancel, чтобы отменить текущее действие, и /set_master_pass, чтобы установить его" +hide_button = "Скрыть" +change_name_button = "Изменить имя" +change_login_button = "Изменить логин" +change_password_button = "Изменить пароль" +delete_account_button = "Удалить аккаунт" +couldnt_get_user_info_send_again = "Не удалось получить информацию о пользователе. Отправьте сообщение еще раз" +unknown_command_use_help = "Неизвестная команда. Используйте /help, чтобы получить информацию о существующих командах" +help_command = """ + Поддерживаются следующие команды= + + /start — отображает приветственное сообщение + /help — отображает этот текст + /set_master_pass — устанавливает мастер-пароль + /menu — предоставляет меню для управления вашими аккаунтами + /add_account — добавляет аккаунт + /get_account — получает аккаунт + /get_accounts — получает список аккаунтов + /delete — удаляет аккаунт + /delete_all — удаляет все аккаунты и мастер-пароль + /export — экспортирует все аккаунты в файл json + /import — загружает аккаунты из файла json + /gen_password — генерирует 10 сложных паролей + /cancel — отменяет текущее действие + /change_language - позволяет изменить язык""" +no_file_send = "Ожидалось, что вы отправите файл" +file_too_large = "Файл больше 200 MiB. Пожалуйста, разделите его на несколько файлов" +couldnt_get_file_name = "Не удалось получить имя файла. Пожалуйста, попробуйте еще раз" +following_accounts_have_problems = "У следующих аккаунтов есть проблемы:" +duplicate_names = "Дублирующиеся названия" +accounts_already_in_db = "Аккаунты с такими названиями уже существуют в базе данных" +invalid_fields = "Аккаунты имеют недопустимые поля" +fix_that_and_send_again = "Исправьте эти ошибки и отправьте файл снова" +error_downloading_file = "Ошибка загрузки файла" +error_getting_account_names = "Ошибка получения существующих названий аккаунтов" +error_parsing_json_file = "Ошибка разбора файла json" +successfully_canceled = "Успешная отменена" +invalid_password = "Неверный пароль. Измените его и отправьте снова" +couldnt_get_message_text = "Не удалось получить текст сообщения. Отправьте сообщение еще раз" +invalid_file_name = "Недопустимое название файла. Программа ожидала, что вы отправите файл с расширением .json" +account_already_exists = "Аккаунт с таким названием уже существует" +master_password_too_weak = "Мастер-пароль слишком слабый" +no_lowercase = "Отсутствуют строчные буквы" +no_uppercase = "Отсутствуют заглавные буквы" +no_numbers = "Отсутствуют цифры" +master_pass_too_short = "Меньше 8 символов" +change_master_password_and_send_again = "Измените мастер-пароль и отправьте его снова" +wrong_master_password = "Неверный мастер-пароль. Попробуйте снова" +invalid_login = "Недопустимый логин. Измените его и отправьте снова" +start_command = "Привет! Этот бот предназначен для безопасного хранения паролей. Используйте команду /help, чтобы получить список команд" +master_password_dont_match = "Мастер-пароли не совпадают. Используйте команду снова" +success = "Успех" +send_master_password_again = "Отправьте мастер-пароль снова" +master_password_is_set = "Мастер-пароль уже установлен" +send_new_master_password = "Отправьте новый мастер-пароль" +no_accounts_found = "Аккаунты не найдены" +choose_account = "Выберите аккаунт" +couldnt_create_following_accounts = "Не удалось создать следующие аккаунты" +send_master_password = "Отправьте мастер-пароль" +something_went_wrong = "Что-то пошло не так. Попробуйте еще раз позже" +nothing_to_cancel = "Нечего отменять" +send_account_name = "Отправьте название аккаунта" +send_login = "Отправьте логин" +error_deleting_message = "Ошибка удаления сообщения" +account_not_found = "Аккаунт не найден" +send_new_name = "Отправьте новое название" +send_new_login = "Отправьте новый логин" +send_new_password = "Отправьте новый пароль" +send_json_file = "Отправьте файл json для импорта" +send_master_pass_to_delete_everything = "Отправьте мастер-пароль, чтобы удалить ВСЕ АККАУНТЫ. ЭТО ДЕЙСТВИЕ НЕЛЬЗЯ ОТМЕНИТЬ" +everything_was_deleted = "Все аккаунты были удалены" +send_password = "Отправьте пароль" +send_master_pass_to_delete_account = "Отправьте мастер-пароль, чтобы удалить аккаунт" +no_special_characters = "Нет специальных символов в мастер-пароле" +invalid_name = "Недопустимое название" +word_name = "Название" +word_login = "Логин" +word_password = "Пароль" +decrypt_button = "Дешифровать" +delete_message_button = "Удалить сообщение" +menu_button = "Назад в меню" +choose_language = "Выберете язык" diff --git a/locales/ru.yaml b/locales/ru.yaml deleted file mode 100644 index f4c779a..0000000 --- a/locales/ru.yaml +++ /dev/null @@ -1,82 +0,0 @@ -master_password_is_not_set: "Мастер-пароль не установлен. Используйте /cancel, чтобы отменить текущее действие, и /set_master_pass, чтобы установить его" -hide_button: "Скрыть" -change_name_button: "Изменить имя" -change_login_button: "Изменить логин" -change_password_button: "Изменить пароль" -delete_account_button: "Удалить аккаунт" -couldnt_get_user_info_send_again: "Не удалось получить информацию о пользователе. Отправьте сообщение еще раз" -unknown_command_use_help: "Неизвестная команда. Используйте /help, чтобы получить информацию о существующих командах" -help_command: | - Поддерживаются следующие команды: - - /start — отображает приветственное сообщение - /help — отображает этот текст - /set_master_pass — устанавливает мастер-пароль - /menu — предоставляет меню для управления вашими аккаунтами - /add_account — добавляет аккаунт - /get_account — получает аккаунт - /get_accounts — получает список аккаунтов - /delete — удаляет аккаунт - /delete_all — удаляет все аккаунты и мастер-пароль - /export — экспортирует все аккаунты в файл json - /import — загружает аккаунты из файла json - /gen_password — генерирует 10 сложных паролей - /cancel — отменяет текущее действие - /change_language - позволяет изменить язык -no_file_send: "Ожидалось, что вы отправите файл" -file_too_large: "Файл больше 200 MiB. Пожалуйста, разделите его на несколько файлов" -couldnt_get_file_name: "Не удалось получить имя файла. Пожалуйста, попробуйте еще раз" -following_accounts_have_problems: "У следующих аккаунтов есть проблемы:" -duplicate_names: "Дублирующиеся названия" -accounts_already_in_db: "Аккаунты с такими названиями уже существуют в базе данных" -invalid_fields: "Аккаунты имеют недопустимые поля" -fix_that_and_send_again: "Исправьте эти ошибки и отправьте файл снова" -error_downloading_file: "Ошибка загрузки файла" -error_getting_account_names: "Ошибка получения существующих названий аккаунтов" -error_parsing_json_file: "Ошибка разбора файла json" -successfully_canceled: "Успешная отменена" -invalid_password: "Неверный пароль. Измените его и отправьте снова" -couldnt_get_message_text: "Не удалось получить текст сообщения. Отправьте сообщение еще раз" -invalid_file_name: "Недопустимое название файла. Программа ожидала, что вы отправите файл с расширением .json" -account_already_exists: "Аккаунт с таким названием уже существует" -master_password_too_weak: "Мастер-пароль слишком слабый" -no_lowercase: "Отсутствуют строчные буквы" -no_uppercase: "Отсутствуют заглавные буквы" -no_numbers: "Отсутствуют цифры" -master_pass_too_short: "Меньше 8 символов" -change_master_password_and_send_again: "Измените мастер-пароль и отправьте его снова" -wrong_master_password: "Неверный мастер-пароль. Попробуйте снова" -invalid_login: "Недопустимый логин. Измените его и отправьте снова" -start_command: "Привет! Этот бот предназначен для безопасного хранения паролей. Используйте команду /help, чтобы получить список команд" -master_password_dont_match: "Мастер-пароли не совпадают. Используйте команду снова" -success: "Успех" -send_master_password_again: "Отправьте мастер-пароль снова" -master_password_is_set: "Мастер-пароль уже установлен" -send_new_master_password: "Отправьте новый мастер-пароль" -no_accounts_found: "Аккаунты не найдены" -choose_account: "Выберите аккаунт" -couldnt_create_following_accounts: "Не удалось создать следующие аккаунты" -send_master_password: "Отправьте мастер-пароль" -something_went_wrong: "Что-то пошло не так. Попробуйте еще раз позже" -nothing_to_cancel: "Нечего отменять" -send_account_name: "Отправьте название аккаунта" -send_login: "Отправьте логин" -error_deleting_message: "Ошибка удаления сообщения" -account_not_found: "Аккаунт не найден" -send_new_name: "Отправьте новое название" -send_new_login: "Отправьте новый логин" -send_new_password: "Отправьте новый пароль" -send_json_file: "Отправьте файл json для импорта" -send_master_pass_to_delete_everything: "Отправьте мастер-пароль, чтобы удалить ВСЕ АККАУНТЫ. ЭТО ДЕЙСТВИЕ НЕЛЬЗЯ ОТМЕНИТЬ" -everything_was_deleted: "Все аккаунты были удалены" -send_password: "Отправьте пароль" -send_master_pass_to_delete_account: "Отправьте мастер-пароль, чтобы удалить аккаунт" -no_special_characters: "Нет специальных символов в мастер-пароле" -invalid_name: "Недопустимое название" -word_name: "Название" -word_login: "Логин" -word_password: "Пароль" -decrypt_button: "Дешифровать" -delete_message_button: "Удалить сообщение" -menu_button: "Назад в меню" -choose_language: "Выберете язык" diff --git a/src/locales.rs b/src/locales.rs index e3087d2..d87531b 100644 --- a/src/locales.rs +++ b/src/locales.rs @@ -10,9 +10,9 @@ pub struct LocaleStore { impl LocaleStore { pub fn init() { - let ru = serde_yaml::from_slice(include_bytes!("../locales/ru.yaml")) + let ru = toml::from_str(include_str!("../locales/ru.toml")) .expect("Error parsing russian locale"); - let eng = serde_yaml::from_slice(include_bytes!("../locales/eng.yaml")) + let eng = toml::from_str(include_str!("../locales/eng.toml")) .expect("Error parsing english locale"); assert!(