diff --git a/project.inlang/clippy.babel b/project.inlang/clippy.babel index 91f430b2..4878e5f4 100644 --- a/project.inlang/clippy.babel +++ b/project.inlang/clippy.babel @@ -22,6 +22,89 @@ ABOUT + + ABOUT + + + + + ar-SA + false + + + bn-IN + false + + + de-DE + false + + + en-US + false + + + es-ES + false + + + fr-FR + false + + + hi-IN + false + + + it-IT + false + + + ja-JP + false + + + ko-KR + false + + + nl-NL + false + + + pl-PL + false + + + pt-PT + false + + + ru-RU + false + + + th-TH + false + + + tr-TR + false + + + ur-PK + false + + + vi-VN + false + + + zh-CN + false + + + COPYRIGHT @@ -8963,6 +9046,89 @@ + + SETTINGS + + + + + ar-SA + false + + + bn-IN + false + + + de-DE + false + + + en-US + false + + + es-ES + false + + + fr-FR + false + + + hi-IN + false + + + it-IT + false + + + ja-JP + false + + + ko-KR + false + + + nl-NL + false + + + pl-PL + false + + + pt-PT + false + + + ru-RU + false + + + th-TH + false + + + tr-TR + false + + + ur-PK + false + + + vi-VN + false + + + zh-CN + false + + + TAB diff --git a/src-tauri/src/commands/window.rs b/src-tauri/src/commands/window.rs index e792194d..77c1ee85 100644 --- a/src-tauri/src/commands/window.rs +++ b/src-tauri/src/commands/window.rs @@ -13,8 +13,8 @@ use tauri::AppHandle; use tauri_plugin_opener::OpenerExt; #[tauri::command] -pub async fn open_new_window(window_name: WebWindow) { - open_window(window_name).await; +pub async fn open_new_window(window_name: WebWindow, title: Option) { + open_window(window_name, title).await; } #[tauri::command] diff --git a/src-tauri/src/events/hotkey_events.rs b/src-tauri/src/events/hotkey_events.rs index a851d2ad..8e871a06 100644 --- a/src-tauri/src/events/hotkey_events.rs +++ b/src-tauri/src/events/hotkey_events.rs @@ -95,6 +95,7 @@ pub async fn parse_hotkey_event(key: &Key) { window.to_string().to_lowercase() == e.to_string().to_lowercase() }) .expect("Failed to find window"), + None, ) .await } diff --git a/src-tauri/src/service/window.rs b/src-tauri/src/service/window.rs index 916b0717..e7f743ae 100644 --- a/src-tauri/src/service/window.rs +++ b/src-tauri/src/service/window.rs @@ -198,7 +198,7 @@ pub fn calculate_thumbnail_dimensions(width: u32, height: u32) -> (u32, u32) { } } -pub async fn create_about_window() { +pub async fn create_about_window(title: Option) { let app = crate::service::global::get_app(); // Close existing window if it exists @@ -213,7 +213,7 @@ pub async fn create_about_window() { WebWindow::About.to_string().as_str(), WebviewUrl::App("pages/about.html".into()), ) - .title("About") + .title(title.unwrap_or_else(|| "About".to_string())) .inner_size(ABOUT_WINDOW_X as f64, ABOUT_WINDOW_Y as f64) .always_on_top(true) .build() @@ -224,7 +224,7 @@ pub async fn create_about_window() { .expect("Failed to set window size"); } -pub async fn create_settings_window() { +pub async fn create_settings_window(title: Option) { let app = crate::service::global::get_app(); // Close existing window if it exists @@ -238,7 +238,7 @@ pub async fn create_settings_window() { WebWindow::Settings.to_string().as_str(), WebviewUrl::App("pages/settings.html".into()), ) - .title("Settings") + .title(title.unwrap_or_else(|| "Settings".to_string())) .inner_size(SETTINGS_WINDOW_X as f64, SETTINGS_WINDOW_Y as f64) .always_on_top(true) .build() @@ -249,10 +249,10 @@ pub async fn create_settings_window() { .expect("Failed to set window size"); } -pub async fn open_window(window_name: WebWindow) { +pub async fn open_window(window_name: WebWindow, title: Option) { match window_name { - WebWindow::About => create_about_window().await, - WebWindow::Settings => create_settings_window().await, + WebWindow::About => create_about_window(title).await, + WebWindow::Settings => create_settings_window(title).await, _ => {} } } diff --git a/src/components/pages/app/view-more.tsx b/src/components/pages/app/view-more.tsx index 475bd414..8d9c1809 100644 --- a/src/components/pages/app/view-more.tsx +++ b/src/components/pages/app/view-more.tsx @@ -51,9 +51,9 @@ export const ViewMore: Component = ({}) => { {/* Sync Clipboard History */} {createButton("MAIN.HOTKEY.SYNC_CLIPBOARD_HISTORY", SettingsStore.syncClipboard)} {/* Settings */} - {createButton("MAIN.HOTKEY.SETTINGS", () => SettingsStore.openWindow(WebWindow.Settings))} + {createButton("MAIN.HOTKEY.SETTINGS", () => SettingsStore.openWindow(WebWindow.Settings, t("SETTINGS.SETTINGS")))} {/* About */} - {createButton("MAIN.HOTKEY.ABOUT", () => SettingsStore.openWindow(WebWindow.About))} + {createButton("MAIN.HOTKEY.ABOUT", () => SettingsStore.openWindow(WebWindow.About, t("ABOUT.ABOUT")))} {/* Exit */} {createButton("MAIN.HOTKEY.EXIT", SettingsStore.exitApp)} diff --git a/src/components/pages/settings/settings-general.tsx b/src/components/pages/settings/settings-general.tsx index 08628dad..985791f6 100644 --- a/src/components/pages/settings/settings-general.tsx +++ b/src/components/pages/settings/settings-general.tsx @@ -129,7 +129,7 @@ export const SettingsGeneral: Component = ({}) => { ...SettingsStore.settings()!, display_scale: Number(parseFloat(e.target.value).toFixed(2)), }); - await invokeCommand(InvokeCommand.OpenNewWindow, { windowName: WebWindow.Settings }); + await invokeCommand(InvokeCommand.OpenNewWindow, { windowName: WebWindow.Settings, title: "Settings" }); }} /> diff --git a/src/lib/i18n/ar.json b/src/lib/i18n/ar.json index 9714c49c..0df80d4d 100644 --- a/src/lib/i18n/ar.json +++ b/src/lib/i18n/ar.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "عن", "COPYRIGHT": "جميع الحقوق محفوظة لشركة DC.", "DEVELOPED_BY": "تم تطويره بواسطة 0-don. مدعوم بواسطة Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "لا توجد تحديثات متاحة حاليًا", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "الحد الأقصى لحجم RTF", "MAX_TEXT_SIZE": "الحد الأقصى لحجم النص" }, + "SETTINGS": "إعدادات", "TAB": { "BACKUP": "دعم", "GENERAL": "عام", diff --git a/src/lib/i18n/bn.json b/src/lib/i18n/bn.json index 61a10e7e..e60aa152 100644 --- a/src/lib/i18n/bn.json +++ b/src/lib/i18n/bn.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "সম্পর্কে", "COPYRIGHT": "কপিরাইট(C) ডিসি। সব অধিকার সংরক্ষিত.", "DEVELOPED_BY": "0-ডন দ্বারা বিকাশিত। তৌরি দ্বারা চালিত.", "NO_UPDATES_CURRENTLY_AVAILABLE": "কোন আপডেট বর্তমানে উপলব্ধ", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "সর্বোচ্চ Rtf আকার", "MAX_TEXT_SIZE": "সর্বাধিক পাঠ্য আকার" }, + "SETTINGS": "সেটিংস", "TAB": { "BACKUP": "ব্যাকআপ", "GENERAL": "সাধারণ", diff --git a/src/lib/i18n/de.json b/src/lib/i18n/de.json index efc5a81a..247a9d33 100644 --- a/src/lib/i18n/de.json +++ b/src/lib/i18n/de.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Um", "COPYRIGHT": "Copyright(C) DC. Alle Rechte vorbehalten.", "DEVELOPED_BY": "Entwickelt von 0-don. Unterstützt von Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Derzeit keine Updates verfügbar", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Maximale RTF-Größe", "MAX_TEXT_SIZE": "Maximale Textgröße" }, + "SETTINGS": "Einstellungen", "TAB": { "BACKUP": "Sicherung", "GENERAL": "Allgemein", diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index cc50dccf..c7e3bdc9 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "About", "COPYRIGHT": "Copyright(C) DC. All right reserved.", "DEVELOPED_BY": "Developed by 0-don. Powered by Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "No updates currently available", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Max Rtf size", "MAX_TEXT_SIZE": "Max Text size" }, + "SETTINGS": "Settings", "TAB": { "BACKUP": "Backup", "GENERAL": "General", diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json index 6cc467d7..12f67c10 100644 --- a/src/lib/i18n/es.json +++ b/src/lib/i18n/es.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Acerca de", "COPYRIGHT": "Copyright(C) DC. Todos los derechos reservados.", "DEVELOPED_BY": "Desarrollado por 0-don. Con tecnología de Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "No hay actualizaciones disponibles actualmente", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Tamaño máximo de Rtf", "MAX_TEXT_SIZE": "Tamaño máximo del texto" }, + "SETTINGS": "Ajustes", "TAB": { "BACKUP": "Respaldo", "GENERAL": "General", diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json index e201495d..5e6a5ceb 100644 --- a/src/lib/i18n/fr.json +++ b/src/lib/i18n/fr.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "À propos", "COPYRIGHT": "Copyright (C) DC. Tous droits réservés.", "DEVELOPED_BY": "Développé par 0-don. Propulsé par Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Aucune mise à jour disponible actuellement", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Taille maximale du fichier RTF", "MAX_TEXT_SIZE": "Taille maximale du texte" }, + "SETTINGS": "Paramètres", "TAB": { "BACKUP": "Sauvegarde", "GENERAL": "Général", diff --git a/src/lib/i18n/hi.json b/src/lib/i18n/hi.json index f5b35789..1a1f7a51 100644 --- a/src/lib/i18n/hi.json +++ b/src/lib/i18n/hi.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "के बारे में", "COPYRIGHT": "कॉपीराइट(सी) डीसी. सभी अधिकार सुरक्षित.", "DEVELOPED_BY": "0-don द्वारा विकसित। Tauri द्वारा संचालित।", "NO_UPDATES_CURRENTLY_AVAILABLE": "वर्तमान में कोई अपडेट उपलब्ध नहीं है", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "अधिकतम Rtf आकार", "MAX_TEXT_SIZE": "अधिकतम पाठ आकार" }, + "SETTINGS": "समायोजन", "TAB": { "BACKUP": "बैकअप", "GENERAL": "सामान्य", diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json index 9c4bf82d..c9d04c08 100644 --- a/src/lib/i18n/it.json +++ b/src/lib/i18n/it.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Di", "COPYRIGHT": "Copyright(C) DC. Tutti i diritti riservati.", "DEVELOPED_BY": "Sviluppato da 0-don con Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Questa versione è aggiornata", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Dimensione massima RTF", "MAX_TEXT_SIZE": "Dimensione massima testo" }, + "SETTINGS": "Impostazioni", "TAB": { "BACKUP": "Backup", "GENERAL": "Generale", diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json index acb929ee..b84ad6f9 100644 --- a/src/lib/i18n/ja.json +++ b/src/lib/i18n/ja.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "について", "COPYRIGHT": "Copyright(C) DC. 無断転載禁止。", "DEVELOPED_BY": "0-don によって開発されました。Tauri を搭載しています。", "NO_UPDATES_CURRENTLY_AVAILABLE": "現在利用可能なアップデートはありません", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "最大 RTF サイズ", "MAX_TEXT_SIZE": "最大テキストサイズ" }, + "SETTINGS": "設定", "TAB": { "BACKUP": "バックアップ", "GENERAL": "一般的な", diff --git a/src/lib/i18n/ko.json b/src/lib/i18n/ko.json index b4c8c752..aeefb01c 100644 --- a/src/lib/i18n/ko.json +++ b/src/lib/i18n/ko.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "에 대한", "COPYRIGHT": "저작권(C) DC. 모든 권리 보유.", "DEVELOPED_BY": "0-don이 개발했습니다. Tauri가 지원합니다.", "NO_UPDATES_CURRENTLY_AVAILABLE": "현재 사용 가능한 업데이트가 없습니다.", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "최대 Rtf 크기", "MAX_TEXT_SIZE": "최대 텍스트 크기" }, + "SETTINGS": "설정", "TAB": { "BACKUP": "지원", "GENERAL": "일반적인", diff --git a/src/lib/i18n/nl.json b/src/lib/i18n/nl.json index 3f3e9611..7f8f70a7 100644 --- a/src/lib/i18n/nl.json +++ b/src/lib/i18n/nl.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Over", "COPYRIGHT": "Copyright(C) DC. Alle rechten voorbehouden.", "DEVELOPED_BY": "Ontwikkeld door 0-don. Powered by Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Momenteel geen updates beschikbaar", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Maximale RTF-grootte", "MAX_TEXT_SIZE": "Maximale tekstgrootte" }, + "SETTINGS": "Instellingen", "TAB": { "BACKUP": "Back-up", "GENERAL": "Algemeen", diff --git a/src/lib/i18n/pl.json b/src/lib/i18n/pl.json index ecb06a61..fe337a30 100644 --- a/src/lib/i18n/pl.json +++ b/src/lib/i18n/pl.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "O", "COPYRIGHT": "Copyright(C) DC. Wszelkie prawa zastrzeżone.", "DEVELOPED_BY": "Opracowane przez 0-don. Obsługiwane przez Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Brak dostępnych aktualizacji", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Maksymalny rozmiar RTF", "MAX_TEXT_SIZE": "Maksymalny rozmiar tekstu" }, + "SETTINGS": "Ustawienia", "TAB": { "BACKUP": "Kopia zapasowa", "GENERAL": "Ogólny", diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json index dcea45a2..066d4911 100644 --- a/src/lib/i18n/pt.json +++ b/src/lib/i18n/pt.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Sobre", "COPYRIGHT": "Direitos de autor(C) DC. Tudo bem reservado.", "DEVELOPED_BY": "Desenvolvido por 0-don. Desenvolvido por Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Nenhuma atualização disponível de momento", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Tamanho máximo do Rtf", "MAX_TEXT_SIZE": "Tamanho máximo do texto" }, + "SETTINGS": "Configurações", "TAB": { "BACKUP": "Backup", "GENERAL": "Em geral", diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json index b772d0e6..e4f5e555 100644 --- a/src/lib/i18n/ru.json +++ b/src/lib/i18n/ru.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "О", "COPYRIGHT": "Авторские права (C) DC. Все права защищены.", "DEVELOPED_BY": "Разработано 0-don. Работает на Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "В настоящее время обновлений нет.", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Макс. размер RTF", "MAX_TEXT_SIZE": "Макс. размер текста" }, + "SETTINGS": "Настройки", "TAB": { "BACKUP": "Резервное копирование", "GENERAL": "Общий", diff --git a/src/lib/i18n/th.json b/src/lib/i18n/th.json index ff43a4f1..e930ed78 100644 --- a/src/lib/i18n/th.json +++ b/src/lib/i18n/th.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "เกี่ยวกับ", "COPYRIGHT": "ลิขสิทธิ์ © DC. สงวนลิขสิทธิ์.", "DEVELOPED_BY": "พัฒนาโดย 0-don ขับเคลื่อนโดย Tauri", "NO_UPDATES_CURRENTLY_AVAILABLE": "ไม่มีการอัพเดตใดๆ ในขณะนี้", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "ขนาด Rtf สูงสุด", "MAX_TEXT_SIZE": "ขนาดข้อความสูงสุด" }, + "SETTINGS": "การตั้งค่า", "TAB": { "BACKUP": "การสำรองข้อมูล", "GENERAL": "ทั่วไป", diff --git a/src/lib/i18n/tr.json b/src/lib/i18n/tr.json index 57d06781..2ca16584 100644 --- a/src/lib/i18n/tr.json +++ b/src/lib/i18n/tr.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Hakkında", "COPYRIGHT": "Telif Hakkı(C) DC. Tüm hakları saklıdır.", "DEVELOPED_BY": "0-don tarafından geliştirildi. Tauri tarafından destekleniyor.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Şu anda herhangi bir güncelleme mevcut değil", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Maksimum Rtf boyutu", "MAX_TEXT_SIZE": "Maksimum Metin boyutu" }, + "SETTINGS": "Ayarlar", "TAB": { "BACKUP": "Yedekleme", "GENERAL": "Genel", diff --git a/src/lib/i18n/ur.json b/src/lib/i18n/ur.json index 7d11fce5..735c480e 100644 --- a/src/lib/i18n/ur.json +++ b/src/lib/i18n/ur.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "کے بارے میں", "COPYRIGHT": "کاپی رائٹ (C) DC۔ تمام حق محفوظ ہیں۔", "DEVELOPED_BY": "0-ڈان کے ذریعہ تیار کردہ۔ توری کے ذریعہ تقویت یافتہ۔", "NO_UPDATES_CURRENTLY_AVAILABLE": "فی الحال کوئی اپ ڈیٹ دستیاب نہیں ہے۔", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "زیادہ سے زیادہ Rtf سائز", "MAX_TEXT_SIZE": "زیادہ سے زیادہ متن کا سائز" }, + "SETTINGS": "ترتیبات", "TAB": { "BACKUP": "بیک اپ", "GENERAL": "جنرل", diff --git a/src/lib/i18n/vi.json b/src/lib/i18n/vi.json index 18faea95..e801a2cf 100644 --- a/src/lib/i18n/vi.json +++ b/src/lib/i18n/vi.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "Về", "COPYRIGHT": "Bản quyền (C) DC. Mọi quyền được bảo lưu.", "DEVELOPED_BY": "Được phát triển bởi 0-don. Được hỗ trợ bởi Tauri.", "NO_UPDATES_CURRENTLY_AVAILABLE": "Hiện tại không có bản cập nhật nào", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "Kích thước Rtf tối đa", "MAX_TEXT_SIZE": "Kích thước văn bản tối đa" }, + "SETTINGS": "Cài đặt", "TAB": { "BACKUP": "Hỗ trợ", "GENERAL": "Tổng quan", diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json index 610385d6..1303c0e0 100644 --- a/src/lib/i18n/zh.json +++ b/src/lib/i18n/zh.json @@ -1,5 +1,6 @@ { "ABOUT": { + "ABOUT": "关于", "COPYRIGHT": "版权所有 (C) DC。保留所有权利。", "DEVELOPED_BY": "由 0-don 开发。由 Tauri 提供支持。", "NO_UPDATES_CURRENTLY_AVAILABLE": "目前没有可用更新", @@ -131,6 +132,7 @@ "MAX_RTF_SIZE": "最大 Rtf 大小", "MAX_TEXT_SIZE": "最大文本大小" }, + "SETTINGS": "设置", "TAB": { "BACKUP": "备份", "GENERAL": "一般的", diff --git a/src/store/settings-store.ts b/src/store/settings-store.ts index 465c64f2..d2c058da 100644 --- a/src/store/settings-store.ts +++ b/src/store/settings-store.ts @@ -50,7 +50,8 @@ function createSettingsStore() { const syncClipboard = async () => invokeCommand(InvokeCommand.SyncClipboardHistory); - const openWindow = async (windowName: WebWindow) => invokeCommand(InvokeCommand.OpenNewWindow, { windowName }); + const openWindow = async (windowName: WebWindow, title: string) => + invokeCommand(InvokeCommand.OpenNewWindow, { windowName, title }); const exitApp = async () => invokeCommand(InvokeCommand.ExitApp); diff --git a/src/types/tauri-invoke.ts b/src/types/tauri-invoke.ts index ecf3c8bd..562306d3 100644 --- a/src/types/tauri-invoke.ts +++ b/src/types/tauri-invoke.ts @@ -95,7 +95,7 @@ export interface TauriInvokeCommands { // Window commands [InvokeCommand.OpenNewWindow]: { - args: { windowName: WebWindow }; + args: { windowName: WebWindow, title: string }; return: void; }; [InvokeCommand.OpenBrowserUrl]: {