From bf215ccf1339d8824adeaf329a137a3b628ce58a Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Thu, 28 Nov 2024 14:51:10 +0200 Subject: [PATCH 1/3] Optimize en translation file data structure --- build/locales/en/translations.json | 416 ++++++++++++++--------------- 1 file changed, 197 insertions(+), 219 deletions(-) diff --git a/build/locales/en/translations.json b/build/locales/en/translations.json index 2bb3f0a4..750f9202 100644 --- a/build/locales/en/translations.json +++ b/build/locales/en/translations.json @@ -1,224 +1,7 @@ { "common": { - "title": "Report", - "appInitError": { - "description": "Application initialization error", - "closeBtnText": "Close" - }, - "errorManager": { - "failedToGetDocsPath": { - "title": "The OS Documents directory has been misconfigured", - "message": "This indicates that your OS `Documents` directory has been misconfigured.\n\rPlease, set it to a valid location or reset it to the default" - }, - "errorModalDialog": { - "errBoxTitle": "Bug report", - "errBoxDescription": "A new GitHub issue will be opened", - "zenityBtn": "Report and Exit", - "confirmButtonText": "Report", - "cancelButtonText": "Cancel", - "title": "Should a bug report be submitted?" - } - }, - "nativeNotification": { - "defaulTitle": "Bitfinex Report", - "defaultBody": "Notification", - "sync": { - "completedBody": "Data sync completed successfully!", - "interruptedBody": "Data sync interrupted!", - "errorBody": "Data sync completed with an error!" - }, - "trxTaxReport": { - "completedBody": "Your tax report is ready!", - "errorBody": "An unexpected error occurred while generating the tax report!" - } - }, - "autoUpdater": { - "title": "Update", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel", - "loadingWindow": { - "description": "Updating..." - }, - "errorToast": { - "title": "Application update failed", - "inetIssueTitle": "Internet disconnected" - }, - "checkingForUpdateToast": { - "title": "Checking for update" - }, - "updateAvailableToast": { - "title": "An update to v{{version}} is available", - "description": "Starting download..." - }, - "updateNotAvailableToast": { - "title": "No updates available" - }, - "downloadProgressToast": { - "title": "Downloading..." - }, - "updateDownloadedToast": { - "title": "Update v{{version}} downloaded", - "description": "Should the app be updated right now?" - } - }, - "restoreDB": { - "modalDialog": { - "title": "Select DB backup file", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel" - }, - "messageModalDialog": { - "title": "DB restoring", - "message": "Suitable DB backup file has not been found", - "dbRestoredMessage": "DB has been restored", - "dbNotRestoredMessage": "DB has not been restored", - "confirmButtonText": "OK" - } - }, - "showDocs": { - "modalDialog": { - "title": "User manual", - "cancelButtonText": "Close" - } - }, - "printToPDF": { - "defaultTemplate": "No data", - "pagination": { - "page": "Page", - "from": "from" - } - }, - "changeReportsFolder": { - "modalDialog": { - "title": "Change reports folder", - "buttonLabel": "Select" - } - }, - "changeSyncFrequency": { - "title": "Change sync frequency", - "timeFormatModalDialog": { - "title": "Set time format", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel", - "inputOptions": { - "mins": "Mins", - "hours": "Hours", - "days": "Days" - } - }, - "timeModalDialog": { - "title": "Set sync frequency", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel" - } - }, - "enforceMacOSAppLocation": { - "appLocationModalDialog": { - "message": "Move to Applications folder?", - "detail": "{{productName}} must live in the Applications folder to be able to run correctly", - "confirmButtonText": "Move to Applications folder", - "cancelButtonText": "Quit {{productName}}" - }, - "loadingWindow": { - "description": "Moving the app..." - }, - "appRunningModalDialog": { - "message": "Another version of {{productName}} is currently running. Quit it, then launch this version of the app again", - "confirmButtonText": "OK" - } - }, - "showAboutModalDialog": { - "confirmButtonText": "OK", - "copyButtonText": "Copy", - "gitHubButtonText": "Open GitHub" - }, - "showMessageModalDialog": { - "confirmButtonText": "OK", - "cancelButtonText": "Cancel" - }, - "showErrorModalDialog": { - "confirmButtonText": "OK", - "enoentErrorMessage": "No such file or directory", - "eaccesErrorMessage": "Permission denied", - "invalidFilePathErrorMessage": "Invalid file path", - "invalidFileNameInArchErrorMessage": "Invalid file name in archive", - "dbImportingErrorMessage": "The database has not been imported", - "dbRemovingErrorMessage": "The database has not been removed", - "reportsFolderChangingErrorMessage": "The reports folder has not been changed", - "syncFrequencyChangingErrorMessage": "The sync frequency has not been changed", - "unexpectedExceptionMessage": "An unexpected exception occurred" - }, - "exportDB": { - "saveDialog": { - "title": "Database export", - "buttonLabel": "Export" - }, - "modalDialog": { - "confirmButtonText": "OK", - "title": "Database export", - "message": "Exported successfully" - }, - "loadingWindow": { - "description": "Exporting DB ...", - "archiveSize": "archive size {{prettyArchiveSize}}" - } - }, - "importDB": { - "openDialog": { - "title": "Database import", - "buttonLabel": "Import" - }, - "modalDialog": { - "title": "Database import" - }, - "loadingWindow": { - "description": "Importing DB ...", - "unzippedBytes": "DB size {{prettyUnzippedBytes}}" - } - }, - "removeDB": { - "modalDialog": { - "clearDataTitle": "Clear all data", - "removeDBTitle": "Remove database", - "clearDataMessage": "Are you sure you want to clear all data?", - "removeDBMessage": "Are you sure you want to remove the database?" - }, - "messageModalDialog": { - "dbRemovingTitle": "DB removing", - "dbDataHasBeenRemovedMessage": "DB data has been removed", - "dbDataHasNotBeenRemovedMessage": "DB data has not been removed", - "dbHasNotBeenRestoredTitle": "DB has not been restored", - "removeDBTitle": "Remove database", - "removeDBMessage": "Should all tables be removed?", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel" - }, - "loadingWindow": { - "removingDBDescription": "Removing DB ...", - "clearingAllDataDescription": "Clearing all data ..." - } - }, - "backupDB": { - "backupDBTitle": "DB backup", - "dbBackupHasCompletedMessage": "DB backup has completed successfully", - "dbBackupHasFailedMessage": "DB backup has failed", - "confirmButtonText": "OK" - }, - "migrationDB": { - "messageModalDialog": { - "dbMigrationHasFailedMessage": "DВ migration has failed", - "dbMigrationHasCompletedMessage": "DB migration has completed successfully", - "confirmButtonText": "OK", - "cancelButtonText": "Cancel" - }, - "actionRequestModalDialog": { - "title": "The migration has failed", - "message": "What should be done?", - "exitButtonText": "Exit", - "restoreDBButtonText": "Try to restore DB", - "removeDBButtonText": "Remove DB" - } - } + "confirmButtonText": "OK", + "cancelButtonText": "Cancel" }, "menu": { "macMainSubmenu": { @@ -270,5 +53,200 @@ "changelogLabel": "Changelog", "aboutLabel": "About {{appName}}" } + }, + "appInitError": { + "description": "Application initialization error", + "closeBtnText": "Close" + }, + "errorManager": { + "failedToGetDocsPath": { + "title": "The OS Documents directory has been misconfigured", + "message": "This indicates that your OS `Documents` directory has been misconfigured.\n\rPlease, set it to a valid location or reset it to the default" + }, + "errorModalDialog": { + "errBoxTitle": "Bug report", + "errBoxDescription": "A new GitHub issue will be opened", + "zenityBtn": "Report and Exit", + "confirmButtonText": "Report", + "title": "Should a bug report be submitted?" + } + }, + "nativeNotification": { + "defaulTitle": "Bitfinex Report", + "defaultBody": "Notification", + "sync": { + "completedBody": "Data sync completed successfully!", + "interruptedBody": "Data sync interrupted!", + "errorBody": "Data sync completed with an error!" + }, + "trxTaxReport": { + "completedBody": "Your tax report is ready!", + "errorBody": "An unexpected error occurred while generating the tax report!" + } + }, + "autoUpdater": { + "title": "Update", + "loadingWindow": { + "description": "Updating..." + }, + "errorToast": { + "title": "Application update failed", + "inetIssueTitle": "Internet disconnected" + }, + "checkingForUpdateToast": { + "title": "Checking for update" + }, + "updateAvailableToast": { + "title": "An update to v{{version}} is available", + "description": "Starting download..." + }, + "updateNotAvailableToast": { + "title": "No updates available" + }, + "downloadProgressToast": { + "title": "Downloading..." + }, + "updateDownloadedToast": { + "title": "Update v{{version}} downloaded", + "description": "Should the app be updated right now?" + } + }, + "restoreDB": { + "modalDialog": { + "title": "Select DB backup file" + }, + "messageModalDialog": { + "title": "DB restoring", + "message": "Suitable DB backup file has not been found", + "dbRestoredMessage": "DB has been restored", + "dbNotRestoredMessage": "DB has not been restored" + } + }, + "showDocs": { + "modalDialog": { + "title": "User manual", + "cancelButtonText": "Close" + } + }, + "printToPDF": { + "defaultTemplate": "No data", + "pagination": { + "page": "Page", + "from": "from" + } + }, + "changeReportsFolder": { + "modalDialog": { + "title": "Change reports folder", + "buttonLabel": "Select" + } + }, + "changeSyncFrequency": { + "title": "Change sync frequency", + "timeFormatModalDialog": { + "title": "Set time format", + "inputOptions": { + "mins": "Mins", + "hours": "Hours", + "days": "Days" + } + }, + "timeModalDialog": { + "title": "Set sync frequency" + } + }, + "enforceMacOSAppLocation": { + "appLocationModalDialog": { + "message": "Move to Applications folder?", + "detail": "{{productName}} must live in the Applications folder to be able to run correctly", + "confirmButtonText": "Move to Applications folder", + "cancelButtonText": "Quit {{productName}}" + }, + "loadingWindow": { + "description": "Moving the app..." + }, + "appRunningModalDialog": { + "message": "Another version of {{productName}} is currently running. Quit it, then launch this version of the app again" + } + }, + "showAboutModalDialog": { + "copyButtonText": "Copy", + "gitHubButtonText": "Open GitHub" + }, + "showErrorModalDialog": { + "enoentErrorMessage": "No such file or directory", + "eaccesErrorMessage": "Permission denied", + "invalidFilePathErrorMessage": "Invalid file path", + "invalidFileNameInArchErrorMessage": "Invalid file name in archive", + "dbImportingErrorMessage": "The database has not been imported", + "dbRemovingErrorMessage": "The database has not been removed", + "reportsFolderChangingErrorMessage": "The reports folder has not been changed", + "syncFrequencyChangingErrorMessage": "The sync frequency has not been changed", + "unexpectedExceptionMessage": "An unexpected exception occurred" + }, + "exportDB": { + "saveDialog": { + "title": "Database export", + "buttonLabel": "Export" + }, + "modalDialog": { + "title": "Database export", + "message": "Exported successfully" + }, + "loadingWindow": { + "description": "Exporting DB ...", + "archiveSize": "archive size {{prettyArchiveSize}}" + } + }, + "importDB": { + "openDialog": { + "title": "Database import", + "buttonLabel": "Import" + }, + "modalDialog": { + "title": "Database import" + }, + "loadingWindow": { + "description": "Importing DB ...", + "unzippedBytes": "DB size {{prettyUnzippedBytes}}" + } + }, + "removeDB": { + "modalDialog": { + "clearDataTitle": "Clear all data", + "removeDBTitle": "Remove database", + "clearDataMessage": "Are you sure you want to clear all data?", + "removeDBMessage": "Are you sure you want to remove the database?" + }, + "messageModalDialog": { + "dbRemovingTitle": "DB removing", + "dbDataHasBeenRemovedMessage": "DB data has been removed", + "dbDataHasNotBeenRemovedMessage": "DB data has not been removed", + "dbHasNotBeenRestoredTitle": "DB has not been restored", + "removeDBTitle": "Remove database", + "removeDBMessage": "Should all tables be removed?" + }, + "loadingWindow": { + "removingDBDescription": "Removing DB ...", + "clearingAllDataDescription": "Clearing all data ..." + } + }, + "backupDB": { + "backupDBTitle": "DB backup", + "dbBackupHasCompletedMessage": "DB backup has completed successfully", + "dbBackupHasFailedMessage": "DB backup has failed" + }, + "migrationDB": { + "messageModalDialog": { + "dbMigrationHasFailedMessage": "DВ migration has failed", + "dbMigrationHasCompletedMessage": "DB migration has completed successfully" + }, + "actionRequestModalDialog": { + "title": "The migration has failed", + "message": "What should be done?", + "exitButtonText": "Exit", + "restoreDBButtonText": "Try to restore DB", + "removeDBButtonText": "Remove DB" + } } } From 8d62fc24814163ea450e493421d69db9aa0e7838 Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Thu, 28 Nov 2024 14:51:25 +0200 Subject: [PATCH 2/3] Optimize ru translation file data structure --- build/locales/ru/translations.json | 416 ++++++++++++++--------------- 1 file changed, 197 insertions(+), 219 deletions(-) diff --git a/build/locales/ru/translations.json b/build/locales/ru/translations.json index 2193cd9f..c04a6679 100644 --- a/build/locales/ru/translations.json +++ b/build/locales/ru/translations.json @@ -1,224 +1,7 @@ { "common": { - "title": "Отчет", - "appInitError": { - "description": "Ошибка инициализации приложения", - "closeBtnText": "Закрыть" - }, - "errorManager": { - "failedToGetDocsPath": { - "title": "Каталог Документы ОС был неправильно настроен", - "message": "Это означает, что каталог `Документы` вашей ОС был неправильно настроен.\n\rПожалуйста, укажите правильное расположение или сбросьте его до значений по умолчанию" - }, - "errorModalDialog": { - "errBoxTitle": "Отчет об ошибке", - "errBoxDescription": "Будет открыта новая проблема в GitHub", - "zenityBtn": "Отправить Отчет и Выйти", - "confirmButtonText": "Отправить Отчет", - "cancelButtonText": "Отменить", - "title": "Должен ли быть отправлен отчет об ошибке?" - } - }, - "nativeNotification": { - "defaulTitle": "Bitfinex Report", - "defaultBody": "Уведомление", - "sync": { - "completedBody": "Синхронизация данных успешно завершена!", - "interruptedBody": "Синхронизация данных прервана!", - "errorBody": "Синхронизация данных завершена с ошибкой!" - }, - "trxTaxReport": { - "completedBody": "Ваш налоговый отчет готов!", - "errorBody": "При формировании налогового отчета произошла непредвиденная ошибка!" - } - }, - "autoUpdater": { - "title": "Обновление", - "confirmButtonText": "OK", - "cancelButtonText": "Отменить", - "loadingWindow": { - "description": "Обновление..." - }, - "errorToast": { - "title": "Обновление приложения не удалось", - "inetIssueTitle": "Интернет отключен" - }, - "checkingForUpdateToast": { - "title": "Проверка обновления" - }, - "updateAvailableToast": { - "title": "Доступно обновление до версии v{{version}}", - "description": "Начинаем загрузку..." - }, - "updateNotAvailableToast": { - "title": "Нет доступных обновлений" - }, - "downloadProgressToast": { - "title": "Загрузка..." - }, - "updateDownloadedToast": { - "title": "Обновление v{{version}} загружено", - "description": "Стоит ли обновить приложение прямо сейчас?" - } - }, - "restoreDB": { - "modalDialog": { - "title": "Выберите файл резервной копии БД", - "confirmButtonText": "OK", - "cancelButtonText": "Отменить" - }, - "messageModalDialog": { - "title": "Восстановление БД", - "message": "Подходящий файл резервной копии БД не найден", - "dbRestoredMessage": "БД была восстановлена", - "dbNotRestoredMessage": "БД не была восстановлена", - "confirmButtonText": "OK" - } - }, - "showDocs": { - "modalDialog": { - "title": "Руководство пользователя", - "cancelButtonText": "Закрыть" - } - }, - "printToPDF": { - "defaultTemplate": "Нет данных", - "pagination": { - "page": "Страница", - "from": "из" - } - }, - "changeReportsFolder": { - "modalDialog": { - "title": "Изменить папку отчетов", - "buttonLabel": "Выбрать" - } - }, - "changeSyncFrequency": { - "title": "Изменить частоту синхронизации", - "timeFormatModalDialog": { - "title": "Установить формат времени", - "confirmButtonText": "OK", - "cancelButtonText": "Отмена", - "inputOptions": { - "mins": "Мин.", - "hours": "Часы", - "days": "Дни" - } - }, - "timeModalDialog": { - "title": "Установить частоту синхронизации", - "confirmButtonText": "OK", - "cancelButtonText": "Отмена" - } - }, - "enforceMacOSAppLocation": { - "appLocationModalDialog": { - "message": "Переместить в папку Приложения?", - "detail": "{{productName}} должен находиться в папке Приложения для корректной работы", - "confirmButtonText": "Переместить в папку Приложения", - "cancelButtonText": "Выйти из {{productName}}" - }, - "loadingWindow": { - "description": "Перемещение приложения..." - }, - "appRunningModalDialog": { - "message": "В настоящее время запущена другая версия {{productName}}. Закройте ее, затем снова запустите эту версию приложения", - "confirmButtonText": "OK" - } - }, - "showAboutModalDialog": { - "confirmButtonText": "OK", - "copyButtonText": "Копировать", - "gitHubButtonText": "Открыть GitHub" - }, - "showMessageModalDialog": { - "confirmButtonText": "OK", - "cancelButtonText": "Отмена" - }, - "showErrorModalDialog": { - "confirmButtonText": "OK", - "enoentErrorMessage": "Данный файл или каталог отсутствует", - "eaccesErrorMessage": "Доступ запрещен", - "invalidFilePathErrorMessage": "Неверный путь к файлу", - "invalidFileNameInArchErrorMessage": "Неверное имя файла в архиве", - "dbImportingErrorMessage": "База данных не была импортирована", - "dbRemovingErrorMessage": "База данных не была удалена", - "reportsFolderChangingErrorMessage": "Папка отчетов не была изменена", - "syncFrequencyChangingErrorMessage": "Частота синхронизации не была изменена", - "unexpectedExceptionMessage": "Произошло неожиданное исключение" - }, - "exportDB": { - "saveDialog": { - "title": "Экспорт базы данных", - "buttonLabel": "Экспортировать" - }, - "modalDialog": { - "confirmButtonText": "OK", - "title": "Экспорт базы данных", - "message": "Экспортирована успешно" - }, - "loadingWindow": { - "description": "Экспортирование БД ...", - "archiveSize": "размер архива {{prettyArchiveSize}}" - } - }, - "importDB": { - "openDialog": { - "title": "Импорт базы данных", - "buttonLabel": "Импортировать" - }, - "modalDialog": { - "title": "Импорт базы данных" - }, - "loadingWindow": { - "description": "Импортирование БД ...", - "unzippedBytes": "размер БД {{prettyUnzippedBytes}}" - } - }, - "removeDB": { - "modalDialog": { - "clearDataTitle": "Очистить все данные", - "removeDBTitle": "Удалить базу данных", - "clearDataMessage": "Вы уверены, что хотите удалить все данные?", - "removeDBMessage": "Вы уверены, что хотите удалить базу данных?" - }, - "messageModalDialog": { - "dbRemovingTitle": "Удаление БД", - "dbDataHasBeenRemovedMessage": "Данные БД были удалены", - "dbDataHasNotBeenRemovedMessage": "Данные БД не были удалены", - "dbHasNotBeenRestoredTitle": "БД не восстановлена", - "removeDBTitle": "Удалить базу данных", - "removeDBMessage": "Следует ли удалить все таблицы?", - "confirmButtonText": "OK", - "cancelButtonText": "Отмена" - }, - "loadingWindow": { - "removingDBDescription": "Удаление БД ...", - "clearingAllDataDescription": "Очистка всех данные ..." - } - }, - "backupDB": { - "backupDBTitle": "Резервное копирование БД", - "dbBackupHasCompletedMessage": "Резервное копирование БД успешно завершено", - "dbBackupHasFailedMessage": "Резервное копирование БД не удалось", - "confirmButtonText": "OK" - }, - "migrationDB": { - "messageModalDialog": { - "dbMigrationHasFailedMessage": "Миграция БД не удалась", - "dbMigrationHasCompletedMessage": "Миграция БД успешно завершена", - "confirmButtonText": "OK", - "cancelButtonText": "Отмена" - }, - "actionRequestModalDialog": { - "title": "Миграция не удалась", - "message": "Что следует сделать?", - "exitButtonText": "Выход", - "restoreDBButtonText": "Попробовать восстановить БД", - "removeDBButtonText": "Удалить БД" - } - } + "confirmButtonText": "OK", + "cancelButtonText": "Отмена" }, "menu": { "macMainSubmenu": { @@ -270,5 +53,200 @@ "changelogLabel": "Журнал Изменений", "aboutLabel": "О {{appName}}" } + }, + "appInitError": { + "description": "Ошибка инициализации приложения", + "closeBtnText": "Закрыть" + }, + "errorManager": { + "failedToGetDocsPath": { + "title": "Каталог Документы ОС был неправильно настроен", + "message": "Это означает, что каталог `Документы` вашей ОС был неправильно настроен.\n\rПожалуйста, укажите правильное расположение или сбросьте его до значений по умолчанию" + }, + "errorModalDialog": { + "errBoxTitle": "Отчет об ошибке", + "errBoxDescription": "Будет открыта новая проблема в GitHub", + "zenityBtn": "Отправить Отчет и Выйти", + "confirmButtonText": "Отправить Отчет", + "title": "Должен ли быть отправлен отчет об ошибке?" + } + }, + "nativeNotification": { + "defaulTitle": "Bitfinex Report", + "defaultBody": "Уведомление", + "sync": { + "completedBody": "Синхронизация данных успешно завершена!", + "interruptedBody": "Синхронизация данных прервана!", + "errorBody": "Синхронизация данных завершена с ошибкой!" + }, + "trxTaxReport": { + "completedBody": "Ваш налоговый отчет готов!", + "errorBody": "При формировании налогового отчета произошла непредвиденная ошибка!" + } + }, + "autoUpdater": { + "title": "Обновление", + "loadingWindow": { + "description": "Обновление..." + }, + "errorToast": { + "title": "Обновление приложения не удалось", + "inetIssueTitle": "Интернет отключен" + }, + "checkingForUpdateToast": { + "title": "Проверка обновления" + }, + "updateAvailableToast": { + "title": "Доступно обновление до версии v{{version}}", + "description": "Начинаем загрузку..." + }, + "updateNotAvailableToast": { + "title": "Нет доступных обновлений" + }, + "downloadProgressToast": { + "title": "Загрузка..." + }, + "updateDownloadedToast": { + "title": "Обновление v{{version}} загружено", + "description": "Стоит ли обновить приложение прямо сейчас?" + } + }, + "restoreDB": { + "modalDialog": { + "title": "Выберите файл резервной копии БД" + }, + "messageModalDialog": { + "title": "Восстановление БД", + "message": "Подходящий файл резервной копии БД не найден", + "dbRestoredMessage": "БД была восстановлена", + "dbNotRestoredMessage": "БД не была восстановлена" + } + }, + "showDocs": { + "modalDialog": { + "title": "Руководство пользователя", + "cancelButtonText": "Закрыть" + } + }, + "printToPDF": { + "defaultTemplate": "Нет данных", + "pagination": { + "page": "Страница", + "from": "из" + } + }, + "changeReportsFolder": { + "modalDialog": { + "title": "Изменить папку отчетов", + "buttonLabel": "Выбрать" + } + }, + "changeSyncFrequency": { + "title": "Изменить частоту синхронизации", + "timeFormatModalDialog": { + "title": "Установить формат времени", + "inputOptions": { + "mins": "Мин.", + "hours": "Часы", + "days": "Дни" + } + }, + "timeModalDialog": { + "title": "Установить частоту синхронизации" + } + }, + "enforceMacOSAppLocation": { + "appLocationModalDialog": { + "message": "Переместить в папку Приложения?", + "detail": "{{productName}} должен находиться в папке Приложения для корректной работы", + "confirmButtonText": "Переместить в папку Приложения", + "cancelButtonText": "Выйти из {{productName}}" + }, + "loadingWindow": { + "description": "Перемещение приложения..." + }, + "appRunningModalDialog": { + "message": "В настоящее время запущена другая версия {{productName}}. Закройте ее, затем снова запустите эту версию приложения" + } + }, + "showAboutModalDialog": { + "copyButtonText": "Копировать", + "gitHubButtonText": "Открыть GitHub" + }, + "showErrorModalDialog": { + "enoentErrorMessage": "Данный файл или каталог отсутствует", + "eaccesErrorMessage": "Доступ запрещен", + "invalidFilePathErrorMessage": "Неверный путь к файлу", + "invalidFileNameInArchErrorMessage": "Неверное имя файла в архиве", + "dbImportingErrorMessage": "База данных не была импортирована", + "dbRemovingErrorMessage": "База данных не была удалена", + "reportsFolderChangingErrorMessage": "Папка отчетов не была изменена", + "syncFrequencyChangingErrorMessage": "Частота синхронизации не была изменена", + "unexpectedExceptionMessage": "Произошло неожиданное исключение" + }, + "exportDB": { + "saveDialog": { + "title": "Экспорт базы данных", + "buttonLabel": "Экспортировать" + }, + "modalDialog": { + "title": "Экспорт базы данных", + "message": "Экспортирована успешно" + }, + "loadingWindow": { + "description": "Экспортирование БД ...", + "archiveSize": "размер архива {{prettyArchiveSize}}" + } + }, + "importDB": { + "openDialog": { + "title": "Импорт базы данных", + "buttonLabel": "Импортировать" + }, + "modalDialog": { + "title": "Импорт базы данных" + }, + "loadingWindow": { + "description": "Импортирование БД ...", + "unzippedBytes": "размер БД {{prettyUnzippedBytes}}" + } + }, + "removeDB": { + "modalDialog": { + "clearDataTitle": "Очистить все данные", + "removeDBTitle": "Удалить базу данных", + "clearDataMessage": "Вы уверены, что хотите удалить все данные?", + "removeDBMessage": "Вы уверены, что хотите удалить базу данных?" + }, + "messageModalDialog": { + "dbRemovingTitle": "Удаление БД", + "dbDataHasBeenRemovedMessage": "Данные БД были удалены", + "dbDataHasNotBeenRemovedMessage": "Данные БД не были удалены", + "dbHasNotBeenRestoredTitle": "БД не восстановлена", + "removeDBTitle": "Удалить базу данных", + "removeDBMessage": "Следует ли удалить все таблицы?" + }, + "loadingWindow": { + "removingDBDescription": "Удаление БД ...", + "clearingAllDataDescription": "Очистка всех данные ..." + } + }, + "backupDB": { + "backupDBTitle": "Резервное копирование БД", + "dbBackupHasCompletedMessage": "Резервное копирование БД успешно завершено", + "dbBackupHasFailedMessage": "Резервное копирование БД не удалось" + }, + "migrationDB": { + "messageModalDialog": { + "dbMigrationHasFailedMessage": "Миграция БД не удалась", + "dbMigrationHasCompletedMessage": "Миграция БД успешно завершена" + }, + "actionRequestModalDialog": { + "title": "Миграция не удалась", + "message": "Что следует сделать?", + "exitButtonText": "Выход", + "restoreDBButtonText": "Попробовать восстановить БД", + "removeDBButtonText": "Удалить БД" + } } } From 2e6eacf10c7fc3d5fe737dea44e7bb27f7e6d263 Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Thu, 28 Nov 2024 14:51:51 +0200 Subject: [PATCH 3/3] Change translation file data structure usage --- src/auto-updater/index.js | 26 +++++----- src/change-reports-folder.js | 6 +-- src/change-sync-frequency.js | 20 +++---- src/enforce-macos-app-location.js | 14 ++--- src/error-manager/get-error-description.js | 4 +- src/error-manager/index.js | 4 +- src/error-manager/show-modal-dialog.js | 12 ++--- src/export-db.js | 18 +++---- src/import-db.js | 12 ++--- src/manage-worker-messages.js | 52 +++++++++---------- src/print-to-pdf/index.js | 4 +- src/remove-db.js | 12 ++--- src/restore-db/index.js | 12 ++--- src/show-about-modal-dialog.js | 6 +-- src/show-docs/index.js | 4 +- src/show-error-modal-dialog.js | 20 +++---- src/show-message-modal-dialog.js | 4 +- src/show-notification/index.js | 4 +- .../show-sync-notification.js | 6 +-- .../show-trx-tax-report-notification.js | 4 +- .../layouts/app-init-error.html | 4 +- 21 files changed, 124 insertions(+), 124 deletions(-) diff --git a/src/auto-updater/index.js b/src/auto-updater/index.js index 9d407abc..da768b15 100644 --- a/src/auto-updater/index.js +++ b/src/auto-updater/index.js @@ -141,11 +141,11 @@ const _fireToast = ( backdrop: 'rgba(0,0,0,0.0)', icon: 'info', - title: i18next.t('common.autoUpdater.title'), + title: i18next.t('autoUpdater.title'), showConfirmButton: true, showCancelButton: false, - confirmButtonText: i18next.t('common.autoUpdater.confirmButtonText'), - cancelButtonText: i18next.t('common.autoUpdater.cancelButtonText'), + confirmButtonText: i18next.t('common.confirmButtonText'), + cancelButtonText: i18next.t('common.cancelButtonText'), timerProgressBar: false, ...opts, @@ -268,7 +268,7 @@ const _autoUpdaterFactory = () => { autoUpdater.addInstallingUpdateEventHandler(() => { return showLoadingWindow({ - description: i18next.t('common.autoUpdater.loadingWindow.description'), + description: i18next.t('autoUpdater.loadingWindow.description'), isRequiredToCloseAllWins: true }) }) @@ -318,7 +318,7 @@ const _autoUpdaterFactory = () => { /ERR_INTERNET_DISCONNECTED/gi.test(err.toString()) ) { await _fireToast({ - title: i18next.t('common.autoUpdater.errorToast.inetIssueTitle'), + title: i18next.t('autoUpdater.errorToast.inetIssueTitle'), icon: 'error', timer: 60000 }) @@ -327,7 +327,7 @@ const _autoUpdaterFactory = () => { } await _fireToast({ - title: i18next.t('common.autoUpdater.errorToast.title'), + title: i18next.t('autoUpdater.errorToast.title'), icon: 'error', timer: 60000 }) @@ -343,7 +343,7 @@ const _autoUpdaterFactory = () => { await _fireToast( { - title: i18next.t('common.autoUpdater.checkingForUpdateToast.title'), + title: i18next.t('autoUpdater.checkingForUpdateToast.title'), type: 'warning', timer: 10000 }, @@ -364,10 +364,10 @@ const _autoUpdaterFactory = () => { const { value, dismiss } = await _fireToast( { title: i18next.t( - 'common.autoUpdater.updateAvailableToast.title', + 'autoUpdater.updateAvailableToast.title', { version } ), - text: i18next.t('common.autoUpdater.updateAvailableToast.description'), + text: i18next.t('autoUpdater.updateAvailableToast.description'), icon: 'info', timer: 10000 } @@ -402,7 +402,7 @@ const _autoUpdaterFactory = () => { await _fireToast( { - title: i18next.t('common.autoUpdater.updateNotAvailableToast.title'), + title: i18next.t('autoUpdater.updateNotAvailableToast.title'), icon: 'success', timer: 10000 } @@ -425,7 +425,7 @@ const _autoUpdaterFactory = () => { await _fireToast( { - title: i18next.t('common.autoUpdater.downloadProgressToast.title'), + title: i18next.t('autoUpdater.downloadProgressToast.title'), icon: 'info' }, { @@ -458,10 +458,10 @@ const _autoUpdaterFactory = () => { const { value } = await _fireToast( { title: i18next.t( - 'common.autoUpdater.updateDownloadedToast.title', + 'autoUpdater.updateDownloadedToast.title', { version } ), - text: i18next.t('common.autoUpdater.updateDownloadedToast.description'), + text: i18next.t('autoUpdater.updateDownloadedToast.description'), icon: 'question', timer: 60000, showCancelButton: true diff --git a/src/change-reports-folder.js b/src/change-reports-folder.js index 7cd937e7..385df935 100644 --- a/src/change-reports-folder.js +++ b/src/change-reports-folder.js @@ -29,9 +29,9 @@ module.exports = ({ pathToUserDocuments }) => { } = await dialog.showOpenDialog( win, { - title: i18next.t('common.changeReportsFolder.modalDialog.title'), + title: i18next.t('changeReportsFolder.modalDialog.title'), defaultPath: pathToUserDocuments, - buttonLabel: i18next.t('common.changeReportsFolder.modalDialog.buttonLabel'), + buttonLabel: i18next.t('changeReportsFolder.modalDialog.buttonLabel'), properties: [ 'openDirectory', 'createDirectory', @@ -70,7 +70,7 @@ module.exports = ({ pathToUserDocuments }) => { try { await showErrorModalDialog( win, - i18next.t('common.changeReportsFolder.modalDialog.title'), + i18next.t('changeReportsFolder.modalDialog.title'), err ) } catch (err) { diff --git a/src/change-sync-frequency.js b/src/change-sync-frequency.js index 6efd196b..ef0bf9b2 100644 --- a/src/change-sync-frequency.js +++ b/src/change-sync-frequency.js @@ -130,7 +130,7 @@ module.exports = () => { } const timeFormatAlertOptions = { - title: i18next.t('common.changeSyncFrequency.timeFormatModalDialog.title'), + title: i18next.t('changeSyncFrequency.timeFormatModalDialog.title'), icon: 'question', customClass: getAlertCustomClassObj({ title: 'titleColor', @@ -140,20 +140,20 @@ module.exports = () => { focusConfirm: true, showCancelButton: true, confirmButtonText: i18next - .t('common.changeSyncFrequency.timeFormatModalDialog.confirmButtonText'), + .t('common.confirmButtonText'), cancelButtonText: i18next - .t('common.changeSyncFrequency.timeFormatModalDialog.cancelButtonText'), + .t('common.cancelButtonText'), progressSteps: [1, 2], currentProgressStep: 0, input: 'radio', inputValue: 'hours', inputOptions: { mins: i18next - .t('common.changeSyncFrequency.timeFormatModalDialog.inputOptions.mins'), + .t('changeSyncFrequency.timeFormatModalDialog.inputOptions.mins'), hours: i18next - .t('common.changeSyncFrequency.timeFormatModalDialog.inputOptions.hours'), + .t('changeSyncFrequency.timeFormatModalDialog.inputOptions.hours'), days: i18next - .t('common.changeSyncFrequency.timeFormatModalDialog.inputOptions.days') + .t('changeSyncFrequency.timeFormatModalDialog.inputOptions.days') }, willOpen: () => { if (!timeFormatAlert.browserWindow) return @@ -162,7 +162,7 @@ module.exports = () => { } } const alertOptions = { - title: i18next.t('common.changeSyncFrequency.timeModalDialog.title'), + title: i18next.t('changeSyncFrequency.timeModalDialog.title'), icon: 'question', customClass: getAlertCustomClassObj({ title: 'titleColor', @@ -172,9 +172,9 @@ module.exports = () => { focusConfirm: true, showCancelButton: true, confirmButtonText: i18next - .t('common.changeSyncFrequency.timeModalDialog.confirmButtonText'), + .t('common.confirmButtonText'), cancelButtonText: i18next - .t('common.changeSyncFrequency.timeModalDialog.cancelButtonText'), + .t('common.cancelButtonText'), progressSteps: [1, 2], currentProgressStep: 1, input: 'range', @@ -295,7 +295,7 @@ module.exports = () => { try { await showErrorModalDialog( win, - i18next.t('common.changeSyncFrequency.title'), + i18next.t('changeSyncFrequency.title'), err ) } catch (err) { diff --git a/src/enforce-macos-app-location.js b/src/enforce-macos-app-location.js index bd9b0996..7c83ce37 100644 --- a/src/enforce-macos-app-location.js +++ b/src/enforce-macos-app-location.js @@ -24,15 +24,15 @@ module.exports = async () => { const clickedButtonIndex = dialog.showMessageBoxSync({ type: 'error', message: i18next - .t('common.enforceMacOSAppLocation.appLocationModalDialog.message'), + .t('enforceMacOSAppLocation.appLocationModalDialog.message'), detail: i18next.t( - 'common.enforceMacOSAppLocation.appLocationModalDialog.detail', + 'enforceMacOSAppLocation.appLocationModalDialog.detail', { productName } ), buttons: [ - i18next.t('common.enforceMacOSAppLocation.appLocationModalDialog.confirmButtonText'), + i18next.t('enforceMacOSAppLocation.appLocationModalDialog.confirmButtonText'), i18next.t( - 'common.enforceMacOSAppLocation.appLocationModalDialog.cancelButtonText', + 'enforceMacOSAppLocation.appLocationModalDialog.cancelButtonText', { productName } ) ], @@ -48,7 +48,7 @@ module.exports = async () => { await showLoadingWindow({ description: i18next - .t('common.enforceMacOSAppLocation.loadingWindow.description'), + .t('enforceMacOSAppLocation.loadingWindow.description'), isRequiredToCloseAllWins: true, isIndeterminateMode: true }) @@ -59,11 +59,11 @@ module.exports = async () => { dialog.showMessageBoxSync({ type: 'error', message: i18next.t( - 'common.enforceMacOSAppLocation.appRunningModalDialog.message', + 'enforceMacOSAppLocation.appRunningModalDialog.message', { productName } ), buttons: [ - i18next.t('common.enforceMacOSAppLocation.appRunningModalDialog.confirmButtonText') + i18next.t('common.confirmButtonText') ] }) diff --git a/src/error-manager/get-error-description.js b/src/error-manager/get-error-description.js index f1c650c8..6693cc6e 100644 --- a/src/error-manager/get-error-description.js +++ b/src/error-manager/get-error-description.js @@ -9,8 +9,8 @@ module.exports = (params) => { const title = '[BUG REPORT]' const description = 'Bug report' - const errBoxTitle = i18next.t('common.errorManager.errorModalDialog.errBoxTitle') - const errBoxDescription = i18next.t('common.errorManager.errorModalDialog.errBoxDescription') + const errBoxTitle = i18next.t('errorManager.errorModalDialog.errBoxTitle') + const errBoxDescription = i18next.t('errorManager.errorModalDialog.errBoxDescription') if ( error && diff --git a/src/error-manager/index.js b/src/error-manager/index.js index 2d1a665f..38ada6a9 100644 --- a/src/error-manager/index.js +++ b/src/error-manager/index.js @@ -216,8 +216,8 @@ const initLogger = () => { const error = message.data.join(os.EOL) if (/Failed to get 'documents' path/gi.test(error)) { - const title = i18next.t('common.errorManager.failedToGetDocsPath.title') - const msg = i18next.t('common.errorManager.failedToGetDocsPath.message') + const title = i18next.t('errorManager.failedToGetDocsPath.title') + const msg = i18next.t('errorManager.failedToGetDocsPath.message') showModalDialog({ errBoxTitle: title, diff --git a/src/error-manager/show-modal-dialog.js b/src/error-manager/show-modal-dialog.js index 7c7f6f27..7183f7bf 100644 --- a/src/error-manager/show-modal-dialog.js +++ b/src/error-manager/show-modal-dialog.js @@ -54,7 +54,7 @@ const converter = new Converter({ const _fireAlert = (params) => { const { - title = i18next.t('common.errorManager.errorModalDialog.title'), + title = i18next.t('errorManager.errorModalDialog.title'), html = '', parentWin, hasNoParentWin @@ -112,9 +112,9 @@ const _fireAlert = (params) => { icon: 'question', focusConfirm: true, showConfirmButton: true, - confirmButtonText: i18next.t('common.errorManager.errorModalDialog.confirmButtonText'), + confirmButtonText: i18next.t('errorManager.errorModalDialog.confirmButtonText'), showCancelButton: true, - cancelButtonText: i18next.t('common.errorManager.errorModalDialog.cancelButtonText'), + cancelButtonText: i18next.t('common.cancelButtonText'), timerProgressBar: false, ...params, @@ -177,18 +177,18 @@ module.exports = async (params) => { * before the translation init */ errBoxTitle = i18next.t( - 'common.errorManager.errorModalDialog.errBoxTitle', + 'errorManager.errorModalDialog.errBoxTitle', 'Bug report' ), errBoxDescription = i18next.t( - 'common.errorManager.errorModalDialog.errBoxDescription', + 'errorManager.errorModalDialog.errBoxDescription', 'A new GitHub issue will be opened' ), mdIssue, alertOpts = {} } = params ?? {} const zenityBtn = i18next.t( - 'common.errorManager.errorModalDialog.zenityBtn', + 'errorManager.errorModalDialog.zenityBtn', 'Report and Exit' ) diff --git a/src/export-db.js b/src/export-db.js index 5cbbfc43..572a2ffa 100644 --- a/src/export-db.js +++ b/src/export-db.js @@ -50,10 +50,10 @@ module.exports = ({ } = await dialog.showSaveDialog( win, { - title: i18next.t('common.exportDB.saveDialog.title'), + title: i18next.t('exportDB.saveDialog.title'), defaultPath, buttonLabel: i18next - .t('common.exportDB.saveDialog.buttonLabel'), + .t('exportDB.saveDialog.buttonLabel'), filters: [{ name: 'ZIP', extensions: ['zip'] }] } ) @@ -70,7 +70,7 @@ module.exports = ({ await showLoadingWindow({ description: i18next - .t('common.exportDB.loadingWindow.description') + .t('exportDB.loadingWindow.description') }) const progressHandler = async (args) => { @@ -79,9 +79,9 @@ module.exports = ({ prettyArchiveSize } = args ?? {} - const _description = i18next.t('common.exportDB.loadingWindow.description') + const _description = i18next.t('exportDB.loadingWindow.description') const _archived = i18next.t( - 'common.exportDB.loadingWindow.archiveSize', + 'exportDB.loadingWindow.archiveSize', { prettyArchiveSize } ) @@ -103,18 +103,18 @@ module.exports = ({ await showMessageModalDialog(win, { buttons: [ - i18next.t('common.exportDB.modalDialog.confirmButtonText') + i18next.t('common.confirmButtonText') ], defaultId: 0, - title: i18next.t('common.exportDB.modalDialog.title'), - message: i18next.t('common.exportDB.modalDialog.message') + title: i18next.t('exportDB.modalDialog.title'), + message: i18next.t('exportDB.modalDialog.message') }) } catch (err) { try { await hideLoadingWindow() await showErrorModalDialog( win, - i18next.t('common.exportDB.modalDialog.title'), + i18next.t('exportDB.modalDialog.title'), err ) } catch (err) { diff --git a/src/import-db.js b/src/import-db.js index a940a2f0..2ad6f92a 100644 --- a/src/import-db.js +++ b/src/import-db.js @@ -55,10 +55,10 @@ module.exports = ({ } = await dialog.showOpenDialog( win, { - title: i18next.t('common.importDB.openDialog.title'), + title: i18next.t('importDB.openDialog.title'), defaultPath: pathToUserDocuments, buttonLabel: i18next - .t('common.importDB.openDialog.buttonLabel'), + .t('importDB.openDialog.buttonLabel'), properties: [ 'openFile', 'createDirectory', @@ -88,9 +88,9 @@ module.exports = ({ } = args ?? {} const _description = i18next - .t('common.importDB.loadingWindow.description') + .t('importDB.loadingWindow.description') const _unzipped = i18next.t( - 'common.importDB.loadingWindow.unzippedBytes', + 'importDB.loadingWindow.unzippedBytes', { prettyUnzippedBytes } ) @@ -105,7 +105,7 @@ module.exports = ({ await pauseApp({ loadingWinParams: { description: i18next - .t('common.importDB.loadingWindow.description') + .t('importDB.loadingWindow.description') } }) await _rmDbExcludeMain(pathToUserData, DB_FILE_NAME) @@ -135,7 +135,7 @@ module.exports = ({ : win await showErrorModalDialog( _win, - i18next.t('common.importDB.modalDialog.title'), + i18next.t('importDB.modalDialog.title'), err ) } catch (err) { diff --git a/src/manage-worker-messages.js b/src/manage-worker-messages.js index 58543f98..e42a497a 100644 --- a/src/manage-worker-messages.js +++ b/src/manage-worker-messages.js @@ -94,11 +94,11 @@ module.exports = (ipc) => { await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type, - title: i18next.t('common.restoreDB.messageModalDialog.title'), + title: i18next.t('restoreDB.messageModalDialog.title'), message: hasNotDbBeenRestored - ? i18next.t('common.restoreDB.messageModalDialog.dbNotRestoredMessage') - : i18next.t('common.restoreDB.messageModalDialog.dbRestoredMessage'), - buttons: [i18next.t('common.restoreDB.messageModalDialog.confirmButtonText')], + ? i18next.t('restoreDB.messageModalDialog.dbNotRestoredMessage') + : i18next.t('restoreDB.messageModalDialog.dbRestoredMessage'), + buttons: [i18next.t('common.confirmButtonText')], defaultId: 0, cancelId: 0, shouldParentWindowBeShown: true @@ -117,18 +117,18 @@ module.exports = (ipc) => { ) { const haveNotAllDbDataBeenRemoved = state === PROCESS_MESSAGES.ALL_TABLE_HAVE_NOT_BEEN_REMOVED const message = haveNotAllDbDataBeenRemoved - ? i18next.t('common.removeDB.messageModalDialog.dbDataHasNotBeenRemovedMessage') - : i18next.t('common.removeDB.messageModalDialog.dbDataHasBeenRemovedMessage') + ? i18next.t('removeDB.messageModalDialog.dbDataHasNotBeenRemovedMessage') + : i18next.t('removeDB.messageModalDialog.dbDataHasBeenRemovedMessage') const type = haveNotAllDbDataBeenRemoved ? 'error' : 'info' await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type, - title: i18next.t('common.removeDB.messageModalDialog.dbRemovingTitle'), + title: i18next.t('removeDB.messageModalDialog.dbRemovingTitle'), message, buttons: [ - i18next.t('common.removeDB.messageModalDialog.confirmButtonText') + i18next.t('common.confirmButtonText') ], defaultId: 0, cancelId: 0, @@ -143,18 +143,18 @@ module.exports = (ipc) => { ) { const isBackupError = state === PROCESS_MESSAGES.ERROR_BACKUP const message = isBackupError - ? i18next.t('common.backupDB.dbBackupHasFailedMessage') - : i18next.t('common.backupDB.dbBackupHasCompletedMessage') + ? i18next.t('backupDB.dbBackupHasFailedMessage') + : i18next.t('backupDB.dbBackupHasCompletedMessage') const type = isBackupError ? 'error' : 'info' await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type, - title: i18next.t('common.backupDB.backupDBTitle'), + title: i18next.t('backupDB.backupDBTitle'), message, buttons: [ - i18next.t('common.backupDB.confirmButtonText') + i18next.t('common.confirmButtonText') ], defaultId: 0, cancelId: 0, @@ -200,11 +200,11 @@ module.exports = (ipc) => { ? 'error' : 'info' const message = isMigrationsError - ? i18next.t('common.migrationDB.messageModalDialog.dbMigrationHasFailedMessage') - : i18next.t('common.migrationDB.messageModalDialog.dbMigrationHasCompletedMessage') + ? i18next.t('migrationDB.messageModalDialog.dbMigrationHasFailedMessage') + : i18next.t('migrationDB.messageModalDialog.dbMigrationHasCompletedMessage') const buttons = isMigrationsError - ? [i18next.t('common.migrationDB.messageModalDialog.cancelButtonText')] - : [i18next.t('common.migrationDB.messageModalDialog.confirmButtonText')] + ? [i18next.t('common.cancelButtonText')] + : [i18next.t('common.confirmButtonText')] await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type, @@ -223,13 +223,13 @@ module.exports = (ipc) => { } = await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type: 'question', title: i18next - .t('common.migrationDB.actionRequestModalDialog.title'), + .t('migrationDB.actionRequestModalDialog.title'), message: i18next - .t('common.migrationDB.actionRequestModalDialog.message'), + .t('migrationDB.actionRequestModalDialog.message'), buttons: [ - i18next.t('common.migrationDB.actionRequestModalDialog.exitButtonText'), - i18next.t('common.migrationDB.actionRequestModalDialog.restoreDBButtonText'), - i18next.t('common.migrationDB.actionRequestModalDialog.removeDBButtonText') + i18next.t('migrationDB.actionRequestModalDialog.exitButtonText'), + i18next.t('migrationDB.actionRequestModalDialog.restoreDBButtonText'), + i18next.t('migrationDB.actionRequestModalDialog.removeDBButtonText') ], shouldParentWindowBeShown: true })) @@ -252,18 +252,18 @@ module.exports = (ipc) => { } if (state === PROCESS_MESSAGES.REQUEST_SHOULD_ALL_TABLES_BE_REMOVED) { const title = data.isNotDbRestored - ? i18next.t('common.removeDB.messageModalDialog.dbHasNotBeenRestoredTitle') - : i18next.t('common.removeDB.messageModalDialog.removeDBTitle') + ? i18next.t('removeDB.messageModalDialog.dbHasNotBeenRestoredTitle') + : i18next.t('removeDB.messageModalDialog.removeDBTitle') const { btnId } = await resolveModalDialogInSequence(() => showMessageModalDialog(win, { type: 'question', title, - message: i18next.t('common.removeDB.messageModalDialog.removeDBMessage'), + message: i18next.t('removeDB.messageModalDialog.removeDBMessage'), buttons: [ - i18next.t('common.removeDB.messageModalDialog.cancelButtonText'), - i18next.t('common.removeDB.messageModalDialog.confirmButtonText') + i18next.t('common.cancelButtonText'), + i18next.t('common.confirmButtonText') ], shouldParentWindowBeShown: true })) diff --git a/src/print-to-pdf/index.js b/src/print-to-pdf/index.js index 272e82e7..c5de3e83 100644 --- a/src/print-to-pdf/index.js +++ b/src/print-to-pdf/index.js @@ -26,7 +26,7 @@ module.exports = () => { const { templateFilePath, - template = i18next.t('common.printToPDF.defaultTemplate'), + template = i18next.t('printToPDF.defaultTemplate'), format = 'portrait', orientation = 'Letter', uid = null @@ -74,7 +74,7 @@ module.exports = () => { font-weight: 400; font-size: 8px; "> - ${i18next.t('common.printToPDF.pagination.page')} ${i18next.t('common.printToPDF.pagination.from')} + ${i18next.t('printToPDF.pagination.page')} ${i18next.t('printToPDF.pagination.from')} ` }) diff --git a/src/remove-db.js b/src/remove-db.js index 56830a30..dd0063e8 100644 --- a/src/remove-db.js +++ b/src/remove-db.js @@ -92,11 +92,11 @@ module.exports = ({ ? wins.mainWindow : BrowserWindow.getFocusedWindow() const title = shouldAllTablesBeCleared - ? i18next.t('common.removeDB.modalDialog.clearDataTitle') - : i18next.t('common.removeDB.modalDialog.removeDBTitle') + ? i18next.t('removeDB.modalDialog.clearDataTitle') + : i18next.t('removeDB.modalDialog.removeDBTitle') const message = shouldAllTablesBeCleared - ? i18next.t('common.removeDB.modalDialog.clearDataMessage') - : i18next.t('common.removeDB.modalDialog.removeDBMessage') + ? i18next.t('removeDB.modalDialog.clearDataMessage') + : i18next.t('removeDB.modalDialog.removeDBMessage') try { const { @@ -122,8 +122,8 @@ module.exports = ({ }, loadingWinParams: { description: shouldAllTablesBeCleared - ? i18next.t('common.removeDB.loadingWindow.clearingAllDataDescription') - : i18next.t('common.removeDB.loadingWindow.removingDBDescription') + ? i18next.t('removeDB.loadingWindow.clearingAllDataDescription') + : i18next.t('removeDB.loadingWindow.removingDBDescription') } }) diff --git a/src/restore-db/index.js b/src/restore-db/index.js index 206f6373..dcd95d5e 100644 --- a/src/restore-db/index.js +++ b/src/restore-db/index.js @@ -56,7 +56,7 @@ const sound = { freq: 'F2', type: 'triange', duration: 1.5 } const _fireAlert = (params) => { const { - title = i18next.t('common.restoreDB.modalDialog.title'), + title = i18next.t('restoreDB.modalDialog.title'), backupFilesMetadata } = params const win = wins.mainWindow @@ -119,8 +119,8 @@ const _fireAlert = (params) => { showConfirmButton: true, focusCancel: true, showCancelButton: true, - confirmButtonText: i18next.t('common.restoreDB.modalDialog.confirmButtonText'), - cancelButtonText: i18next.t('common.restoreDB.modalDialog.cancelButtonText'), + confirmButtonText: i18next.t('common.confirmButtonText'), + cancelButtonText: i18next.t('common.cancelButtonText'), timerProgressBar: false, input: 'radio', @@ -237,9 +237,9 @@ module.exports = () => { ) { await showMessageModalDialog(wins.mainWindow, { type: 'warning', - title: i18next.t('common.restoreDB.messageModalDialog.title'), - message: i18next.t('common.restoreDB.messageModalDialog.message'), - buttons: [i18next.t('common.restoreDB.messageModalDialog.confirmButtonText')], + title: i18next.t('restoreDB.messageModalDialog.title'), + message: i18next.t('restoreDB.messageModalDialog.message'), + buttons: [i18next.t('common.confirmButtonText')], defaultId: 0, cancelId: 0 }) diff --git a/src/show-about-modal-dialog.js b/src/show-about-modal-dialog.js index 3648b83b..38c94125 100644 --- a/src/show-about-modal-dialog.js +++ b/src/show-about-modal-dialog.js @@ -34,9 +34,9 @@ module.exports = () => { message: productName, detail, buttons: [ - i18next.t('common.showAboutModalDialog.copyButtonText'), - i18next.t('common.showAboutModalDialog.gitHubButtonText'), - i18next.t('common.showAboutModalDialog.confirmButtonText') + i18next.t('showAboutModalDialog.copyButtonText'), + i18next.t('showAboutModalDialog.gitHubButtonText'), + i18next.t('common.confirmButtonText') ], defaultId: 2, cancelId: 2, diff --git a/src/show-docs/index.js b/src/show-docs/index.js index b49f6150..3f0ad639 100644 --- a/src/show-docs/index.js +++ b/src/show-docs/index.js @@ -56,7 +56,7 @@ const converter = new Converter({ const _fireAlert = (params) => { const { type = 'info', - title = i18next.t('common.showDocs.modalDialog.title'), + title = i18next.t('showDocs.modalDialog.title'), html } = params const win = wins.mainWindow @@ -109,7 +109,7 @@ const _fireAlert = (params) => { showConfirmButton: false, focusCancel: true, showCancelButton: true, - cancelButtonText: i18next.t('common.showDocs.modalDialog.cancelButtonText'), + cancelButtonText: i18next.t('showDocs.modalDialog.cancelButtonText'), timerProgressBar: false, willOpen: () => { diff --git a/src/show-error-modal-dialog.js b/src/show-error-modal-dialog.js index abc10392..aefadd53 100644 --- a/src/show-error-modal-dialog.js +++ b/src/show-error-modal-dialog.js @@ -17,7 +17,7 @@ const _showErrorBox = (win, title = '', message = '') => { return showMessageModalDialog(win, { type: 'error', buttons: [ - i18next.t('common.showErrorModalDialog.confirmButtonText') + i18next.t('common.confirmButtonText') ], defaultId: 0, cancelId: 0, @@ -28,7 +28,7 @@ const _showErrorBox = (win, title = '', message = '') => { module.exports = async (win, title = 'Error', err) => { if (err.code === 'ENOENT') { - const message = i18next.t('common.showErrorModalDialog.enoentErrorMessage') + const message = i18next.t('showErrorModalDialog.enoentErrorMessage') const content = (err.syscall && err.path) ? `${message}, ${err.syscall}: '${err.path}'` : message @@ -36,7 +36,7 @@ module.exports = async (win, title = 'Error', err) => { return _showErrorBox(win, title, content) } if (err.code === 'EACCES') { - const message = i18next.t('common.showErrorModalDialog.eaccesErrorMessage') + const message = i18next.t('showErrorModalDialog.eaccesErrorMessage') const content = (err.syscall && err.path) ? `${message}, ${err.syscall}: '${err.path}'` : message @@ -44,12 +44,12 @@ module.exports = async (win, title = 'Error', err) => { return _showErrorBox(win, title, content) } if (err instanceof InvalidFilePathError) { - const message = i18next.t('common.showErrorModalDialog.invalidFilePathErrorMessage') + const message = i18next.t('showErrorModalDialog.invalidFilePathErrorMessage') return _showErrorBox(win, title, message) } if (err instanceof InvalidFileNameInArchiveError) { - const message = i18next.t('common.showErrorModalDialog.invalidFileNameInArchErrorMessage') + const message = i18next.t('showErrorModalDialog.invalidFileNameInArchErrorMessage') return _showErrorBox(win, title, message) } @@ -57,27 +57,27 @@ module.exports = async (win, title = 'Error', err) => { err instanceof DbImportingError || err instanceof InvalidFolderPathError ) { - const message = i18next.t('common.showErrorModalDialog.dbImportingErrorMessage') + const message = i18next.t('showErrorModalDialog.dbImportingErrorMessage') return _showErrorBox(win, title, message) } if (err instanceof DbRemovingError) { - const message = i18next.t('common.showErrorModalDialog.dbRemovingErrorMessage') + const message = i18next.t('showErrorModalDialog.dbRemovingErrorMessage') return _showErrorBox(win, title, message) } if (err instanceof ReportsFolderChangingError) { - const message = i18next.t('common.showErrorModalDialog.reportsFolderChangingErrorMessage') + const message = i18next.t('showErrorModalDialog.reportsFolderChangingErrorMessage') return _showErrorBox(win, title, message) } if (err instanceof SyncFrequencyChangingError) { - const message = i18next.t('common.showErrorModalDialog.syncFrequencyChangingErrorMessage') + const message = i18next.t('showErrorModalDialog.syncFrequencyChangingErrorMessage') return _showErrorBox(win, title, message) } - const message = i18next.t('common.showErrorModalDialog.unexpectedExceptionMessage') + const message = i18next.t('showErrorModalDialog.unexpectedExceptionMessage') return _showErrorBox(win, title, message) } diff --git a/src/show-message-modal-dialog.js b/src/show-message-modal-dialog.js index 5d1a98fc..9153cd6e 100644 --- a/src/show-message-modal-dialog.js +++ b/src/show-message-modal-dialog.js @@ -27,8 +27,8 @@ module.exports = async (win, opts = {}) => { } = await dialog.showMessageBox(parentWin, { type: 'info', buttons: [ - i18next.t('common.showMessageModalDialog.cancelButtonText'), - i18next.t('common.showMessageModalDialog.confirmButtonText') + i18next.t('common.cancelButtonText'), + i18next.t('common.confirmButtonText') ], defaultId: 1, cancelId: 0, diff --git a/src/show-notification/index.js b/src/show-notification/index.js index 659874ac..1f1107f9 100644 --- a/src/show-notification/index.js +++ b/src/show-notification/index.js @@ -12,8 +12,8 @@ module.exports = (params) => { } const notification = new Notification({ - title: i18next.t('common.nativeNotification.defaulTitle'), - body: i18next.t('common.nativeNotification.defaultBody'), + title: i18next.t('nativeNotification.defaulTitle'), + body: i18next.t('nativeNotification.defaultBody'), silent: false, timeoutType: 'never', urgency: 'normal', diff --git a/src/show-notification/show-sync-notification.js b/src/show-notification/show-sync-notification.js index 22158926..1a2c0adc 100644 --- a/src/show-notification/show-sync-notification.js +++ b/src/show-notification/show-sync-notification.js @@ -16,13 +16,13 @@ const getBody = (params) => { } = params ?? {} if (isError) { - return i18next.t('common.nativeNotification.sync.errorBody') + return i18next.t('nativeNotification.sync.errorBody') } if (isInterrupted) { - return i18next.t('common.nativeNotification.sync.interruptedBody') + return i18next.t('nativeNotification.sync.interruptedBody') } - return i18next.t('common.nativeNotification.sync.completedBody') + return i18next.t('nativeNotification.sync.completedBody') } module.exports = (mess) => { diff --git a/src/show-notification/show-trx-tax-report-notification.js b/src/show-notification/show-trx-tax-report-notification.js index 64e202d6..fd88377a 100644 --- a/src/show-notification/show-trx-tax-report-notification.js +++ b/src/show-notification/show-trx-tax-report-notification.js @@ -20,8 +20,8 @@ module.exports = (mess) => { const isError = state === PROCESS_MESSAGES.ERROR_TRX_TAX_REPORT const body = isError - ? i18next.t('common.nativeNotification.trxTaxReport.errorBody') - : i18next.t('common.nativeNotification.trxTaxReport.completedBody') + ? i18next.t('nativeNotification.trxTaxReport.errorBody') + : i18next.t('nativeNotification.trxTaxReport.completedBody') const urgency = isError ? 'critical' : 'normal' showNotification({ body, urgency }) diff --git a/src/window-creators/layouts/app-init-error.html b/src/window-creators/layouts/app-init-error.html index f64bff5c..3fa209ae 100644 --- a/src/window-creators/layouts/app-init-error.html +++ b/src/window-creators/layouts/app-init-error.html @@ -120,11 +120,11 @@ try { description = await window.bfxReportElectronApi?.translate({ - key: 'common.appInitError.description', + key: 'appInitError.description', opts: { defaultValue: defaultDescription } }) ?? defaultDescription closeBtnText = await window.bfxReportElectronApi?.translate({ - key: 'common.appInitError.closeBtnText', + key: 'appInitError.closeBtnText', opts: { defaultValue: defaultCloseBtnText } }) ?? defaultCloseBtnText