diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e23081dc..6ec93984 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -19,5 +19,11 @@ module.exports = { }, ], "@typescript-eslint/no-explicit-any": "warn", + "prettier/prettier": [ + "error", + { + endOfLine: "auto", + }, + ], }, }; diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index 0a4b97de..00000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -npx --no -- commitlint --edit $1 diff --git a/src/locales/fa/translation.json b/src/locales/fa/translation.json new file mode 100644 index 00000000..aa929945 --- /dev/null +++ b/src/locales/fa/translation.json @@ -0,0 +1,174 @@ +{ + "home": { + "featured": "پیشنهادی", + "recently_added": "تازه اضافه شده", + "trending": "پرطرفدار", + "surprise_me": "سوپرایزم کن", + "no_results": "اتمام‌ای پیدا نشد" + }, + "sidebar": { + "catalogue": "کاتالوگ", + "downloads": "دانلودها", + "settings": "تنظیمات", + "my_library": "کتابخانه‌ی من", + "downloading_metadata": "{{title}} (در حال دانلود متادیتا...)", + "checking_files": "{{title}} ({{percentage}} - در حال بررسی فایل‌ها...)", + "paused": "{{title}} (متوقف شده)", + "downloading": "{{title}} ({{percentage}} - در حال دانلود…)", + "filter": "فیلتر کردن کتابخانه", + "follow_us": "دنبال کردن ما", + "home": "خانه", + "discord": "عضویت در دیسکورد ما", + "telegram": "عضویت در تلگرام ما", + "x": "دنبال کرد در ایکس", + "github": "مشارکت در گیتهاب" + }, + "header": { + "search": "جستجوی بازی‌ها", + "home": "خانه", + "catalogue": "کاتالوگ", + "downloads": "دانلود‌ها", + "search_results": "نتایج جستجو", + "settings": "تنظیمات" + }, + "bottom_panel": { + "no_downloads_in_progress": "دانلودی در حال انجام نیست", + "downloading_metadata": "درحال دانلود متادیتاهای {{title}}…", + "checking_files": "در حال چک کردن فایل‌های {{title}}…. ({{percentage}} تکمیل شده)", + "downloading": "در حال دانلود {{title}}… ({{percentage}} تکمیل شده) - اتمام {{eta}} - {{speed}}" + }, + "catalogue": { + "next_page": "صفحه‌ی بعدی", + "previous_page": "صفحه‌ی قبلی" + }, + "game_details": { + "open_download_options": "بازکردن آپشن‌های دانلود", + "download_options_zero": "هیچ آپشن دانلودی وجود ندارد", + "download_options_one": "{{count}} آپشن دانلود", + "download_options_other": "{{count}} آپشن دانلود", + "updated_at": "بروزرسانی شده در {{updated_at}}", + "install": "نصب", + "resume": "ادامه", + "pause": "توقف", + "cancel": "بیخیال", + "remove": "حذف", + "remove_from_list": "حذف", + "space_left_on_disk": "{{space}} فضا در دیسک باقی‌مانده", + "eta": "اتمام {{eta}}", + "downloading_metadata": "در حال دانلود متادیتاها…", + "checking_files": "در حال چک کردن فایل‌ها", + "filter": "فیلترکردن ریپک‌ها", + "requirements": "سیستم مورد نیاز", + "minimum": "حداقل", + "recommended": "پیشنهادی", + "no_minimum_requirements": "{{title}} اطلاعات حداقل سیستم مورد نیاز را فراهم نکرده", + "no_recommended_requirements": "{{title}} اطلاعات پیشنهادی سیستم مورد نیاز را فراهم نکرده", + "paused_progress": "{{progress}} (متوقف شده)", + "release_date": "منتشر شده در {{date}}", + "publisher": "منتشر شده توسط {{publisher}}", + "copy_link_to_clipboard": "کپی لینک", + "copied_link_to_clipboard": "لینک کپی شد", + "hours": "ساعت", + "minutes": "دقیقه", + "amount_hours": "{{amount}} ساعت", + "amount_minutes": "{{amount}} دقیقه", + "accuracy": "{{accuracy}}% دقت", + "add_to_library": "اضافه کردن به کتابخانه", + "remove_from_library": "حذف کردن از کتابخانه", + "no_downloads": "هیچ دانلودی نیست", + "play_time": "{{amount}} بازی شده", + "last_time_played": "آخرین بار بازی شده {{period}}", + "not_played_yet": "شما هنوز {{title}} را بازی نکرده‌اید", + "next_suggestion": "پیشنهاد بعدی", + "play": "بازی", + "deleting": "پاک کردن نصب کننده", + "close": "بستن", + "playing_now": "در حال بازی", + "change": "تغییر", + "repacks_modal_description": "ریپک مورد نظر برای دانلود را انتخاب کنید", + "downloads_path": "آدرس دانلودها", + "select_folder_hint": "برای تغییر پوشه‌ی پیش‌فرض به <0>Settings بروید", + "download_now": "الان دانلود کن", + "installation_instructions": "دستورات نصب", + "installation_instructions_description": "قدم‌های دیگری برای نصب این بازی نیاز است", + "online_fix_instruction": "بازی‌های OnlineFix برای اکسترکت‌ شدن به پسوورد نیاز دارند. در صورت نیاز، از این پسوورد استفاده کنید:", + "dodi_installation_instruction": "زمانی که اینستالر DODI را باز کردید، دکمه‌ی <0 /> را فشار دهید تا فرایند نصب شروع شود:", + "dont_show_it_again": "دیگر نمایش نده", + "copy_to_clipboard": "کپی", + "copied_to_clipboard": "کپی شد", + "got_it": "فهمیدم" + }, + "activation": { + "title": "فعال کردن هایدرا", + "installation_id": "ID نصب:", + "enter_activation_code": "کد فعال‌سازی خود را وارد کنید", + "message": "اگر نمی‌دانید از کجا باید درخواست کنید، پس نباید آن را داشته باشید.", + "activate": "فعال‌سازی", + "loading": "در حال بارگزاری…" + }, + "downloads": { + "resume": "ادامه", + "pause": "توقف", + "eta": "اتمام {{eta}}", + "paused": "متوقف شده", + "verifying": "در حال اعتبارسنجی…", + "completed_at": "پایان یافته در {{date}}", + "completed": "پایان یافته", + "cancelled": "لغو شده", + "download_again": "دانلود مجدد", + "cancel": "لغو", + "filter": "فیلتر بازی‌های دانلود شده", + "remove": "حذف", + "downloading_metadata": "در حال دانلود متادیتاها…", + "checking_files": "در حال چک کردن فایل‌ها…", + "starting_download": "در حال آغار دانلود…", + "deleting": "در حال پاک کردن اینستالر…", + "delete": "پاک کردن", + "remove_from_list": "حذف", + "delete_modal_title": "مطمئنی؟", + "delete_modal_description": "این کار تمام فایل‌های اینستالر را از کامپیوتر شما حذف می‌کند", + "install": "نصف", + "real_debrid": "Real Debrid", + "torrent": "تورنت" + }, + "settings": { + "downloads_path": "مسیر دانلودها", + "change": "بروزرسانی", + "notifications": "نوتیفیکشن‌ها", + "enable_download_notifications": "زمانی که یک دانلود تمام شد", + "enable_repack_list_notifications": "زمانی که یک ریپک جدید اضافه شد", + "telemetry": "تلمتری", + "telemetry_description": "فعال کردن آمارگیری استفاده ناشناس", + "real_debrid_api_token_description": "توکن Real Debrid", + "quit_app_instead_hiding": "به جای کوچک کردن، از هایدرا خارج شو", + "launch_with_system": "زمانی که سیستم روشن می‌شود، هایدرا را باز کن", + "general": "کلی", + "behavior": "رفتار", + "enable_real_debrid": "فعال‌سازی Real Debrid", + "real_debrid": "Real Debrid", + "real_debrid_api_token_hint": "کلید API خود را از <ب0>اینجا بگیرید.", + "save_changes": "ذخیره تغییرات" + }, + "notifications": { + "download_complete": "دانلود تمام شد", + "game_ready_to_install": "{{title}} آماده‌ی نصب است", + "repack_list_updated": "لیست ریپک‌ها بروزرسانی شد", + "repack_count_one": "{{count}} ریپک اضافه شد", + "repack_count_other": "{{count}} ریپک اضافه شد" + }, + "system_tray": { + "open": "باز کردن هایدرا", + "quit": "خروج" + }, + "game_card": { + "no_downloads": "هیچ دانلودی نیست" + }, + "binary_not_found_modal": { + "title": "نرم‌افزاری نصب نیست", + "description": "بر روی سیستم شما پیدا نشد Wine یا Lutris فایل‌های اجرایی", + "instructions": "روش صحیح نصب هر کدام از آن‌ها رو روی لینوکس خود چک کنید تا بازی بتواند به درستی اجرا شود" + }, + "modal": { + "close": "دکمه‌ی خروج" + } +} diff --git a/src/locales/index.ts b/src/locales/index.ts index bf0eaab0..ff2f9935 100644 --- a/src/locales/index.ts +++ b/src/locales/index.ts @@ -12,3 +12,4 @@ export { default as be } from "./be/translation.json"; export { default as uk } from "./uk/translation.json"; export { default as id } from "./id/translation.json"; export { default as da } from "./da/translation.json"; +export { default as fa } from "./fa/translation.json"; diff --git a/src/main/services/downloaders/torrent.downloader.ts b/src/main/services/downloaders/torrent.downloader.ts index 0590f6bf..9476711b 100644 --- a/src/main/services/downloaders/torrent.downloader.ts +++ b/src/main/services/downloaders/torrent.downloader.ts @@ -124,21 +124,20 @@ export class TorrentDownloader extends Downloader { stdio: "inherit", windowsHide: true, }); - return; + } else { + const scriptPath = path.join( + __dirname, + "..", + "..", + "torrent-client", + "main.py" + ); + + cp.spawn("python3", [scriptPath, ...commonArgs], { + stdio: "inherit", + }); } - const scriptPath = path.join( - __dirname, - "..", - "..", - "torrent-client", - "main.py" - ); - - cp.spawn("python3", [scriptPath, ...commonArgs], { - stdio: "inherit", - }); - Promise.all([writePipe.createPipe(), readPipe.createPipe()]).then( async () => { this.attachListener(); diff --git a/src/main/services/steam-grid.ts b/src/main/services/steam-grid.ts index 9cb51d73..d5519342 100644 --- a/src/main/services/steam-grid.ts +++ b/src/main/services/steam-grid.ts @@ -29,7 +29,7 @@ export const getSteamGridData = async ( const searchParams = new URLSearchParams(params); if (!import.meta.env.MAIN_VITE_STEAMGRIDDB_API_KEY) { - throw new Error("STEAMGRIDDB_API_KEY is not set"); + throw new Error("MAIN_VITE_STEAMGRIDDB_API_KEY is not set"); } const response = await axios.get( diff --git a/src/renderer/src/pages/settings/settings-general.tsx b/src/renderer/src/pages/settings/settings-general.tsx index e9b680c8..434093d3 100644 --- a/src/renderer/src/pages/settings/settings-general.tsx +++ b/src/renderer/src/pages/settings/settings-general.tsx @@ -45,6 +45,11 @@ export function SettingsGeneral({ const { t } = useTranslation("settings"); + const handleChange = (values: Partial) => { + setForm((prev) => ({ ...prev, ...values })); + updateUserPreferences(values); + }; + const handleChooseDownloadsPath = async () => { const { filePaths } = await window.electron.showOpenDialog({ defaultPath: form.downloadsPath, @@ -53,15 +58,11 @@ export function SettingsGeneral({ if (filePaths && filePaths.length > 0) { const path = filePaths[0]; + handleChange({ downloadsPath: path }); updateUserPreferences({ downloadsPath: path }); } }; - const handleChange = (values: Partial) => { - setForm((prev) => ({ ...prev, ...values })); - updateUserPreferences(values); - }; - return ( <>