From c7e3af0c22a4277b4d145b8b26db6e26344382b7 Mon Sep 17 00:00:00 2001 From: Zeedif Date: Sat, 26 Sep 2026 11:58:15 -0600 Subject: [PATCH] fix(i18n): wire Maintenance, Hatch and Fast Setup text to the Spanish catalogue Co-Authored-By: Claude Sonnet 5 --- src/common/messages/combinedMessages.prod.ts | 93 +++++++++++++++ src/common/messagesJson/en.json | 22 ++++ src/common/messagesJson/es.json | 22 ++++ src/common/messagesYAML/en.yaml | 22 ++++ src/common/messagesYAML/es.yaml | 22 ++++ .../SettingDialogue/PaneCustomisationSync.ts | 17 ++- .../features/SettingDialogue/PaneHatch.ts | 28 ++--- .../SettingDialogue/PaneMaintenance.ts | 108 +++++++++--------- .../features/SettingDialogue/PanePatches.ts | 32 +++--- .../SettingDialogue/PanePowerUsers.ts | 19 +-- .../SettingDialogue/PaneRemoteConfig.ts | 8 +- .../features/SettingDialogue/PaneSelector.ts | 31 ++--- src/serviceFeatures/redFlag.simpleFetch.ts | 80 ++++++++----- 13 files changed, 363 insertions(+), 141 deletions(-) diff --git a/src/common/messages/combinedMessages.prod.ts b/src/common/messages/combinedMessages.prod.ts index 0bcbaaf2..308cab2f 100644 --- a/src/common/messages/combinedMessages.prod.ts +++ b/src/common/messages/combinedMessages.prod.ts @@ -681,6 +681,10 @@ export const allMessages: Readonly Storage": "Database -> Storage", "Database Adapter": "Database Adapter", @@ -159,6 +163,8 @@ "Delete all data on the remote server.": "Delete all data on the remote server.", "Delete All of": "Delete All of", "Delete local database to reset or uninstall Self-hosted LiveSync": "Delete local database to reset or uninstall Self-hosted LiveSync", + "Delete local files if deleted on remote": "Delete local files if deleted on remote", + "Delete local files if not on remote": "Delete local files if not on remote", "Delete old metadata of deleted files on start-up": "Delete old metadata of deleted files on start-up", "Delete Remote Configuration": "Delete Remote Configuration", "Delete remote configuration '{name}'?": "Delete remote configuration '{name}'?", @@ -283,6 +289,7 @@ "File to view History": "File to view History", "Filename": "Filename", "Final Confirmation: Overwrite Server Data with This Device's Files": "Final Confirmation: Overwrite Server Data with This Device's Files", + "Finalise the process and resume normal operation": "Finalise the process and resume normal operation", "First, please select the option that best describes your current situation.": "First, please select the option that best describes your current situation.", "Fix": "Fix", "Flag and restart": "Flag and restart", @@ -311,7 +318,9 @@ "Hide password": "Hide password", "Higher (${local} > ${remote})": "Higher (${local} > ${remote})", "Highlight diff": "Highlight diff", + "How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.", "How to display network errors when the sync server is unreachable.": "How to display network errors when the sync server is unreachable.", + "How to handle extra existing local files?": "How to handle extra existing local files?", "How would you like to configure the connection to your server?": "How would you like to configure the connection to your server?", "However, This should not be enabled if you want to increase your secrecy more.": "However, This should not be enabled if you want to increase your secrecy more.", "I am adding a device to an existing synchronisation setup": "I am adding a device to an existing synchronisation setup", @@ -326,6 +335,8 @@ "I understand that this action is irreversible once performed.": "I understand that this action is irreversible once performed.", "I understand the risks and will proceed without a backup.": "I understand the risks and will proceed without a backup.", "I Understand, Overwrite Server": "I Understand, Overwrite Server", + "I'm ready, unlock the database": "I'm ready, unlock the database", + "I've made a backup, mark this device 'resolved'": "I've made a backup, mark this device 'resolved'", "If \"Auto Start P2P Connection\" is enabled, the P2P connection will be started automatically when the plug-in launches.": "If \"Auto Start P2P Connection\" is enabled, the P2P connection will be started automatically when the plug-in launches.", "If disabled(toggled), chunks will be split on the UI thread (Previous behaviour).": "If disabled(toggled), chunks will be split on the UI thread (Previous behaviour).", "If enabled per-filed efficient customization sync will be used. We need a small migration when enabling this. And all devices should be updated to v0.23.18. Once we enabled this, we lost a compatibility with old versions.": "If enabled per-filed efficient customization sync will be used. We need a small migration when enabling this. And all devices should be updated to v0.23.18. Once we enabled this, we lost a compatibility with old versions.", @@ -379,6 +390,8 @@ "K.short_p2p_sync": "P2P Sync", "K.title_p2p_sync": "Peer-to-Peer Sync", "Keep empty folder": "Keep empty folder", + "Keep local files even if deleted on remote": "Keep local files even if deleted on remote", + "Keep local files even if not on remote": "Keep local files even if not on remote", "lang_def": "Default", "lang-de": "Deutsche", "lang-def": "%{lang_def}", @@ -742,6 +755,7 @@ "Open the dialog": "Open the dialog", "Other files": "Other files", "Overwrite": "Overwrite", + "Overwrite all with remote files": "Overwrite all with remote files", "Overwrite patterns": "Overwrite patterns", "Overwrite remote": "Overwrite remote", "Overwrite remote with local DB and passphrase.": "Overwrite remote with local DB and passphrase.", @@ -833,6 +847,7 @@ "PureJS fallback (Fast, W/O WebAssembly)": "PureJS fallback (Fast, W/O WebAssembly)", "Purge all download/upload cache.": "Purge all download/upload cache.", "Purge all journal counter": "Purge all journal counter", + "Reboot to re-run the process": "Reboot to re-run the process", "Rebuild local and remote database with local files.": "Rebuild local and remote database with local files.", "Rebuilding Operations (Remote Only)": "Rebuilding Operations (Remote Only)", "Recovery and Repair": "Recovery and Repair", @@ -1036,9 +1051,11 @@ "Show verbose log. Please enable if you report an issue.": "Show verbose log. Please enable if you report an issue.", "Signaling Server Connection": "Signaling Server Connection", "Signalling Status": "Signalling Status", + "Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.", "Skip and close": "Skip and close", "Snippets": "Snippets", "Some devices have differing progress values (max: ${maxProgress}, min: ${minProgress}).\nThis may indicate that some devices have not completed synchronisation, which could lead to conflicts. Strongly recommend confirming that all devices are synchronised before proceeding.": "Some devices have differing progress values (max: ${maxProgress}, min: ${minProgress}).\nThis may indicate that some devices have not completed synchronisation, which could lead to conflicts. Strongly recommend confirming that all devices are synchronised before proceeding.", + "Some files failed to synchronise. What would you like to do?": "Some files failed to synchronise. What would you like to do?", "Start Broadcasting": "Start Broadcasting", "Start change-broadcasting on Connect": "Start change-broadcasting on Connect", "Start Sync & Close": "Start Sync & Close", @@ -1065,6 +1082,7 @@ "Sync on Save": "Sync on Save", "Sync on Startup": "Sync on Startup", "Sync once": "Sync once", + "Synchronisation Issues Detected": "Synchronisation Issues Detected", "Synchronisation utilising journal files. You must have set up an S3/MinIO/R2 compatible object storage.": "Synchronisation utilising journal files. You must have set up an S3/MinIO/R2 compatible object storage.", "Synchronising files": "Synchronising files", "Syncing": "Syncing", @@ -1087,6 +1105,7 @@ "The maximum number of chunks that can be incubated within the document. Chunks exceeding this number will immediately graduate to independent chunks.": "The maximum number of chunks that can be incubated within the document. Chunks exceeding this number will immediately graduate to independent chunks.", "The maximum total size of chunks that can be incubated within the document. Chunks exceeding this size will immediately graduate to independent chunks.": "The maximum total size of chunks that can be incubated within the document. Chunks exceeding this size will immediately graduate to independent chunks.", "The minimum interval for automatic synchronisation on event.": "The minimum interval for automatic synchronisation on event.", + "The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.": "The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.", "The remote is already set up, and the configuration is compatible (or got compatible by this operation).": "The remote is already set up, and the configuration is compatible (or got compatible by this operation).", "The Setup-URI does not appear to be valid. Please check that you have copied it correctly.": "The Setup-URI does not appear to be valid. Please check that you have copied it correctly.", "The Setup-URI is valid and ready to use.": "The Setup-URI is valid and ready to use.", @@ -1113,6 +1132,7 @@ "This will rebuild the local database on this device using the most recent data from the server. This action is designed to resolve synchronisation inconsistencies and restore correct functionality.": "This will rebuild the local database on this device using the most recent data from the server. This action is designed to resolve synchronisation inconsistencies and restore correct functionality.", "This will recreate chunks for all files. If there were missing chunks, this may fix the errors.": "This will recreate chunks for all files. If there were missing chunks, this may fix the errors.", "To minimise the creation of new conflicts": "To minimise the creation of new conflicts", + "To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication": "To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication", "Transfer Tweak": "Transfer Tweak", "TURN Credential": "TURN Credential", "TURN server settings are only necessary if you are behind a strict NAT or firewall that prevents direct P2P connections. In most cases, you can leave these fields blank.": "TURN server settings are only necessary if you are behind a strict NAT or firewall that prevents direct P2P connections. In most cases, you can leave these fields blank.", @@ -1449,6 +1469,7 @@ "Use Random Number": "Use Random Number", "Use Segmented-splitter": "Use Segmented-splitter", "Use splitting-limit-capped chunk splitter": "Use splitting-limit-capped chunk splitter", + "Use the detailed flow": "Use the detailed flow", "Use the trash bin": "Use the trash bin", "Use timeouts instead of heartbeats": "Use timeouts instead of heartbeats", "Use vrtmrz's relay": "Use vrtmrz's relay", @@ -1459,6 +1480,7 @@ "Verify and repair all files": "Verify and repair all files", "Warning! This will have a serious impact on performance. And the logs will not be synchronised under the default name. Please be careful with logs; they often contain your confidential information.": "Warning! This will have a serious impact on performance. And the logs will not be synchronised under the default name. Please be careful with logs; they often contain your confidential information.", "WATCHING": "WATCHING", + "We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.": "We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.", "We can not use \"/\" to the device name": "We can not use \"/\" to the device name", "We can use only Secure (HTTPS) connections on Obsidian Mobile.": "We can use only Secure (HTTPS) connections on Obsidian Mobile.", "We cannot change the device name while this feature is enabled. Please disable this feature to change the device name.": "We cannot change the device name while this feature is enabled. Please disable this feature to change the device name.", diff --git a/src/common/messagesJson/es.json b/src/common/messagesJson/es.json index 842e0805..d97e7b50 100644 --- a/src/common/messagesJson/es.json +++ b/src/common/messagesJson/es.json @@ -84,6 +84,7 @@ "Bucket Name": "Nombre del bucket", "by resetting the remote, you will be informed on other devices.": "al restablecer el remoto, se te avisará en los demás dispositivos.", "Cancel": "Cancelar", + "Cancel all and reboot": "Cancelar todo y reiniciar", "Cancel Garbage Collection": "Cancelar la recolección de basura", "Changing the encryption algorithm will prevent access to any data previously encrypted with a different algorithm. Ensure that all your devices are configured to use the same algorithm to maintain access to your data.": "Cambiar el algoritmo de cifrado impedirá acceder a los datos cifrados previamente con otro algoritmo. Asegúrate de que todos tus dispositivos usen el mismo algoritmo para no perder el acceso a tus datos.", "Changing this setting requires migrating existing data (a bit time may be taken) and restarting Obsidian. Please make sure to back up your data before proceeding.": "Cambiar este ajuste requiere migrar los datos existentes (puede tardar un poco) y reiniciar Obsidian. Asegúrate de hacer una copia de seguridad de tus datos antes de continuar.", @@ -107,6 +108,7 @@ "Compaction on remote database timed out.": "La compactación de la base de datos remota ha superado el tiempo de espera.", "Compare file": "Comparar archivo", "Compare the content of files between on local database and storage. If not matched, you will be asked which one you want to keep.": "Compara el contenido de los archivos entre la base de datos local y el almacenamiento. Si no coinciden, se te preguntará cuál deseas conservar.", + "Compare time and take newer": "Comparar fechas y usar la más reciente", "Compatibility (Conflict Behaviour)": "Compatibilidad (comportamiento de conflictos)", "Compatibility (Database structure)": "Compatibilidad (estructura de la base de datos)", "Compatibility (Internal API Usage)": "Compatibilidad (uso de la API interna)", @@ -122,6 +124,7 @@ "Configure E2EE": "Configurar E2EE", "Configure Remote": "Configurar remoto", "Configure the same server information as your other devices again, manually, very advanced users only.": "Configure manualmente la misma información del servidor que en sus otros dispositivos. Solo para usuarios muy avanzados。", + "Conflict & Deletion Options": "Opciones de conflictos y eliminación", "Connect": "Conectar", "Connect to existing database and continue": "Conectar a la base de datos existente y continuar", "Connected to Signaling Server (as Peer ID: ${peerId})": "Conectado al servidor de señalización (como ID de par: ${peerId})", @@ -146,6 +149,7 @@ "Customization Sync": "Sincronización de personalización", "Customization Sync (Beta3)": "Sincronización de personalización (Beta3)", "Data Compression": "Compresión de datos", + "Data retrieval scheduled": "Obtención de datos programada", "Data to Copy": "Datos a copiar", "Database -> Storage": "Base de datos -> Almacenamiento", "Database Adapter": "Adaptador de base de datos", @@ -160,6 +164,8 @@ "Delete all data on the remote server.": "Eliminar todos los datos del servidor remoto.", "Delete All of": "Eliminar todo de", "Delete local database to reset or uninstall Self-hosted LiveSync": "Eliminar la base de datos local para restablecer o desinstalar Self-hosted LiveSync", + "Delete local files if deleted on remote": "Eliminar los archivos locales si se eliminaron en el remoto", + "Delete local files if not on remote": "Eliminar los archivos locales que no estén en el remoto", "Delete old metadata of deleted files on start-up": "Borrar metadatos viejos al iniciar", "Delete Remote Configuration": "Eliminar configuración remota", "Delete remote configuration '{name}'?": "¿Eliminar la configuración remota '{name}'?", @@ -284,6 +290,7 @@ "File to view History": "Archivo cuyo historial se va a ver", "Filename": "Nombre de archivo", "Final Confirmation: Overwrite Server Data with This Device's Files": "Confirmación final: sobrescribir los datos del servidor con los archivos de este dispositivo", + "Finalise the process and resume normal operation": "Finalizar el proceso y reanudar el funcionamiento normal", "First, please select the option that best describes your current situation.": "Primero, seleccione la opción que describa mejor su situación actual。", "Fix": "Corregir", "Flag and restart": "Marcar y reiniciar", @@ -312,7 +319,9 @@ "Hide password": "Ocultar contraseña", "Higher (${local} > ${remote})": "Superior (${local} > ${remote})", "Highlight diff": "Resaltar las diferencias", + "How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "¿Cómo se deben gestionar los archivos que se eliminaron en otros dispositivos?\n\n- **${NEWER_CLEANUP}**: elimina los archivos locales si se eliminaron en el remoto.\n Es útil si quieres mantener tu vault limpio y coherente entre dispositivos; asegúrate de tener una copia de seguridad si ya tienes datos importantes en tu vault.\n- **${NEWER_SYNC_ALL}**: vuelve a crear los archivos remotos aunque se hayan eliminado en el remoto.\n Esta opción mantiene todos tus archivos locales, pero puede causar duplicados si hay archivos que existen en local pero no en el remoto. Puedes limpiar esos duplicados manualmente después de sincronizar.", "How to display network errors when the sync server is unreachable.": "Cómo mostrar los errores de red cuando el servidor de sincronización no está disponible.", + "How to handle extra existing local files?": "¿Cómo gestionar los archivos locales adicionales?", "How would you like to configure the connection to your server?": "¿Cómo desea configurar la conexión con su servidor?", "However, This should not be enabled if you want to increase your secrecy more.": "Sin embargo, esto no debería habilitarse si quieres aumentar aún más tu privacidad.", "I am adding a device to an existing synchronisation setup": "Estoy agregando un dispositivo a una configuración de sincronización existente", @@ -327,6 +336,8 @@ "I understand that this action is irreversible once performed.": "Entiendo que esta acción es irreversible una vez realizada.", "I understand the risks and will proceed without a backup.": "Entiendo los riesgos y continuaré sin copia de seguridad.", "I Understand, Overwrite Server": "Lo entiendo, sobrescribir el servidor", + "I'm ready, unlock the database": "Estoy listo, desbloquear la base de datos", + "I've made a backup, mark this device 'resolved'": "Ya hice una copia de seguridad, marcar este dispositivo como «resuelto»", "If \"Auto Start P2P Connection\" is enabled, the P2P connection will be started automatically when the plug-in launches.": "Si «Iniciar la conexión P2P automáticamente» está activado, la conexión P2P se iniciará al arrancar el complemento.", "If disabled(toggled), chunks will be split on the UI thread (Previous behaviour).": "Si se desactiva, chunks se dividen en hilo UI (comportamiento anterior)", "If enabled per-filed efficient customization sync will be used. We need a small migration when enabling this. And all devices should be updated to v0.23.18. Once we enabled this, we lost a compatibility with old versions.": "Habilita sincronización eficiente por archivo. Requiere migración y actualizar todos dispositivos a v0.23.18. Pierde compatibilidad con versiones antiguas", @@ -380,6 +391,8 @@ "K.short_p2p_sync": "Sincronización P2P", "K.title_p2p_sync": "Sincronización punto a punto", "Keep empty folder": "Mantener carpetas vacías", + "Keep local files even if deleted on remote": "Mantener los archivos locales aunque se hayan eliminado en el remoto", + "Keep local files even if not on remote": "Mantener los archivos locales aunque no estén en el remoto", "lang_def": "Predeterminado", "lang-de": "Alemán", "lang-def": "%{lang_def}", @@ -734,6 +747,7 @@ "Open the dialog": "Abrir el diálogo", "Other files": "Otros archivos", "Overwrite": "Sobrescribir", + "Overwrite all with remote files": "Sobrescribir todo con los archivos remotos", "Overwrite patterns": "Patrones de sobrescritura", "Overwrite remote": "Sobrescribir remoto", "Overwrite remote with local DB and passphrase.": "Sobrescribe el remoto con la base de datos local y la frase de contraseña.", @@ -825,6 +839,7 @@ "PureJS fallback (Fast, W/O WebAssembly)": "Alternativa PureJS (rápida, sin WebAssembly)", "Purge all download/upload cache.": "Purga toda la caché de descarga y carga.", "Purge all journal counter": "Purgar todos los contadores del diario", + "Reboot to re-run the process": "Reiniciar para volver a ejecutar el proceso", "Rebuild local and remote database with local files.": "Reconstruye la base de datos local y remota usando los archivos locales.", "Rebuilding Operations (Remote Only)": "Operaciones de reconstrucción (solo remoto)", "Recovery and Repair": "Recuperación y reparación", @@ -1069,9 +1084,11 @@ "Show verbose log. Please enable if you report an issue.": "Mostrar registro detallado. Actívelo si reporta un problema.", "Signaling Server Connection": "Conexión al servidor de señalización", "Signalling Status": "Estado de la señalización", + "Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "Como has elegido sobrescribir todos los archivos locales con los datos remotos, **¿cómo quieres gestionar los archivos locales que no existen en la base de datos remota?**\n\n- **${DELETE_ALL}**: se eliminarán los archivos que solo existen en local y los que se han borrado en el remoto.\n Esta opción hará que tu vault local sea exactamente igual que la base de datos remota; asegúrate de tener una copia de seguridad si tienes datos importantes en tu vault.\n- **${DELETE_NONE}**: se conservarán todos los archivos locales existentes.\n Esta opción mantiene todos tus archivos locales, pero puede causar duplicados si hay archivos que existen en local pero no en el remoto. Puedes limpiar esos duplicados manualmente después de sincronizar.", "Skip and close": "Omitir y cerrar", "Snippets": "Fragmentos", "Some devices have differing progress values (max: ${maxProgress}, min: ${minProgress}).\nThis may indicate that some devices have not completed synchronisation, which could lead to conflicts. Strongly recommend confirming that all devices are synchronised before proceeding.": "Algunos dispositivos tienen valores de progreso distintos (máx.: ${maxProgress}, mín.: ${minProgress}).\nEsto puede indicar que algunos no han terminado de sincronizar, lo que podría provocar conflictos. Se recomienda encarecidamente confirmar que todos los dispositivos están sincronizados antes de continuar.", + "Some files failed to synchronise. What would you like to do?": "Algunos archivos no se pudieron sincronizar. ¿Qué quieres hacer?", "Start Broadcasting": "Iniciar difusión", "Start change-broadcasting on Connect": "Iniciar la difusión de cambios al conectar", "Start Sync & Close": "Iniciar sincronización y cerrar", @@ -1098,6 +1115,7 @@ "Sync on Save": "Sincronizar al guardar", "Sync on Startup": "Sincronizar al iniciar", "Sync once": "Sincronizar una vez", + "Synchronisation Issues Detected": "Se han detectado problemas de sincronización", "Synchronisation utilising journal files. You must have set up an S3/MinIO/R2 compatible object storage.": "Sincronización mediante archivos de registro. Debe haber configurado un almacenamiento de objetos compatible con S3/MinIO/R2。", "Synchronising files": "Archivos sincronizados", "Syncing": "Sincronización", @@ -1119,6 +1137,7 @@ "The maximum number of chunks that can be incubated within the document. Chunks exceeding this number will immediately graduate to independent chunks.": "Número máximo de chunks que pueden incubarse en el documento. Excedentes se independizan", "The maximum total size of chunks that can be incubated within the document. Chunks exceeding this size will immediately graduate to independent chunks.": "Tamaño total máximo de chunks incubados. Excedentes se independizan", "The minimum interval for automatic synchronisation on event.": "Intervalo mínimo para la sincronización automática al producirse un evento.", + "The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.": "La base de datos remota se ha bloqueado para la sincronización con el fin de evitar la corrupción del vault, porque este dispositivo no está marcado como «resuelto». Haz una copia de seguridad de tu vault, restablece la base de datos local y selecciona «Marcar este dispositivo como resuelto». Este aviso persistirá hasta que la réplica confirme que el dispositivo está resuelto.", "The remote is already set up, and the configuration is compatible (or got compatible by this operation).": "El remoto ya está configurado y la configuración es compatible (o pasa a serlo con esta operación).", "The Setup-URI does not appear to be valid. Please check that you have copied it correctly.": "El Setup-URI no parece válido. Comprueba que lo hayas copiado correctamente.", "The Setup-URI is valid and ready to use.": "El Setup-URI es válido y está listo para usarse.", @@ -1145,6 +1164,7 @@ "This will rebuild the local database on this device using the most recent data from the server. This action is designed to resolve synchronisation inconsistencies and restore correct functionality.": "Esto reconstruirá la base de datos local de este dispositivo con los datos más recientes del servidor. La acción está pensada para resolver inconsistencias de sincronización y restaurar el funcionamiento correcto.", "This will recreate chunks for all files. If there were missing chunks, this may fix the errors.": "Esto recreará los fragmentos de todos los archivos. Si faltaban fragmentos, esto puede corregir los errores.", "To minimise the creation of new conflicts": "Para minimizar la creación de nuevos conflictos", + "To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication": "Para evitar una corrupción no deseada del vault, la base de datos remota se ha bloqueado para la sincronización. (Este dispositivo está marcado como «resuelto») Cuando todos tus dispositivos estén marcados como «resueltos», desbloquea la base de datos. Este aviso seguirá apareciendo hasta que la réplica confirme que el dispositivo está resuelto", "Transfer Tweak": "Ajustes de transferencia", "TURN Credential": "Credencial de TURN", "TURN server settings are only necessary if you are behind a strict NAT or firewall that prevents direct P2P connections. In most cases, you can leave these fields blank.": "Los ajustes del servidor TURN solo son necesarios si estás detrás de un NAT estricto o de un cortafuegos que impide las conexiones P2P directas. En la mayoría de los casos puedes dejar estos campos vacíos.", @@ -1457,6 +1477,7 @@ "Use Random Number": "Usar número aleatorio", "Use Segmented-splitter": "Usar divisor segmentado", "Use splitting-limit-capped chunk splitter": "Usar divisor de chunks con límite", + "Use the detailed flow": "Usar el flujo detallado", "Use the trash bin": "Usar papelera", "Use timeouts instead of heartbeats": "Usar timeouts en lugar de latidos", "Use vrtmrz's relay": "Usar el relé de vrtmrz", @@ -1467,6 +1488,7 @@ "Verify and repair all files": "Verificar y reparar todos los archivos", "Warning! This will have a serious impact on performance. And the logs will not be synchronised under the default name. Please be careful with logs; they often contain your confidential information.": "¡Advertencia! Impacta rendimiento. Los logs no se sincronizan con nombre predeterminado. Contienen información confidencial", "WATCHING": "OBSERVANDO", + "We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.": "Vamos a obtener los datos remotos.\n\nEn primer lugar, ¿cómo quieres gestionar los datos obtenidos de este origen remoto?\n\n- **${NEWER_WINS}**: compara la fecha de modificación de los archivos y usa la más reciente.\n Si has estado usando Self-hosted LiveSync y has hecho cambios en varios dispositivos, esta opción puede ser adecuada, ya que intenta combinar los cambios según la fecha de modificación.\n- **${REMOTE_WINS}**: los datos remotos son la fuente de la verdad.\n Si eres nuevo en Self-hosted LiveSync, esta opción puede ser la más fácil de entender para empezar.\n Sobrescribirá todos tus archivos locales con los datos remotos, así que asegúrate de tener una copia de seguridad si tienes datos importantes en tu vault.\n- **${DETAILED}**: abre el asistente de configuración detallado.\n Si quieres tener más control sobre el proceso de sincronización, o revisar los cambios antes de aplicarlos, elige esta opción para usar el flujo detallado.", "We can not use \"/\" to the device name": "No se puede usar \"/\" en el nombre del dispositivo", "We can use only Secure (HTTPS) connections on Obsidian Mobile.": "En Obsidian Mobile solo se pueden usar conexiones seguras (HTTPS).", "We cannot change the device name while this feature is enabled. Please disable this feature to change the device name.": "No podemos cambiar el nombre del dispositivo mientras esta función esté habilitada. Deshabilita la función para cambiarlo.", diff --git a/src/common/messagesYAML/en.yaml b/src/common/messagesYAML/en.yaml index bbc7d996..d796ed7f 100644 --- a/src/common/messagesYAML/en.yaml +++ b/src/common/messagesYAML/en.yaml @@ -31,6 +31,28 @@ (RegExp) If this is set, any changes to local and remote files that match this will be skipped.: (RegExp) If this is set, any changes to local and remote files that match this will be skipped. +"Cancel all and reboot": "Cancel all and reboot" +"Compare time and take newer": "Compare time and take newer" +"Conflict & Deletion Options": "Conflict & Deletion Options" +"Data retrieval scheduled": "Data retrieval scheduled" +"Delete local files if deleted on remote": "Delete local files if deleted on remote" +"Delete local files if not on remote": "Delete local files if not on remote" +"Finalise the process and resume normal operation": "Finalise the process and resume normal operation" +"How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation." +"How to handle extra existing local files?": "How to handle extra existing local files?" +"I'm ready, unlock the database": "I'm ready, unlock the database" +"I've made a backup, mark this device 'resolved'": "I've made a backup, mark this device 'resolved'" +"Keep local files even if deleted on remote": "Keep local files even if deleted on remote" +"Keep local files even if not on remote": "Keep local files even if not on remote" +"Overwrite all with remote files": "Overwrite all with remote files" +"Reboot to re-run the process": "Reboot to re-run the process" +"Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation." +"Some files failed to synchronise. What would you like to do?": "Some files failed to synchronise. What would you like to do?" +"Synchronisation Issues Detected": "Synchronisation Issues Detected" +"The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.": "The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication." +"To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication": "To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication" +"Use the detailed flow": "Use the detailed flow" +"We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.": "We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow." "↑: Overwrite Remote": "↑: Overwrite Remote" "↓: Overwrite Local": "↓: Overwrite Local" "⇅: Use newer": "⇅: Use newer" diff --git a/src/common/messagesYAML/es.yaml b/src/common/messagesYAML/es.yaml index cdb2822a..0ca30fa0 100644 --- a/src/common/messagesYAML/es.yaml +++ b/src/common/messagesYAML/es.yaml @@ -27,6 +27,28 @@ (RegExp) If this is set, any changes to local and remote files that match this will be skipped.: (RegExp) Si se establece, se omitirá cualquier cambio en archivos locales y remotos que coincida con este patrón. +"Cancel all and reboot": "Cancelar todo y reiniciar" +"Compare time and take newer": "Comparar fechas y usar la más reciente" +"Conflict & Deletion Options": "Opciones de conflictos y eliminación" +"Data retrieval scheduled": "Obtención de datos programada" +"Delete local files if deleted on remote": "Eliminar los archivos locales si se eliminaron en el remoto" +"Delete local files if not on remote": "Eliminar los archivos locales que no estén en el remoto" +"Finalise the process and resume normal operation": "Finalizar el proceso y reanudar el funcionamiento normal" +"How should files that were deleted on other devices be handled?\n\n- **${NEWER_CLEANUP}**: Delete local files if they were deleted on remote.\n This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault.\n- **${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "¿Cómo se deben gestionar los archivos que se eliminaron en otros dispositivos?\n\n- **${NEWER_CLEANUP}**: elimina los archivos locales si se eliminaron en el remoto.\n Es útil si quieres mantener tu vault limpio y coherente entre dispositivos; asegúrate de tener una copia de seguridad si ya tienes datos importantes en tu vault.\n- **${NEWER_SYNC_ALL}**: vuelve a crear los archivos remotos aunque se hayan eliminado en el remoto.\n Esta opción mantiene todos tus archivos locales, pero puede causar duplicados si hay archivos que existen en local pero no en el remoto. Puedes limpiar esos duplicados manualmente después de sincronizar." +"How to handle extra existing local files?": "¿Cómo gestionar los archivos locales adicionales?" +"I'm ready, unlock the database": "Estoy listo, desbloquear la base de datos" +"I've made a backup, mark this device 'resolved'": "Ya hice una copia de seguridad, marcar este dispositivo como «resuelto»" +"Keep local files even if deleted on remote": "Mantener los archivos locales aunque se hayan eliminado en el remoto" +"Keep local files even if not on remote": "Mantener los archivos locales aunque no estén en el remoto" +"Overwrite all with remote files": "Sobrescribir todo con los archivos remotos" +"Reboot to re-run the process": "Reiniciar para volver a ejecutar el proceso" +"Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?**\n\n- **${DELETE_ALL}**: Local-only files and remote-deleted files will be removed.\n This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault.\n- **${DELETE_NONE}**: All existing local files will be preserved.\n This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.": "Como has elegido sobrescribir todos los archivos locales con los datos remotos, **¿cómo quieres gestionar los archivos locales que no existen en la base de datos remota?**\n\n- **${DELETE_ALL}**: se eliminarán los archivos que solo existen en local y los que se han borrado en el remoto.\n Esta opción hará que tu vault local sea exactamente igual que la base de datos remota; asegúrate de tener una copia de seguridad si tienes datos importantes en tu vault.\n- **${DELETE_NONE}**: se conservarán todos los archivos locales existentes.\n Esta opción mantiene todos tus archivos locales, pero puede causar duplicados si hay archivos que existen en local pero no en el remoto. Puedes limpiar esos duplicados manualmente después de sincronizar." +"Some files failed to synchronise. What would you like to do?": "Algunos archivos no se pudieron sincronizar. ¿Qué quieres hacer?" +"Synchronisation Issues Detected": "Se han detectado problemas de sincronización" +"The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.": "La base de datos remota se ha bloqueado para la sincronización con el fin de evitar la corrupción del vault, porque este dispositivo no está marcado como «resuelto». Haz una copia de seguridad de tu vault, restablece la base de datos local y selecciona «Marcar este dispositivo como resuelto». Este aviso persistirá hasta que la réplica confirme que el dispositivo está resuelto." +"To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication": "Para evitar una corrupción no deseada del vault, la base de datos remota se ha bloqueado para la sincronización. (Este dispositivo está marcado como «resuelto») Cuando todos tus dispositivos estén marcados como «resueltos», desbloquea la base de datos. Este aviso seguirá apareciendo hasta que la réplica confirme que el dispositivo está resuelto" +"Use the detailed flow": "Usar el flujo detallado" +"We are about to retrieve the remote data.\n\nFirstly, how shall we handle the data retrieved from this remote source?\n\n- **${NEWER_WINS}**: Compares the modified time of files and takes the newer one.\n If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time.\n- **${REMOTE_WINS}**: Remote data is the source of truth.\n If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with.\n It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault.\n- **${DETAILED}**: Opens the detailed setup wizard.\n If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.": "Vamos a obtener los datos remotos.\n\nEn primer lugar, ¿cómo quieres gestionar los datos obtenidos de este origen remoto?\n\n- **${NEWER_WINS}**: compara la fecha de modificación de los archivos y usa la más reciente.\n Si has estado usando Self-hosted LiveSync y has hecho cambios en varios dispositivos, esta opción puede ser adecuada, ya que intenta combinar los cambios según la fecha de modificación.\n- **${REMOTE_WINS}**: los datos remotos son la fuente de la verdad.\n Si eres nuevo en Self-hosted LiveSync, esta opción puede ser la más fácil de entender para empezar.\n Sobrescribirá todos tus archivos locales con los datos remotos, así que asegúrate de tener una copia de seguridad si tienes datos importantes en tu vault.\n- **${DETAILED}**: abre el asistente de configuración detallado.\n Si quieres tener más control sobre el proceso de sincronización, o revisar los cambios antes de aplicarlos, elige esta opción para usar el flujo detallado." "↑: Overwrite Remote": "↑: Sobrescribir remoto" "↓: Overwrite Local": "↓: Sobrescribir local" "⇅: Use newer": "⇅: Usar el más nuevo" diff --git a/src/modules/features/SettingDialogue/PaneCustomisationSync.ts b/src/modules/features/SettingDialogue/PaneCustomisationSync.ts index 927050de..e6f48149 100644 --- a/src/modules/features/SettingDialogue/PaneCustomisationSync.ts +++ b/src/modules/features/SettingDialogue/PaneCustomisationSync.ts @@ -3,6 +3,7 @@ import { EVENT_REQUEST_OPEN_PLUGIN_SYNC_DIALOG, eventHub } from "@/common/events import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; import { enableOnly, visibleOnly } from "./SettingPane.ts"; +import { $msg } from "@/common/translation"; export function paneCustomisationSync( this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, @@ -10,7 +11,7 @@ export function paneCustomisationSync( ): void { // With great respect, thank you TfTHacker! // Refer: https://github.com/TfTHacker/obsidian42-brat/blob/main/src/features/BetaPlugins.ts - void addPanel(paneEl, "Customization Sync").then((paneEl) => { + void addPanel(paneEl, $msg("Customization Sync")).then((paneEl) => { const enableOnlyOnPluginSyncIsNotEnabled = enableOnly(() => this.isConfiguredAs("usePluginSync", false)); const visibleOnlyOnPluginSyncEnabled = visibleOnly(() => this.isConfiguredAs("usePluginSync", true)); @@ -18,7 +19,9 @@ export function paneCustomisationSync( paneEl, "div", { - text: "Please set device name to identify this device. This name should be unique among your devices. While not configured, we cannot enable this feature.", + text: $msg( + "Please set device name to identify this device. This name should be unique among your devices. While not configured, we cannot enable this feature." + ), cls: "op-warn", }, (c) => {}, @@ -28,7 +31,9 @@ export function paneCustomisationSync( paneEl, "div", { - text: "We cannot change the device name while this feature is enabled. Please disable this feature to change the device name.", + text: $msg( + "We cannot change the device name while this feature is enabled. Please disable this feature to change the device name." + ), cls: "op-warn-info", }, (c) => {}, @@ -60,11 +65,11 @@ export function paneCustomisationSync( }); new Setting(paneEl) - .setName("Open") - .setDesc("Open the dialog") + .setName($msg("Open")) + .setDesc($msg("Open the dialog")) .addButton((button) => { button - .setButtonText("Open") + .setButtonText($msg("Open")) .setDisabled(false) .onClick(() => { // this.plugin.getAddOn(ConfigSync.name)?.showPluginSyncModal(); diff --git a/src/modules/features/SettingDialogue/PaneHatch.ts b/src/modules/features/SettingDialogue/PaneHatch.ts index 2426c2bc..d0653ee5 100644 --- a/src/modules/features/SettingDialogue/PaneHatch.ts +++ b/src/modules/features/SettingDialogue/PaneHatch.ts @@ -83,7 +83,7 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, .setDesc($msg("Setting.TroubleShooting.ScanBrokenFiles.Desc")) .addButton((button) => button - .setButtonText("Scan for Broken files") + .setButtonText($msg("Scan for Broken files")) .setCta() .setDisabled(false) .onClick(() => { @@ -136,7 +136,7 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, new Setting(paneEl).autoWireToggle("writeLogToTheFile"); }); - void addPanel(paneEl, "Scram Switches").then((paneEl) => { + void addPanel(paneEl, $msg("Scram Switches")).then((paneEl) => { new Setting(paneEl).autoWireToggle("suspendFileWatching"); this.addOnSaved("suspendFileWatching", () => this.services.appLifecycle.askRestart()); @@ -144,7 +144,7 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, this.addOnSaved("suspendParseReplicationResult", () => this.services.appLifecycle.askRestart()); }); - void addPanel(paneEl, "Recovery and Repair").then((paneEl) => { + void addPanel(paneEl, $msg("Recovery and Repair")).then((paneEl) => { const resultArea = paneEl.createDiv({ text: "", cls: "sls-repair-results" }); type RepairMenuAction = { title: string; @@ -1071,13 +1071,15 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, }) ); new Setting(paneEl) - .setName("Resolve All conflicted files by the newer one") + .setName($msg("Resolve All conflicted files by the newer one")) .setDesc( - "Resolve all conflicted files by the newer one. Caution: This will overwrite the older one, and cannot resurrect the overwritten one." + $msg( + "Resolve all conflicted files by the newer one. Caution: This will overwrite the older one, and cannot resurrect the overwritten one." + ) ) .addButton((button) => button - .setButtonText("Resolve All") + .setButtonText($msg("Resolve All")) .setCta() .onClick(async () => { const confirmed = @@ -1097,11 +1099,11 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, }) ); new Setting(paneEl) - .setName("Check and convert non-path-obfuscated files") + .setName($msg("Check and convert non-path-obfuscated files")) .setDesc("") .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Perform") + .setButtonText($msg("Perform")) .setDisabled(false) .onClick(async () => { for await (const docName of this.core.localDatabase.findAllDocNames()) { @@ -1174,10 +1176,10 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, }) ); }); - void addPanel(paneEl, "Reset").then((paneEl) => { - new Setting(paneEl).setName("Back to non-configured").addButton((button) => + void addPanel(paneEl, $msg("Reset")).then((paneEl) => { + new Setting(paneEl).setName($msg("Back to non-configured")).addButton((button) => button - .setButtonText("Back") + .setButtonText($msg("Back")) .setDisabled(false) .onClick(async () => { this.editingSettings.isConfigured = false; @@ -1186,9 +1188,9 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, }) ); - new Setting(paneEl).setName("Delete all customization sync data").addButton((button) => + new Setting(paneEl).setName($msg("Delete all customization sync data")).addButton((button) => setButtonDestructiveState(button) - .setButtonText("Delete") + .setButtonText($msg("Delete")) .setDisabled(false) .onClick(async () => { Logger(`Deleting customization sync data`, LOG_LEVEL_NOTICE); diff --git a/src/modules/features/SettingDialogue/PaneMaintenance.ts b/src/modules/features/SettingDialogue/PaneMaintenance.ts index 9767eb71..e66d0f22 100644 --- a/src/modules/features/SettingDialogue/PaneMaintenance.ts +++ b/src/modules/features/SettingDialogue/PaneMaintenance.ts @@ -24,7 +24,7 @@ export function paneMaintenance( paneEl, "div", { - text: "The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication.", + text: $msg("The remote database is locked for synchronization to prevent vault corruption because this device isn't marked as 'resolved'. Please backup your vault, reset the local database, and select 'Mark this device as resolved'. This warning will persist until the device is confirmed as resolved by replication."), cls: "op-warn", }, (c) => { @@ -32,7 +32,7 @@ export function paneMaintenance( c, "button", { - text: "I've made a backup, mark this device 'resolved'", + text: $msg("I've made a backup, mark this device 'resolved'"), cls: "mod-warning", }, (e) => { @@ -51,7 +51,7 @@ export function paneMaintenance( paneEl, "div", { - text: "To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication", + text: $msg("To prevent unwanted vault corruption, the remote database has been locked for synchronization. (This device is marked 'resolved') When all your devices are marked 'resolved', unlock the database. This warning kept showing until confirming the device is resolved by the replication"), cls: "op-warn", }, (c) => @@ -59,7 +59,7 @@ export function paneMaintenance( c, "button", { - text: "I'm ready, unlock the database", + text: $msg("I'm ready, unlock the database"), cls: "mod-warning", }, (e) => { @@ -74,13 +74,13 @@ export function paneMaintenance( visibleOnly(isRemoteLocked) ); - void addPanel(paneEl, "Scram!").then((paneEl) => { + void addPanel(paneEl, $msg("Scram!")).then((paneEl) => { new Setting(paneEl) - .setName("Lock Server") - .setDesc("Lock the remote server to prevent synchronization with other devices.") + .setName($msg("Lock Server")) + .setDesc($msg("Lock the remote server to prevent synchronization with other devices.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Lock") + .setButtonText($msg("Lock")) .setDisabled(false) .onClick(async () => { await this.services.replication.markLocked(); @@ -89,11 +89,11 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnCouchDBOrMinIO); new Setting(paneEl) - .setName("Emergency restart") - .setDesc("Disables all synchronization and restart.") + .setName($msg("Emergency restart")) + .setDesc($msg("Disables all synchronization and restart.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Flag and restart") + .setButtonText($msg("Flag and restart")) .setDisabled(false) .onClick(async () => { await this.core.storageAccess.writeFileAuto(FlagFilesOriginal.SUSPEND_ALL, ""); @@ -102,13 +102,13 @@ export function paneMaintenance( ); }); - void addPanel(paneEl, "Reset Synchronisation information").then((paneEl) => { + void addPanel(paneEl, $msg("Reset Synchronisation information")).then((paneEl) => { new Setting(paneEl) - .setName("Reset Synchronisation on This Device") - .setDesc("Restore or reconstruct local database from remote.") + .setName($msg("Reset Synchronisation on This Device")) + .setDesc($msg("Restore or reconstruct local database from remote.")) .addButton((button) => button - .setButtonText("Schedule and Restart") + .setButtonText($msg("Schedule and Restart")) .setCta() .setDisabled(false) .onClick(async () => { @@ -117,11 +117,11 @@ export function paneMaintenance( }) ); new Setting(paneEl) - .setName("Overwrite Server Data with This Device's Files") - .setDesc("Rebuild local and remote database with local files.") + .setName($msg("Overwrite Server Data with This Device's Files")) + .setDesc($msg("Rebuild local and remote database with local files.")) .addButton((button) => button - .setButtonText("Schedule and Restart") + .setButtonText($msg("Schedule and Restart")) .setCta() .setDisabled(false) .onClick(async () => { @@ -131,13 +131,13 @@ export function paneMaintenance( ); }); - void addPanel(paneEl, "Syncing", () => {}, this.onlyOnCouchDBOrMinIO).then((paneEl) => { + void addPanel(paneEl, $msg("Syncing"), () => {}, this.onlyOnCouchDBOrMinIO).then((paneEl) => { new Setting(paneEl) - .setName("Resend") - .setDesc("Resend all chunks to the remote.") + .setName($msg("Resend")) + .setDesc($msg("Resend all chunks to the remote.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Send chunks") + .setButtonText($msg("Send chunks")) .setDisabled(false) .onClick(async () => { if (this.core.replicator instanceof LiveSyncCouchDBReplicator) { @@ -148,13 +148,15 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnCouchDB); new Setting(paneEl) - .setName("Reset journal received history") + .setName($msg("Reset journal received history")) .setDesc( - "Initialise journal received history. On the next sync, every item except this device sent will be downloaded again." + $msg( + "Initialise journal received history. On the next sync, every item except this device sent will be downloaded again." + ) ) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Reset received") + .setButtonText($msg("Reset received")) .setDisabled(false) .onClick(async () => { await this.getMinioJournalSyncClient().updateCheckPointInfo((info) => ({ @@ -168,13 +170,15 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnMinIO); new Setting(paneEl) - .setName("Reset journal sent history") + .setName($msg("Reset journal sent history")) .setDesc( - "Initialise journal sent history. On the next sync, every item except this device received will be sent again." + $msg( + "Initialise journal sent history. On the next sync, every item except this device received will be sent again." + ) ) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Reset sent history") + .setButtonText($msg("Reset sent history")) .setDisabled(false) .onClick(async () => { await this.getMinioJournalSyncClient().updateCheckPointInfo((info) => ({ @@ -188,13 +192,13 @@ export function paneMaintenance( ) .addOnUpdate(this.onlyOnMinIO); }); - void addPanel(paneEl, "Garbage Collection V3 (Beta)", (e) => e, this.onlyOnCouchDB).then((paneEl) => { + void addPanel(paneEl, $msg("Garbage Collection V3 (Beta)"), (e) => e, this.onlyOnCouchDB).then((paneEl) => { new Setting(paneEl) - .setName("Perform Garbage Collection") - .setDesc("Perform Garbage Collection to remove unused chunks and reduce database size.") + .setName($msg("Perform Garbage Collection")) + .setDesc($msg("Perform Garbage Collection to remove unused chunks and reduce database size.")) .addButton((button) => button - .setButtonText("Perform Garbage Collection") + .setButtonText($msg("Perform Garbage Collection")) .setDisabled(false) .onClick(() => { this.closeSetting(); @@ -289,15 +293,17 @@ export function paneMaintenance( // } // ); - void addPanel(paneEl, "Rebuilding Operations (Remote Only)", () => {}, this.onlyOnCouchDBOrMinIO).then((paneEl) => { + void addPanel(paneEl, $msg("Rebuilding Operations (Remote Only)"), () => {}, this.onlyOnCouchDBOrMinIO).then((paneEl) => { new Setting(paneEl) - .setName("Perform cleanup") + .setName($msg("Perform cleanup")) .setDesc( - "Reduces storage space by discarding all non-latest revisions. This requires the same amount of free space on the remote server and the local client." + $msg( + "Reduces storage space by discarding all non-latest revisions. This requires the same amount of free space on the remote server and the local client." + ) ) .addButton((button) => button - .setButtonText("Perform") + .setButtonText($msg("Perform")) .setDisabled(false) .onClick(async () => { const replicator = this.core.replicator as LiveSyncCouchDBReplicator; @@ -312,11 +318,11 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnCouchDB); new Setting(paneEl) - .setName("Overwrite remote") - .setDesc("Overwrite remote with local DB and passphrase.") + .setName($msg("Overwrite remote")) + .setDesc($msg("Overwrite remote with local DB and passphrase.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Send") + .setButtonText($msg("Send")) .setDisabled(false) .onClick(async () => { await this.rebuildDB("remoteOnly"); @@ -324,11 +330,11 @@ export function paneMaintenance( ); new Setting(paneEl) - .setName("Reset all journal counter") - .setDesc("Initialise all journal history, On the next sync, every item will be received and sent.") + .setName($msg("Reset all journal counter")) + .setDesc($msg("Initialise all journal history, On the next sync, every item will be received and sent.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Reset all") + .setButtonText($msg("Reset all")) .setDisabled(false) .onClick(async () => { await this.getMinioJournalSyncClient().resetCheckpointInfo(); @@ -338,11 +344,11 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnMinIO); new Setting(paneEl) - .setName("Purge all journal counter") - .setDesc("Purge all download/upload cache.") + .setName($msg("Purge all journal counter")) + .setDesc($msg("Purge all download/upload cache.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Reset all") + .setButtonText($msg("Reset all")) .setDisabled(false) .onClick(() => { this.getMinioJournalSyncClient().resetAllCaches(); @@ -352,11 +358,11 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnMinIO); new Setting(paneEl) - .setName("Fresh Start Wipe") - .setDesc("Delete all data on the remote server.") + .setName($msg("Fresh Start Wipe")) + .setDesc($msg("Delete all data on the remote server.")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Delete") + .setButtonText($msg("Delete")) .setDisabled(false) .onClick(async () => { await this.getMinioJournalSyncClient().updateCheckPointInfo((info) => ({ @@ -379,7 +385,7 @@ export function paneMaintenance( .addOnUpdate(this.onlyOnMinIO); }); - void addPanel(paneEl, "Reset").then((paneEl) => { + void addPanel(paneEl, $msg("Reset")).then((paneEl) => { new Setting(paneEl) .setName($msg("obsidianLiveSyncSettingTab.nameDiscardSettings")) .addButton((button) => { @@ -405,10 +411,10 @@ export function paneMaintenance( .addOnUpdate(visibleOnly(() => this.isConfiguredAs("isConfigured", true))); new Setting(paneEl) - .setName("Delete local database to reset or uninstall Self-hosted LiveSync") + .setName($msg("Delete local database to reset or uninstall Self-hosted LiveSync")) .addButton((button) => setButtonDestructiveState(button) - .setButtonText("Delete") + .setButtonText($msg("Delete")) .setDisabled(false) .onClick(async () => { await this.services.database.resetDatabase(); diff --git a/src/modules/features/SettingDialogue/PanePatches.ts b/src/modules/features/SettingDialogue/PanePatches.ts index dbc99b7e..4e8cb83e 100644 --- a/src/modules/features/SettingDialogue/PanePatches.ts +++ b/src/modules/features/SettingDialogue/PanePatches.ts @@ -18,7 +18,7 @@ import { usesLegacyIndexedDBAdapter } from "@/common/compatibilitySettings.ts"; import { $msg } from "@/common/translation"; export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, { addPanel }: PageFunctions): void { - void addPanel(paneEl, "Compatibility (Metadata)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Metadata)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("deleteMetadataOfDeletedFiles"); new Setting(paneEl).autoWireNumeric("automaticallyDeleteMetadataOfDeletedFiles", { @@ -26,12 +26,12 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen }); }); - void addPanel(paneEl, "Compatibility (Conflict Behaviour)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Conflict Behaviour)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("disableMarkdownAutoMerge"); new Setting(paneEl).autoWireToggle("writeDocumentsIfConflicted"); }); - void addPanel(paneEl, "Compatibility (Database structure)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Database structure)")).then((paneEl) => { const migrateAllToIndexedDB = async () => { const dbToName = this.core.localDatabase.dbname + SuffixDatabaseName + ExtraSuffixIndexedDB; const options = { @@ -80,16 +80,20 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen const useIndexedDBAdapter = usesLegacyIndexedDBAdapter(this.editingSettings); const infoClass = useIndexedDBAdapter ? "op-warn" : "op-warn-info"; paneEl.createDiv({ - text: "The IndexedDB adapter often offers superior performance in certain scenarios, but it has been found to cause memory leaks when used with LiveSync mode. When using LiveSync mode, please use IDB adapter instead.", + text: $msg( + "The IndexedDB adapter often offers superior performance in certain scenarios, but it has been found to cause memory leaks when used with LiveSync mode. When using LiveSync mode, please use IDB adapter instead." + ), cls: infoClass, }); paneEl.createDiv({ - text: "Changing this setting requires migrating existing data (a bit time may be taken) and restarting Obsidian. Please make sure to back up your data before proceeding.", + text: $msg( + "Changing this setting requires migrating existing data (a bit time may be taken) and restarting Obsidian. Please make sure to back up your data before proceeding." + ), cls: "op-warn-info", }); const setting = new Setting(paneEl) - .setName("Database Adapter") - .setDesc("Select the database adapter to use. "); + .setName($msg("Database Adapter")) + .setDesc($msg("Select the database adapter to use.")); const el = setting.controlEl.createDiv({}); el.setText(`Current adapter: ${useIndexedDBAdapter ? "IndexedDB" : "IDB"}`); if (!useIndexedDBAdapter) { @@ -119,10 +123,10 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen new Setting(paneEl).autoWireToggle("handleFilenameCaseSensitive", { holdValue: true }); }); - void addPanel(paneEl, "Compatibility (Internal API Usage)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Internal API Usage)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("watchInternalFileChanges", { invert: true }); }); - void addPanel(paneEl, "Compatibility (Remote Database)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Remote Database)")).then((paneEl) => { new Setting(paneEl).autoWireDropDown("E2EEAlgorithm", { options: E2EEAlgorithmNames, }); @@ -136,7 +140,7 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen ), }); - void addPanel(paneEl, "Edge case addressing (Database)").then((paneEl) => { + void addPanel(paneEl, $msg("Edge case addressing (Database)")).then((paneEl) => { new Setting(paneEl) .autoWireText("additionalSuffixOfDatabaseName", { holdValue: true }) .addApplyButton(["additionalSuffixOfDatabaseName"]); @@ -161,13 +165,13 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen await this.core.localDatabase._prepareHashFunctions(); }); }); - void addPanel(paneEl, "Edge case addressing (Behaviour)").then((paneEl) => { + void addPanel(paneEl, $msg("Edge case addressing (Behaviour)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("doNotSuspendOnFetching"); new Setting(paneEl).autoWireToggle("doNotDeleteFolder"); new Setting(paneEl).autoWireToggle("processSizeMismatchedFiles"); }); - void addPanel(paneEl, "Edge case addressing (Processing)").then((paneEl) => { + void addPanel(paneEl, $msg("Edge case addressing (Processing)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("disableWorkerForGeneratingChunks"); new Setting(paneEl).autoWireToggle("processSmallFilesInUIThread", { @@ -177,10 +181,10 @@ export function panePatches(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElemen // void addPanel(paneEl, "Edge case addressing (Networking)").then((paneEl) => { // new Setting(paneEl).autoWireToggle("useRequestAPI"); // }); - void addPanel(paneEl, "Compatibility (Trouble addressed)").then((paneEl) => { + void addPanel(paneEl, $msg("Compatibility (Trouble addressed)")).then((paneEl) => { new Setting(paneEl).autoWireToggle("disableCheckingConfigMismatch"); }); - void addPanel(paneEl, "Remediation").then((paneEl) => { + void addPanel(paneEl, $msg("Remediation")).then((paneEl) => { const setting = setSettingAdditionalActionsState(new Setting(paneEl)); const dateEl = setting.controlEl.createSpan(); setting diff --git a/src/modules/features/SettingDialogue/PanePowerUsers.ts b/src/modules/features/SettingDialogue/PanePowerUsers.ts index 976ca827..b254544f 100644 --- a/src/modules/features/SettingDialogue/PanePowerUsers.ts +++ b/src/modules/features/SettingDialogue/PanePowerUsers.ts @@ -2,18 +2,21 @@ import { type ConfigPassphraseStore } from "@vrtmrz/livesync-commonlib/compat/co import { LiveSyncSetting as Setting } from "./LiveSyncSetting.ts"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; +import { $msg } from "@/common/translation"; export function panePowerUsers( this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, { addPanel }: PageFunctions ): void { - void addPanel(paneEl, "CouchDB Connection Tweak", undefined, this.onlyOnCouchDB).then((paneEl) => { + void addPanel(paneEl, $msg("CouchDB Connection Tweak"), undefined, this.onlyOnCouchDB).then((paneEl) => { this.createEl( paneEl, "div", { - text: `If you reached the payload size limit when using IBM Cloudant, please decrease batch size and batch limit to a lower value.`, + text: $msg( + "If you reached the payload size limit when using IBM Cloudant, please decrease batch size and batch limit to a lower value." + ), }, undefined, this.onlyOnCouchDB @@ -26,15 +29,15 @@ export function panePowerUsers( }); new Setting(paneEl).autoWireToggle("useTimeouts", { onUpdate: this.onlyOnCouchDB }); }); - void addPanel(paneEl, "Configuration Encryption").then((paneEl) => { + void addPanel(paneEl, $msg("Configuration Encryption")).then((paneEl) => { const passphrase_options: Record = { - "": "Default", - LOCALSTORAGE: "Use a custom passphrase", - ASK_AT_LAUNCH: "Ask an passphrase at every launch", + "": $msg("Default"), + LOCALSTORAGE: $msg("Use a custom passphrase"), + ASK_AT_LAUNCH: $msg("Ask a passphrase at every launch"), }; new Setting(paneEl) - .setName("Encrypting sensitive configuration items") + .setName($msg("Encrypting sensitive configuration items")) .autoWireDropDown("configPassphraseStore", { options: passphrase_options, holdValue: true, @@ -45,7 +48,7 @@ export function panePowerUsers( })); new Setting(paneEl).addApplyButton(["configPassphrase", "configPassphraseStore"]); }); - void addPanel(paneEl, "Developer").then((paneEl) => { + void addPanel(paneEl, $msg("Developer")).then((paneEl) => { new Setting(paneEl).autoWireToggle("enableDebugTools"); }); } diff --git a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts index 260ec3c0..91730b1a 100644 --- a/src/modules/features/SettingDialogue/PaneRemoteConfig.ts +++ b/src/modules/features/SettingDialogue/PaneRemoteConfig.ts @@ -106,10 +106,10 @@ export function paneRemoteConfig( info: getE2EEConfigSummary(this.editingSettings), }); }; - void addPanel(paneEl, "E2EE Configuration", () => {}).then((paneEl) => { + void addPanel(paneEl, $msg("E2EE Configuration"), () => {}).then((paneEl) => { const infoPanel = new SveltePanel(InfoPanel, paneEl, E2EESummaryWritable); this.lifetimeComponent.register(() => infoPanel.destroy()); - const setupButton = setSettingAdditionalActionsState(new Setting(paneEl).setName("Configure E2EE")); + const setupButton = setSettingAdditionalActionsState(new Setting(paneEl).setName($msg("Configure E2EE"))); setupButton .addButton((button) => setButtonDestructiveState(button) @@ -119,7 +119,7 @@ export function paneRemoteConfig( await setupManager.onlyE2EEConfiguration(UserMode.Update, originalSettings); updateE2EESummary(); }) - .setButtonText("Configure") + .setButtonText($msg("Configure")) ) .addButton((button) => setButtonDestructiveState(setButtonAdditionalActionState(button)) @@ -129,7 +129,7 @@ export function paneRemoteConfig( await setupManager.onConfigureManually(originalSettings, UserMode.Update); updateE2EESummary(); }) - .setButtonText("Configure And Change Remote") + .setButtonText($msg("Configure And Change Remote")) ); updateE2EESummary(); }); diff --git a/src/modules/features/SettingDialogue/PaneSelector.ts b/src/modules/features/SettingDialogue/PaneSelector.ts index 3a6f8e4b..582f20b9 100644 --- a/src/modules/features/SettingDialogue/PaneSelector.ts +++ b/src/modules/features/SettingDialogue/PaneSelector.ts @@ -6,12 +6,15 @@ import { mount, unmount } from "svelte"; import type { ObsidianLiveSyncSettingTab } from "./ObsidianLiveSyncSettingTab.ts"; import type { PageFunctions } from "./SettingPane.ts"; import { visibleOnly } from "./SettingPane.ts"; +import { $msg } from "@/common/translation"; export function paneSelector(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement, { addPanel }: PageFunctions): void { - void addPanel(paneEl, "Normal Files").then((paneEl) => { + void addPanel(paneEl, $msg("Normal Files")).then((paneEl) => { const syncFilesSetting = new Setting(paneEl) - .setName("Synchronising files") + .setName($msg("Synchronising files")) .setDesc( - "(RegExp) Empty to sync all files. Set filter as a regular expression to limit synchronising files." + $msg( + "(RegExp) Empty to sync all files. Set filter as a regular expression to limit synchronising files." + ) ); const syncFilesControl = mount(MultipleRegExpControl, { target: syncFilesSetting.controlEl, @@ -28,8 +31,8 @@ export function paneSelector(this: ObsidianLiveSyncSettingTab, paneEl: HTMLEleme this.lifetimeComponent.register(() => void unmount(syncFilesControl)); const nonSyncFilesSetting = new Setting(paneEl) - .setName("Non-Synchronising files") - .setDesc("(RegExp) If this is set, any changes to local and remote files that match this will be skipped."); + .setName($msg("Non-Synchronising files")) + .setDesc($msg("(RegExp) If this is set, any changes to local and remote files that match this will be skipped.")); const nonSyncFilesControl = mount(MultipleRegExpControl, { target: nonSyncFilesSetting.controlEl, @@ -51,10 +54,10 @@ export function paneSelector(this: ObsidianLiveSyncSettingTab, paneEl: HTMLEleme onUpdate: visibleOnly(() => this.isConfiguredAs("useIgnoreFiles", true)), }); }); - void addPanel(paneEl, "Hidden Files", undefined, undefined, LEVEL_ADVANCED).then((paneEl) => { + void addPanel(paneEl, $msg("Hidden Files"), undefined, undefined, LEVEL_ADVANCED).then((paneEl) => { const targetPatternSetting = new Setting(paneEl) - .setName("Target patterns") - .setDesc("Patterns to match files for syncing"); + .setName($msg("Target patterns")) + .setDesc($msg("Patterns to match files for syncing")); const patTarget = splitCustomRegExpList(this.editingSettings.syncInternalFilesTargetPatterns, ","); const targetPatternControl = mount(MultipleRegExpControl, { target: targetPatternSetting.controlEl, @@ -75,7 +78,7 @@ export function paneSelector(this: ObsidianLiveSyncSettingTab, paneEl: HTMLEleme defaultSkipPattern + ",\\/workspace$ ,\\/workspace.json$,\\/workspace-mobile.json$"; const pat = splitCustomRegExpList(this.editingSettings.syncInternalFilesIgnorePatterns, ","); - const patSetting = new Setting(paneEl).setName("Ignore patterns").setDesc(""); + const patSetting = new Setting(paneEl).setName($msg("Ignore patterns")).setDesc(""); const ignorePatternControl = mount(MultipleRegExpControl, { target: patSetting.controlEl, @@ -104,21 +107,21 @@ export function paneSelector(this: ObsidianLiveSyncSettingTab, paneEl: HTMLEleme }; new Setting(paneEl) - .setName("Add default patterns") + .setName($msg("Add default patterns")) .addButton((button) => { - button.setButtonText("Default").onClick(async () => { + button.setButtonText($msg("Default")).onClick(async () => { await addDefaultPatterns(defaultSkipPattern); }); }) .addButton((button) => { - button.setButtonText("Cross-platform").onClick(async () => { + button.setButtonText($msg("Cross-platform")).onClick(async () => { await addDefaultPatterns(defaultSkipPatternXPlat); }); }); const overwritePatterns = new Setting(paneEl) - .setName("Overwrite patterns") - .setDesc("Patterns to match files for overwriting instead of merging"); + .setName($msg("Overwrite patterns")) + .setDesc($msg("Patterns to match files for overwriting instead of merging")); const patTarget2 = splitCustomRegExpList(this.editingSettings.syncInternalFileOverwritePatterns, ","); const overwritePatternControl = mount(MultipleRegExpControl, { target: overwritePatterns.controlEl, diff --git a/src/serviceFeatures/redFlag.simpleFetch.ts b/src/serviceFeatures/redFlag.simpleFetch.ts index 90355a26..ca39ce8d 100644 --- a/src/serviceFeatures/redFlag.simpleFetch.ts +++ b/src/serviceFeatures/redFlag.simpleFetch.ts @@ -11,18 +11,19 @@ import { type FullScanOptions, } from "@vrtmrz/livesync-commonlib/compat/serviceFeatures/offlineScanner"; import { adjustSettingToRemoteIfNeeded, cancelScheduledInitialisation, processVaultInitialisation } from "./redFlag"; +import { $msg } from "@/common/translation"; -export const SIMPLE_FETCH_STAGE1_REMOTE_WINS = "Overwrite all with remote files"; -export const SIMPLE_FETCH_STAGE1_NEWER_WINS = "Compare time and take newer"; -export const SIMPLE_FETCH_STAGE1_DETAILED = "Use the detailed flow"; -export const SIMPLE_FETCH_STAGE1_CANCEL = "Cancel"; +export const SIMPLE_FETCH_STAGE1_REMOTE_WINS: string = $msg("Overwrite all with remote files"); +export const SIMPLE_FETCH_STAGE1_NEWER_WINS: string = $msg("Compare time and take newer"); +export const SIMPLE_FETCH_STAGE1_DETAILED: string = $msg("Use the detailed flow"); +export const SIMPLE_FETCH_STAGE1_CANCEL: string = $msg("Cancel"); -export const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE = "Keep local files even if not on remote"; -export const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL = "Delete local files if not on remote"; +export const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE: string = $msg("Keep local files even if not on remote"); +export const SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL: string = $msg("Delete local files if not on remote"); -export const SIMPLE_FETCH_STAGE2_NEWER_CLEANUP = "Delete local files if deleted on remote"; -export const SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL = "Keep local files even if deleted on remote"; -export const STAGE2_ABORT = "Cancel all and reboot"; +export const SIMPLE_FETCH_STAGE2_NEWER_CLEANUP: string = $msg("Delete local files if deleted on remote"); +export const SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL: string = $msg("Keep local files even if deleted on remote"); +export const STAGE2_ABORT: string = $msg("Cancel all and reboot"); const SIMPLE_FETCH_MODE_KEY = "simple-fetch-mode"; @@ -91,20 +92,26 @@ export async function askSimpleFetchMode( const remembered = getRememberedSimpleFetchMode(host); if (remembered) return remembered; - const msg = `We are about to retrieve the remote data. + const msg = $msg( + `We are about to retrieve the remote data. Firstly, how shall we handle the data retrieved from this remote source? -- **${SIMPLE_FETCH_STAGE1_NEWER_WINS}**: Compares the modified time of files and takes the newer one. +- **\${NEWER_WINS}**: Compares the modified time of files and takes the newer one. If you have been using Self-hosted LiveSync and have made changes on multiple devices, this option may be suitable for you as it tries to merge changes based on modified time. -- **${SIMPLE_FETCH_STAGE1_REMOTE_WINS}**: Remote data is the source of truth. +- **\${REMOTE_WINS}**: Remote data is the source of truth. If you are new to using Self-hosted LiveSync. This option may be easiest to understand and get started with. It will overwrite all your local files with the remote data, so please make sure you have a backup if there is any important data in your vault. -- **${SIMPLE_FETCH_STAGE1_DETAILED}**: Opens the detailed setup wizard. - If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow. - `; +- **\${DETAILED}**: Opens the detailed setup wizard. + If you want to have more control over the synchronisation process, or want to review the changes before applying, you can choose this option to use the detailed flow.`, + { + NEWER_WINS: SIMPLE_FETCH_STAGE1_NEWER_WINS, + REMOTE_WINS: SIMPLE_FETCH_STAGE1_REMOTE_WINS, + DETAILED: SIMPLE_FETCH_STAGE1_DETAILED, + } + ); const stage1 = await host.services.UI.confirm.confirmWithMessage( - "Data retrieval scheduled", + $msg("Data retrieval scheduled"), msg, [ SIMPLE_FETCH_STAGE1_NEWER_WINS, @@ -123,15 +130,21 @@ Firstly, how shall we handle the data retrieved from this remote source? } if (stage1 === SIMPLE_FETCH_STAGE1_REMOTE_WINS) { - const msg = `Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?** + const msg = $msg( + `Since you have chosen to overwrite all local files with remote data, **how would you like to handle local files that are not present in the remote database?** -- **${SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL}**: Local-only files and remote-deleted files will be removed. +- **\${DELETE_ALL}**: Local-only files and remote-deleted files will be removed. This option will make your local vault exactly the same as the remote database, but please make sure you have a backup if there is any important data in your vault. -- **${SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE}**: All existing local files will be preserved. - This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.`; +- **\${DELETE_NONE}**: All existing local files will be preserved. + This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.`, + { + DELETE_ALL: SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL, + DELETE_NONE: SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE, + } + ); const stage2 = await host.services.UI.confirm.confirmWithMessage( - "How to handle extra existing local files?", + $msg("How to handle extra existing local files?"), msg, [SIMPLE_FETCH_STAGE2_REMOTE_DELETE_ALL, SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE, STAGE2_ABORT], SIMPLE_FETCH_STAGE2_REMOTE_DELETE_NONE, @@ -146,16 +159,21 @@ Firstly, how shall we handle the data retrieved from this remote source? } if (stage1 === SIMPLE_FETCH_STAGE1_NEWER_WINS) { - const msg = `How should files that were deleted on other devices be handled? + const msg = $msg( + `How should files that were deleted on other devices be handled? -- **${SIMPLE_FETCH_STAGE2_NEWER_CLEANUP}**: Delete local files if they were deleted on remote. +- **\${NEWER_CLEANUP}**: Delete local files if they were deleted on remote. This is useful if you want to keep your vault clean and consistent across devices, but please make sure you have a backup if there is already any important data in your vault. -- **${SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote. - This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation. - `; +- **\${NEWER_SYNC_ALL}**: Recreate remote files even if they were deleted on remote. + This option will keep all your local files, but it may cause duplicates if there are files that exist on local but not on remote. You can clean up these duplicates manually after the synchronisation.`, + { + NEWER_CLEANUP: SIMPLE_FETCH_STAGE2_NEWER_CLEANUP, + NEWER_SYNC_ALL: SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL, + } + ); const stage2 = await host.services.UI.confirm.confirmWithMessage( - "Conflict & Deletion Options", + $msg("Conflict & Deletion Options"), msg, [SIMPLE_FETCH_STAGE2_NEWER_CLEANUP, SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL, STAGE2_ABORT], SIMPLE_FETCH_STAGE2_NEWER_SYNC_ALL, @@ -172,8 +190,8 @@ Firstly, how shall we handle the data retrieved from this remote source? return "cancelled"; } -const RERUN_PROCESS = "Reboot to re-run the process"; -const RELEASE_FLAG_PROCESS = "Finalise the process and resume normal operation"; +const RERUN_PROCESS: string = $msg("Reboot to re-run the process"); +const RELEASE_FLAG_PROCESS: string = $msg("Finalise the process and resume normal operation"); export async function askAndPerformFastSetupOnScheduledFetchAll( host: NecessaryServices< | "vault" @@ -246,9 +264,9 @@ export async function askAndPerformFastSetupOnScheduledFetchAll( ); if (!syncResult) { const canRelease = await host.services.UI.confirm.askSelectStringDialogue( - "Some files failed to synchronise. What would you like to do?", + $msg("Some files failed to synchronise. What would you like to do?"), [RERUN_PROCESS, RELEASE_FLAG_PROCESS], - { defaultAction: RELEASE_FLAG_PROCESS, title: "Synchronisation Issues Detected" } + { defaultAction: RELEASE_FLAG_PROCESS, title: $msg("Synchronisation Issues Detected") } ); if (canRelease === RERUN_PROCESS) { log("User chose to reboot and re-run the process.", LOG_LEVEL_NOTICE);