From ba1d82bc0a4b60fa52dafca448226106288cf2d4 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 19 Oct 2024 10:45:45 +0300 Subject: [PATCH 01/16] i18n: Fix capitalization of checkbox --- src/public/translations/en/translation.json | 2 +- src/public/translations/es/translation.json | 2 +- src/public/translations/fr/translation.json | 2 +- src/public/translations/ro/translation.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 4255a1f5d..b570f2f6b 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -72,7 +72,7 @@ "delete_notes_preview": "Delete notes preview", "delete_all_clones_description": "delete also all clones (can be undone in recent changes)", "erase_notes_description": "Normal (soft) deletion only marks the notes as deleted and they can be undeleted (in recent changes dialog) within a period of time. Checking this option will erase the notes immediately and it won't be possible to undelete the notes.", - "erase_notes_warning": "erase notes permanently (can't be undone), including all clones. This will force application reload.", + "erase_notes_warning": "Erase notes permanently (can't be undone), including all clones. This will force application reload.", "notes_to_be_deleted": "Following notes will be deleted ()", "no_note_to_delete": "No note will be deleted (only clones).", "broken_relations_to_be_deleted": "Following relations will be broken and deleted ()", diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index aa1e57f73..6d1fc92c6 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -72,7 +72,7 @@ "delete_notes_preview": "Eliminar vista previa de notas", "delete_all_clones_description": "eliminar también todos los clones (se puede deshacer en cambios recientes)", "erase_notes_description": "La eliminación normal (suave) solo marca las notas como eliminadas y se pueden recuperar (en el cuadro de diálogo de cambios recientes) dentro de un periodo de tiempo. Al marcar esta opción se borrarán las notas inmediatamente y no será posible recuperarlas.", - "erase_notes_warning": "eliminar notas permanentemente (no se puede deshacer), incluidos todos los clones. Esto forzará la recarga de la aplicación.", + "erase_notes_warning": "Eliminar notas permanentemente (no se puede deshacer), incluidos todos los clones. Esto forzará la recarga de la aplicación.", "notes_to_be_deleted": "Las siguientes notas serán eliminadas ()", "no_note_to_delete": "No se eliminará ninguna nota (solo clones).", "broken_relations_to_be_deleted": "Las siguientes relaciones se romperán y serán eliminadas ()", diff --git a/src/public/translations/fr/translation.json b/src/public/translations/fr/translation.json index f6b0e7e5f..d003e0c80 100644 --- a/src/public/translations/fr/translation.json +++ b/src/public/translations/fr/translation.json @@ -72,7 +72,7 @@ "delete_notes_preview": "Supprimer l'aperçu des notes", "delete_all_clones_description": "supprime également tous les clones (peut être annulé depuis les Modifications récentes)", "erase_notes_description": "La suppression normale (douce) marque uniquement les notes comme supprimées et elles peuvent être restaurées (dans la boîte de dialogue des Modifications récentes) dans un délai donné. Cocher cette option effacera les notes immédiatement et il ne sera pas possible de les restaurer.", - "erase_notes_warning": "efface les notes de manière permanente (ne peut pas être annulée), y compris tous les clones. Cela forcera le rechargement de l’application.", + "erase_notes_warning": "Efface les notes de manière permanente (ne peut pas être annulée), y compris tous les clones. Cela forcera le rechargement de l’application.", "notes_to_be_deleted": "Les notes suivantes seront supprimées ()", "no_note_to_delete": "Aucune note ne sera supprimée (uniquement les clones).", "broken_relations_to_be_deleted": "Les relations suivantes seront rompues et supprimées ()", diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index ac9ee0bf2..4b4c73281 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -419,7 +419,7 @@ "delete_all_clones_description": "Șterge și toate clonele (se pot recupera în ecranul Schimbări recente)", "delete_notes_preview": "Șterge previzualizările notițelor", "erase_notes_description": "Ștergerea obișnuită doar marchează notițele ca fiind șterse și pot fi recuperate (în ecranul Schimbări recente) pentru o perioadă de timp. Dacă se bifează această opțiune, notițele vor fi șterse imediat fără posibilitatea de a le recupera.", - "erase_notes_warning": "șterge notițele permanent (nu se mai pot recupera), incluzând toate clonele. Va forța reîncărcarea aplicației.", + "erase_notes_warning": "Șterge notițele permanent (nu se mai pot recupera), incluzând toate clonele. Va forța reîncărcarea aplicației.", "no_note_to_delete": "Nicio notiță nu va fi ștearsă (doar clonele).", "note": "Notiță", "notes_to_be_deleted": "Următoarele notițe vor fi șterse ()", From 103da23b5ada5c80059104dfd8a1f87c85a7573e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 19 Oct 2024 10:46:28 +0300 Subject: [PATCH 02/16] i18n: Fix strange title in Romanian --- src/public/translations/ro/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 4b4c73281..eb8c5e944 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -417,7 +417,7 @@ "broken_relations_to_be_deleted": "Următoarele relații vor fi întrerupte și șterse ()", "cancel": "Anulează", "delete_all_clones_description": "Șterge și toate clonele (se pot recupera în ecranul Schimbări recente)", - "delete_notes_preview": "Șterge previzualizările notițelor", + "delete_notes_preview": "Previzualizare ștergerea notițelor", "erase_notes_description": "Ștergerea obișnuită doar marchează notițele ca fiind șterse și pot fi recuperate (în ecranul Schimbări recente) pentru o perioadă de timp. Dacă se bifează această opțiune, notițele vor fi șterse imediat fără posibilitatea de a le recupera.", "erase_notes_warning": "Șterge notițele permanent (nu se mai pot recupera), incluzând toate clonele. Va forța reîncărcarea aplicației.", "no_note_to_delete": "Nicio notiță nu va fi ștearsă (doar clonele).", From 815eab26f69adec7416648f251b175c62332c49a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 19 Oct 2024 10:50:56 +0300 Subject: [PATCH 03/16] i18n: Fix duplication in delete note count --- src/public/app/widgets/dialogs/delete_notes.js | 2 +- src/public/translations/cn/translation.json | 2 +- src/public/translations/en/translation.json | 2 +- src/public/translations/es/translation.json | 2 +- src/public/translations/fr/translation.json | 2 +- src/public/translations/ro/translation.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/public/app/widgets/dialogs/delete_notes.js b/src/public/app/widgets/dialogs/delete_notes.js index 4249e4dea..22f81e80e 100644 --- a/src/public/app/widgets/dialogs/delete_notes.js +++ b/src/public/app/widgets/dialogs/delete_notes.js @@ -25,7 +25,7 @@ const TPL = `
-

${t('delete_notes.notes_to_be_deleted')} ()

+

${t('delete_notes.notes_to_be_deleted', { noteCount: `` })}

    diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index ecad19c86..db4c6875b 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -73,7 +73,7 @@ "delete_all_clones_description": "同时删除所有克隆(可以在最近修改中撤消)", "erase_notes_description": "通常(软)删除仅标记笔记为已删除,可以在一段时间内通过最近修改对话框撤消。选中此选项将立即擦除笔记,不可撤销。", "erase_notes_warning": "永久擦除笔记(无法撤销),包括所有克隆。这将强制应用程序重新加载。", - "notes_to_be_deleted": "将删除以下笔记()", + "notes_to_be_deleted": "将删除以下笔记 ({{- noteCount}})", "no_note_to_delete": "没有笔记将被删除(仅克隆)。", "broken_relations_to_be_deleted": "将删除以下关系并断开连接()", "cancel": "取消", diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index b570f2f6b..06fc00d36 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -73,7 +73,7 @@ "delete_all_clones_description": "delete also all clones (can be undone in recent changes)", "erase_notes_description": "Normal (soft) deletion only marks the notes as deleted and they can be undeleted (in recent changes dialog) within a period of time. Checking this option will erase the notes immediately and it won't be possible to undelete the notes.", "erase_notes_warning": "Erase notes permanently (can't be undone), including all clones. This will force application reload.", - "notes_to_be_deleted": "Following notes will be deleted ()", + "notes_to_be_deleted": "Following notes will be deleted ({{- noteCount}})", "no_note_to_delete": "No note will be deleted (only clones).", "broken_relations_to_be_deleted": "Following relations will be broken and deleted ()", "cancel": "Cancel", diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index 6d1fc92c6..c57f9f2ca 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -73,7 +73,7 @@ "delete_all_clones_description": "eliminar también todos los clones (se puede deshacer en cambios recientes)", "erase_notes_description": "La eliminación normal (suave) solo marca las notas como eliminadas y se pueden recuperar (en el cuadro de diálogo de cambios recientes) dentro de un periodo de tiempo. Al marcar esta opción se borrarán las notas inmediatamente y no será posible recuperarlas.", "erase_notes_warning": "Eliminar notas permanentemente (no se puede deshacer), incluidos todos los clones. Esto forzará la recarga de la aplicación.", - "notes_to_be_deleted": "Las siguientes notas serán eliminadas ()", + "notes_to_be_deleted": "Las siguientes notas serán eliminadas ({{- noteCount}})", "no_note_to_delete": "No se eliminará ninguna nota (solo clones).", "broken_relations_to_be_deleted": "Las siguientes relaciones se romperán y serán eliminadas ()", "cancel": "Cancelar", diff --git a/src/public/translations/fr/translation.json b/src/public/translations/fr/translation.json index d003e0c80..7400e12fc 100644 --- a/src/public/translations/fr/translation.json +++ b/src/public/translations/fr/translation.json @@ -73,7 +73,7 @@ "delete_all_clones_description": "supprime également tous les clones (peut être annulé depuis les Modifications récentes)", "erase_notes_description": "La suppression normale (douce) marque uniquement les notes comme supprimées et elles peuvent être restaurées (dans la boîte de dialogue des Modifications récentes) dans un délai donné. Cocher cette option effacera les notes immédiatement et il ne sera pas possible de les restaurer.", "erase_notes_warning": "Efface les notes de manière permanente (ne peut pas être annulée), y compris tous les clones. Cela forcera le rechargement de l’application.", - "notes_to_be_deleted": "Les notes suivantes seront supprimées ()", + "notes_to_be_deleted": "Les notes suivantes seront supprimées ({{- noteCount}})", "no_note_to_delete": "Aucune note ne sera supprimée (uniquement les clones).", "broken_relations_to_be_deleted": "Les relations suivantes seront rompues et supprimées ()", "cancel": "Annuler", diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index eb8c5e944..fecc0221f 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -422,7 +422,7 @@ "erase_notes_warning": "Șterge notițele permanent (nu se mai pot recupera), incluzând toate clonele. Va forța reîncărcarea aplicației.", "no_note_to_delete": "Nicio notiță nu va fi ștearsă (doar clonele).", "note": "Notiță", - "notes_to_be_deleted": "Următoarele notițe vor fi șterse ()", + "notes_to_be_deleted": "Următoarele notițe vor fi șterse ({{- noteCount}})", "ok": "OK", "to_be_deleted": " (pentru ștergere) este referențiat(ă) de relația {{attrName}} originând de la " }, From 29a700f731059b73d402e6e345d2f6a27af2ae2b Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 19 Oct 2024 10:55:48 +0300 Subject: [PATCH 04/16] i18n: Fix duplication in delete relations count --- src/public/app/widgets/dialogs/delete_notes.js | 4 ++-- src/public/translations/cn/translation.json | 2 +- src/public/translations/en/translation.json | 2 +- src/public/translations/es/translation.json | 2 +- src/public/translations/fr/translation.json | 2 +- src/public/translations/ro/translation.json | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/public/app/widgets/dialogs/delete_notes.js b/src/public/app/widgets/dialogs/delete_notes.js index 22f81e80e..487efc5dd 100644 --- a/src/public/app/widgets/dialogs/delete_notes.js +++ b/src/public/app/widgets/dialogs/delete_notes.js @@ -25,7 +25,7 @@ const TPL = `
    -

    ${t('delete_notes.notes_to_be_deleted', { noteCount: `` })}

    +

    ${t('delete_notes.notes_to_be_deleted', { noteCount: '' })}

      @@ -36,7 +36,7 @@ const TPL = `
      -

      ${t('delete_notes.broken_relations_to_be_deleted')} ()

      +

      ${t('delete_notes.broken_relations_to_be_deleted', { relationCount: ''})}

        diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index db4c6875b..b7bc64214 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -75,7 +75,7 @@ "erase_notes_warning": "永久擦除笔记(无法撤销),包括所有克隆。这将强制应用程序重新加载。", "notes_to_be_deleted": "将删除以下笔记 ({{- noteCount}})", "no_note_to_delete": "没有笔记将被删除(仅克隆)。", - "broken_relations_to_be_deleted": "将删除以下关系并断开连接()", + "broken_relations_to_be_deleted": "将删除以下关系并断开连接 ({{- relationCount}})", "cancel": "取消", "ok": "确定", "note": "笔记", diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 06fc00d36..b5a4b5813 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -75,7 +75,7 @@ "erase_notes_warning": "Erase notes permanently (can't be undone), including all clones. This will force application reload.", "notes_to_be_deleted": "Following notes will be deleted ({{- noteCount}})", "no_note_to_delete": "No note will be deleted (only clones).", - "broken_relations_to_be_deleted": "Following relations will be broken and deleted ()", + "broken_relations_to_be_deleted": "Following relations will be broken and deleted ({{- relationCount}})", "cancel": "Cancel", "ok": "OK", "note": "Note", diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index c57f9f2ca..9f1382766 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -75,7 +75,7 @@ "erase_notes_warning": "Eliminar notas permanentemente (no se puede deshacer), incluidos todos los clones. Esto forzará la recarga de la aplicación.", "notes_to_be_deleted": "Las siguientes notas serán eliminadas ({{- noteCount}})", "no_note_to_delete": "No se eliminará ninguna nota (solo clones).", - "broken_relations_to_be_deleted": "Las siguientes relaciones se romperán y serán eliminadas ()", + "broken_relations_to_be_deleted": "Las siguientes relaciones se romperán y serán eliminadas ({{- relationCount}})", "cancel": "Cancelar", "ok": "Aceptar", "note": "Nota", diff --git a/src/public/translations/fr/translation.json b/src/public/translations/fr/translation.json index 7400e12fc..88dd4aa09 100644 --- a/src/public/translations/fr/translation.json +++ b/src/public/translations/fr/translation.json @@ -75,7 +75,7 @@ "erase_notes_warning": "Efface les notes de manière permanente (ne peut pas être annulée), y compris tous les clones. Cela forcera le rechargement de l’application.", "notes_to_be_deleted": "Les notes suivantes seront supprimées ({{- noteCount}})", "no_note_to_delete": "Aucune note ne sera supprimée (uniquement les clones).", - "broken_relations_to_be_deleted": "Les relations suivantes seront rompues et supprimées ()", + "broken_relations_to_be_deleted": "Les relations suivantes seront rompues et supprimées ({{- relationCount}})", "cancel": "Annuler", "ok": "OK", "note": "Note", diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index fecc0221f..2c1a607e4 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -414,7 +414,7 @@ "undelete_notes_instruction": "După ștergere, se pot recupera din ecranul Schimbări recente." }, "delete_notes": { - "broken_relations_to_be_deleted": "Următoarele relații vor fi întrerupte și șterse ()", + "broken_relations_to_be_deleted": "Următoarele relații vor fi întrerupte și șterse ({{- relationCount}})", "cancel": "Anulează", "delete_all_clones_description": "Șterge și toate clonele (se pot recupera în ecranul Schimbări recente)", "delete_notes_preview": "Previzualizare ștergerea notițelor", From c18c972a575f092e528ffad1eadf60e28451502f Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 19 Oct 2024 11:13:54 +0300 Subject: [PATCH 05/16] i18n: Use variable interpolation for delete relation warning --- src/public/app/widgets/dialogs/delete_notes.js | 10 +++++----- src/public/translations/cn/translation.json | 3 +-- src/public/translations/en/translation.json | 5 ++--- src/public/translations/es/translation.json | 5 ++--- src/public/translations/fr/translation.json | 5 ++--- src/public/translations/ro/translation.json | 3 +-- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/public/app/widgets/dialogs/delete_notes.js b/src/public/app/widgets/dialogs/delete_notes.js index 487efc5dd..d4b3454ac 100644 --- a/src/public/app/widgets/dialogs/delete_notes.js +++ b/src/public/app/widgets/dialogs/delete_notes.js @@ -126,11 +126,11 @@ export default class DeleteNotesDialog extends BasicWidget { for (const attr of response.brokenRelations) { this.$brokenRelationsList.append( - $("
      • ") - .append(`${t('delete_notes.note')} `) - .append(await linkService.createLink(attr.value)) - .append(` ${t('delete_notes.to_be_deleted', {attrName: attr.name})} `) - .append(await linkService.createLink(attr.noteId)) + $("
      • ").html(t("delete_notes.deleted_relation_text", { + note: (await linkService.createLink(attr.value)).html(), + relation: `${attr.name}`, + source: (await linkService.createLink(attr.noteId)).html() + })) ); } } diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index b7bc64214..7473d64b2 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -78,8 +78,7 @@ "broken_relations_to_be_deleted": "将删除以下关系并断开连接 ({{- relationCount}})", "cancel": "取消", "ok": "确定", - "note": "笔记", - "to_be_deleted": " (将被删除的笔记) 被以下关系 {{attrName}} 引用, 来自 " + "deleted_relation_text": "笔记 {{- note}} (将被删除的笔记) 被以下关系 {{- relation}} 引用, 来自 {{- source}}。" }, "export": { "export_note_title": "导出笔记", diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index b5a4b5813..f0d69b7e0 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -70,7 +70,7 @@ }, "delete_notes": { "delete_notes_preview": "Delete notes preview", - "delete_all_clones_description": "delete also all clones (can be undone in recent changes)", + "delete_all_clones_description": "Delete also all clones (can be undone in recent changes)", "erase_notes_description": "Normal (soft) deletion only marks the notes as deleted and they can be undeleted (in recent changes dialog) within a period of time. Checking this option will erase the notes immediately and it won't be possible to undelete the notes.", "erase_notes_warning": "Erase notes permanently (can't be undone), including all clones. This will force application reload.", "notes_to_be_deleted": "Following notes will be deleted ({{- noteCount}})", @@ -78,8 +78,7 @@ "broken_relations_to_be_deleted": "Following relations will be broken and deleted ({{- relationCount}})", "cancel": "Cancel", "ok": "OK", - "note": "Note", - "to_be_deleted": " (to be deleted) is referenced by relation {{attrName}} originating from " + "deleted_relation_text": "Note {{- note}} (to be deleted) is referenced by relation {{- relation}} originating from {{- source}}." }, "export": { "export_note_title": "Export note", diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index 9f1382766..5260f7f1c 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -70,7 +70,7 @@ }, "delete_notes": { "delete_notes_preview": "Eliminar vista previa de notas", - "delete_all_clones_description": "eliminar también todos los clones (se puede deshacer en cambios recientes)", + "delete_all_clones_description": "Eliminar también todos los clones (se puede deshacer en cambios recientes)", "erase_notes_description": "La eliminación normal (suave) solo marca las notas como eliminadas y se pueden recuperar (en el cuadro de diálogo de cambios recientes) dentro de un periodo de tiempo. Al marcar esta opción se borrarán las notas inmediatamente y no será posible recuperarlas.", "erase_notes_warning": "Eliminar notas permanentemente (no se puede deshacer), incluidos todos los clones. Esto forzará la recarga de la aplicación.", "notes_to_be_deleted": "Las siguientes notas serán eliminadas ({{- noteCount}})", @@ -78,8 +78,7 @@ "broken_relations_to_be_deleted": "Las siguientes relaciones se romperán y serán eliminadas ({{- relationCount}})", "cancel": "Cancelar", "ok": "Aceptar", - "note": "Nota", - "to_be_deleted": " (para ser eliminada) está referenciado por la relación {{attrName}} que se origina en " + "deleted_relation_text": "Nota {{- note}} (para ser eliminada) está referenciado por la relación {{- relation}} que se origina en {{- source}}." }, "export": { "export_note_title": "Exportar nota", diff --git a/src/public/translations/fr/translation.json b/src/public/translations/fr/translation.json index 88dd4aa09..cce0458ed 100644 --- a/src/public/translations/fr/translation.json +++ b/src/public/translations/fr/translation.json @@ -70,7 +70,7 @@ }, "delete_notes": { "delete_notes_preview": "Supprimer l'aperçu des notes", - "delete_all_clones_description": "supprime également tous les clones (peut être annulé depuis les Modifications récentes)", + "delete_all_clones_description": "Supprime également tous les clones (peut être annulé depuis les Modifications récentes)", "erase_notes_description": "La suppression normale (douce) marque uniquement les notes comme supprimées et elles peuvent être restaurées (dans la boîte de dialogue des Modifications récentes) dans un délai donné. Cocher cette option effacera les notes immédiatement et il ne sera pas possible de les restaurer.", "erase_notes_warning": "Efface les notes de manière permanente (ne peut pas être annulée), y compris tous les clones. Cela forcera le rechargement de l’application.", "notes_to_be_deleted": "Les notes suivantes seront supprimées ({{- noteCount}})", @@ -78,8 +78,7 @@ "broken_relations_to_be_deleted": "Les relations suivantes seront rompues et supprimées ({{- relationCount}})", "cancel": "Annuler", "ok": "OK", - "note": "Note", - "to_be_deleted": " (à supprimer) est référencé par la relation {{attrName}} provenant de " + "deleted_relation_text": "Note {{- note}} (à supprimer) est référencé par la relation {{- relation}} provenant de {{- source}}." }, "export": { "export_note_title": "Exporter la note", diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 2c1a607e4..54c45c9ea 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -421,10 +421,9 @@ "erase_notes_description": "Ștergerea obișnuită doar marchează notițele ca fiind șterse și pot fi recuperate (în ecranul Schimbări recente) pentru o perioadă de timp. Dacă se bifează această opțiune, notițele vor fi șterse imediat fără posibilitatea de a le recupera.", "erase_notes_warning": "Șterge notițele permanent (nu se mai pot recupera), incluzând toate clonele. Va forța reîncărcarea aplicației.", "no_note_to_delete": "Nicio notiță nu va fi ștearsă (doar clonele).", - "note": "Notiță", "notes_to_be_deleted": "Următoarele notițe vor fi șterse ({{- noteCount}})", "ok": "OK", - "to_be_deleted": " (pentru ștergere) este referențiat(ă) de relația {{attrName}} originând de la " + "deleted_relation_text": "Notița {{- note}} ce va fi ștearsă este referențiată de relația {{- relation}}, originând din {{- source}}." }, "delete_relation": { "allowed_characters": "Se permit caractere alfanumerice, underline și două puncte.", From 2387bbd17fcab34dfbc271223f0526663719d5ba Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Wed, 30 Oct 2024 22:30:40 +0800 Subject: [PATCH 06/16] Automatically trigger autocomplete on focus. --- src/public/app/widgets/type_widgets/empty.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js index fba2a1f7f..0a7119b80 100644 --- a/src/public/app/widgets/type_widgets/empty.js +++ b/src/public/app/widgets/type_widgets/empty.js @@ -84,6 +84,13 @@ export default class EmptyTypeWidget extends TypeWidget { ); } + // Automatically trigger autocomplete on focus. + this.$autoComplete.on('focus', () => { + // simulate pressing down arrow to trigger autocomplete + this.$autoComplete.trigger($.Event('keydown', { which: 40 })); // arrow down + this.$autoComplete.trigger($.Event('keydown', { which: 38 })); // arrow up + }); + this.$autoComplete .trigger('focus') .trigger('select'); From 57a86c75d87a20e525ccd72693f24a993860736d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Thu, 31 Oct 2024 23:54:50 +0200 Subject: [PATCH 07/16] i18n: Fix single Romanian translation --- src/public/translations/ro/translation.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index db59fd359..6efc98387 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -554,7 +554,7 @@ "open_sql_console": "Deschide consola SQL", "open_sql_console_history": "Deschide istoricul consolei SQL", "options": "Opțiuni", - "reload_frontend": "Reîncarcă interfață", + "reload_frontend": "Reîncarcă interfața", "reload_hint": "Reîncărcarea poate ajuta atunci când există ceva probleme vizuale fără a trebui repornită întreaga aplicație.", "reset_zoom_level": "Resetează nivelul de zoom", "show_backend_log": "Afișează log-ul din backend", From dbca50d9b0d74650c94481b86ff2c514e08d6fe7 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 1 Nov 2024 14:45:49 +0800 Subject: [PATCH 08/16] Make note-detail-empty always display autocompletion. --- src/public/app/widgets/type_widgets/empty.js | 22 ++++++++------------ 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js index 0a7119b80..45da73e6e 100644 --- a/src/public/app/widgets/type_widgets/empty.js +++ b/src/public/app/widgets/type_widgets/empty.js @@ -18,10 +18,9 @@ const TPL = ` width: 130px; text-align: center; margin: 10px; - padding; 10px; border: 1px transparent solid; } - + .workspace-notes .workspace-note:hover { cursor: pointer; border: 1px solid var(--main-border-color); @@ -33,14 +32,14 @@ const TPL = ` } +
        -
        +
        - -
        +
        `; export default class EmptyTypeWidget extends TypeWidget { @@ -51,10 +50,12 @@ export default class EmptyTypeWidget extends TypeWidget { this.$widget = $(TPL); this.$autoComplete = this.$widget.find(".note-autocomplete"); + this.$results = this.$widget.find(".note-detail-empty-results"); noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { hideGoToSelectedNoteButton: true, - allowCreatingNotes: true + allowCreatingNotes: true, + container: this.$results }) .on('autocomplete:noteselected', function(event, suggestion, dataset) { if (!suggestion.notePath) { @@ -84,15 +85,10 @@ export default class EmptyTypeWidget extends TypeWidget { ); } - // Automatically trigger autocomplete on focus. - this.$autoComplete.on('focus', () => { - // simulate pressing down arrow to trigger autocomplete - this.$autoComplete.trigger($.Event('keydown', { which: 40 })); // arrow down - this.$autoComplete.trigger($.Event('keydown', { which: 38 })); // arrow up - }); - this.$autoComplete .trigger('focus') .trigger('select'); + + noteAutocompleteService.showRecentNotes(this.$autoComplete); } } From cdd5a17fcede0428572b4b2f4f17666ccc12ebd4 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 1 Nov 2024 15:30:31 +0800 Subject: [PATCH 09/16] Make note-detail-empty always display autocompletion. --- src/public/app/widgets/type_widgets/empty.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js index 45da73e6e..7576d09df 100644 --- a/src/public/app/widgets/type_widgets/empty.js +++ b/src/public/app/widgets/type_widgets/empty.js @@ -67,6 +67,7 @@ export default class EmptyTypeWidget extends TypeWidget { this.$workspaceNotes = this.$widget.find('.workspace-notes'); + noteAutocompleteService.showRecentNotes(this.$autoComplete); super.doRender(); } @@ -88,7 +89,5 @@ export default class EmptyTypeWidget extends TypeWidget { this.$autoComplete .trigger('focus') .trigger('select'); - - noteAutocompleteService.showRecentNotes(this.$autoComplete); } } From 7f17f93767ea646837026c43ff29f831e2b29279 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 1 Nov 2024 21:43:09 +0800 Subject: [PATCH 10/16] Crop fileName and prevent cutting into the extension. --- src/services/export/zip.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/services/export/zip.ts b/src/services/export/zip.ts index c98c226c8..5e30e6297 100644 --- a/src/services/export/zip.ts +++ b/src/services/export/zip.ts @@ -58,8 +58,15 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h function getDataFileName(type: string | null, mime: string, baseFileName: string, existingFileNames: Record): string { let fileName = baseFileName.trim(); + + // Crop fileName to avoid its length exceeding 30 and prevent cutting into the extension. if (fileName.length > 30) { - fileName = fileName.substr(0, 30).trim(); + let match = fileName.match(/(\.[a-zA-Z0-9_.!#-]+)$/); + let ext = match ? match[0] : ''; + // Crop the extension if extension length exceeds 30 + const croppedExt = ext.slice(-30); + // Crop the file name section and append the cropped extension + fileName = fileName.slice(0, 30 - croppedExt.length) + croppedExt; } let existingExtension = path.extname(fileName).toLowerCase(); @@ -76,6 +83,9 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h else if (mime === 'application/x-javascript' || mime === 'text/javascript') { newExtension = 'js'; } + else if (type === 'canvas' || mime === 'application/json') { + newExtension = 'json'; + } else if (existingExtension.length > 0) { // if the page already has an extension, then we'll just keep it newExtension = null; } From 7b24f7e3325ec3789a4a69577f366040411df879 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Fri, 1 Nov 2024 20:02:22 +0800 Subject: [PATCH 11/16] close right tabs --- src/public/app/components/tab_manager.js | 14 +++++++++++++- src/public/app/widgets/tab_row.js | 3 ++- src/public/translations/en/translation.json | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/public/app/components/tab_manager.js b/src/public/app/components/tab_manager.js index 861a54502..235aa5cd1 100644 --- a/src/public/app/components/tab_manager.js +++ b/src/public/app/components/tab_manager.js @@ -551,7 +551,7 @@ export default class TabManager extends Component { await this.removeNoteContext(ntxIdToRemove); } } - + async closeOtherTabsCommand({ntxId}) { for (const ntxIdToRemove of this.mainNoteContexts.map(nc => nc.ntxId)) { if (ntxIdToRemove !== ntxId) { @@ -560,6 +560,18 @@ export default class TabManager extends Component { } } + async closeRightTabsCommand({ntxId}) { + const ntxIds = this.mainNoteContexts.map(nc => nc.ntxId); + const index = ntxIds.indexOf(ntxId); + + if (index !== -1) { + const idsToRemove = ntxIds.slice(index + 1); + for (const ntxIdToRemove of idsToRemove) { + await this.removeNoteContext(ntxIdToRemove); + } + } + } + async closeTabCommand({ntxId}) { await this.removeNoteContext(ntxId); } diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index 395dd51d5..cc6f8a22b 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -260,7 +260,8 @@ export default class TabRowWidget extends BasicWidget { y: e.pageY, items: [ {title: t('tab_row.close'), command: "closeTab", uiIcon: "bx bx-x"}, - {title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-x"}, + {title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-x", enabled: appContext.tabManager.noteContexts.length !== 1}, + {title: t('tab_row.close_right_tabs'), command: "closeRightTabs", uiIcon: "bx bx-x", enabled: appContext.tabManager.noteContexts.at(-1).ntxId !== ntxId}, {title: t('tab_row.close_all_tabs'), command: "closeAllTabs", uiIcon: "bx bx-x"}, {title: t('tab_row.move_tab_to_new_window'), command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"} ], diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 06604c638..dd170d30a 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1434,6 +1434,7 @@ "add_new_tab": "Add new tab", "close": "Close", "close_other_tabs": "Close other tabs", + "close_right_tabs": "Close right tabs", "close_all_tabs": "Close all tabs", "move_tab_to_new_window": "Move this tab to a new window", "new_tab": "New tab" From 11a82e62f1836e055f6ce07c9f32f15c5c07c5cf Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 1 Nov 2024 19:03:06 +0200 Subject: [PATCH 12/16] client: Change layout of tab context menu slightly --- src/public/app/widgets/tab_row.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/public/app/widgets/tab_row.js b/src/public/app/widgets/tab_row.js index cc6f8a22b..ccf49569b 100644 --- a/src/public/app/widgets/tab_row.js +++ b/src/public/app/widgets/tab_row.js @@ -260,9 +260,10 @@ export default class TabRowWidget extends BasicWidget { y: e.pageY, items: [ {title: t('tab_row.close'), command: "closeTab", uiIcon: "bx bx-x"}, - {title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-x", enabled: appContext.tabManager.noteContexts.length !== 1}, - {title: t('tab_row.close_right_tabs'), command: "closeRightTabs", uiIcon: "bx bx-x", enabled: appContext.tabManager.noteContexts.at(-1).ntxId !== ntxId}, - {title: t('tab_row.close_all_tabs'), command: "closeAllTabs", uiIcon: "bx bx-x"}, + {title: t('tab_row.close_other_tabs'), command: "closeOtherTabs", uiIcon: "bx bx-empty", enabled: appContext.tabManager.noteContexts.length !== 1}, + {title: t('tab_row.close_right_tabs'), command: "closeRightTabs", uiIcon: "bx bx-empty", enabled: appContext.tabManager.noteContexts.at(-1).ntxId !== ntxId}, + {title: t('tab_row.close_all_tabs'), command: "closeAllTabs", uiIcon: "bx bx-empty"}, + { title: "----" }, {title: t('tab_row.move_tab_to_new_window'), command: "moveTabToNewWindow", uiIcon: "bx bx-window-open"} ], selectMenuItemHandler: ({command}) => { From d0904c1051e40eae96dde4a8c5eb36ac343252af Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 1 Nov 2024 19:05:56 +0200 Subject: [PATCH 13/16] client: Change translation for closing tabs to the right --- src/public/translations/en/translation.json | 2 +- src/public/translations/ro/translation.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index dd170d30a..9de64b6bf 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1434,7 +1434,7 @@ "add_new_tab": "Add new tab", "close": "Close", "close_other_tabs": "Close other tabs", - "close_right_tabs": "Close right tabs", + "close_right_tabs": "Close tabs to the right", "close_all_tabs": "Close all tabs", "move_tab_to_new_window": "Move this tab to a new window", "new_tab": "New tab" diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 6efc98387..b5bff39a8 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -1439,7 +1439,8 @@ "close_other_tabs": "Închide celelalte taburi", "close_tab": "Închide tab", "move_tab_to_new_window": "Mută acest tab în altă fereastră", - "new_tab": "Tab nou" + "new_tab": "Tab nou", + "close_right_tabs": "Închide taburile din dreapta" }, "toc": { "options": "Setări", From c2baa4b752e4ce7189f081a8cbe0a832bb1f880d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 1 Nov 2024 19:43:39 +0200 Subject: [PATCH 14/16] server: Add comment to clarify use of regex --- src/services/export/zip.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/export/zip.ts b/src/services/export/zip.ts index 5e30e6297..75feeebc6 100644 --- a/src/services/export/zip.ts +++ b/src/services/export/zip.ts @@ -61,6 +61,7 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h // Crop fileName to avoid its length exceeding 30 and prevent cutting into the extension. if (fileName.length > 30) { + // We use regex to match the extension to preserve multiple dots in extensions (e.g. .tar.gz). let match = fileName.match(/(\.[a-zA-Z0-9_.!#-]+)$/); let ext = match ? match[0] : ''; // Crop the extension if extension length exceeds 30 From aa7d7b3afd3f3f5873a28eb28f2154d6efc7e41c Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 1 Nov 2024 20:20:53 +0200 Subject: [PATCH 15/16] client: Add borders to empty tab search list --- src/public/app/widgets/type_widgets/empty.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/type_widgets/empty.js b/src/public/app/widgets/type_widgets/empty.js index 7576d09df..8d04ab5b9 100644 --- a/src/public/app/widgets/type_widgets/empty.js +++ b/src/public/app/widgets/type_widgets/empty.js @@ -25,6 +25,21 @@ const TPL = ` cursor: pointer; border: 1px solid var(--main-border-color); } + + .note-detail-empty-results { + max-height: 50vh; + overflow: scroll; + border: var(--bs-border-width) solid var(--bs-border-color); + border-top: 0; + } + + .empty-tab-search .note-autocomplete-input { + border-bottom-left-radius: 0; + } + + .empty-tab-search .input-clearer-button { + border-bottom-right-radius: 0; + } .workspace-icon { text-align: center; @@ -33,7 +48,7 @@ const TPL = `
        -
        +