diff --git a/dev/Model/Folder.js b/dev/Model/Folder.js index 61587ec9b..5ee3e9d79 100644 --- a/dev/Model/Folder.js +++ b/dev/Model/Folder.js @@ -7,6 +7,26 @@ import { i18n, trigger as translatorTrigger } from 'Common/Translator'; import { AbstractModel } from 'Knoin/AbstractModel'; import { FolderCollectionModel } from 'Model/FolderCollection'; +function getSystemFolderName(type, def) +{ + switch (type) { + case FolderType.Inbox: + return i18n('FOLDER_LIST/INBOX_NAME'); + case FolderType.SentItems: + return i18n('FOLDER_LIST/SENT_NAME'); + case FolderType.Draft: + return i18n('FOLDER_LIST/DRAFTS_NAME'); + case FolderType.Spam: + return i18n('GLOBAL/SPAM'); + case FolderType.Trash: + return i18n('FOLDER_LIST/TRASH_NAME'); + case FolderType.Archive: + return i18n('FOLDER_LIST/ARCHIVE_NAME'); + // no default + } + return def; +} + export class FolderModel extends AbstractModel { constructor() { super(); @@ -138,74 +158,24 @@ export class FolderModel extends AbstractModel { canBeChecked: () => !folder.isSystemFolder() && folder.selectable, localName: () => { - translatorTrigger(); - let name = folder.name(); - const type = folder.type(); - if (folder.isSystemFolder()) { - switch (type) { - case FolderType.Inbox: - name = i18n('FOLDER_LIST/INBOX_NAME'); - break; - case FolderType.SentItems: - name = i18n('FOLDER_LIST/SENT_NAME'); - break; - case FolderType.Draft: - name = i18n('FOLDER_LIST/DRAFTS_NAME'); - break; - case FolderType.Spam: - name = i18n('FOLDER_LIST/SPAM_NAME'); - break; - case FolderType.Trash: - name = i18n('FOLDER_LIST/TRASH_NAME'); - break; - case FolderType.Archive: - name = i18n('FOLDER_LIST/ARCHIVE_NAME'); - break; - // no default - } + translatorTrigger(); + name = getSystemFolderName(folder.type(), name); } - return name; }, manageFolderSystemName: () => { - translatorTrigger(); - - let suffix = ''; - const type = folder.type(), - name = folder.name(); - if (folder.isSystemFolder()) { - switch (type) { - case FolderType.Inbox: - suffix = '(' + i18n('FOLDER_LIST/INBOX_NAME') + ')'; - break; - case FolderType.SentItems: - suffix = '(' + i18n('FOLDER_LIST/SENT_NAME') + ')'; - break; - case FolderType.Draft: - suffix = '(' + i18n('FOLDER_LIST/DRAFTS_NAME') + ')'; - break; - case FolderType.Spam: - suffix = '(' + i18n('FOLDER_LIST/SPAM_NAME') + ')'; - break; - case FolderType.Trash: - suffix = '(' + i18n('FOLDER_LIST/TRASH_NAME') + ')'; - break; - case FolderType.Archive: - suffix = '(' + i18n('FOLDER_LIST/ARCHIVE_NAME') + ')'; - break; - // no default + translatorTrigger(); + let suffix = getSystemFolderName(folder.type(), ''); + if (folder.name() !== suffix && 'inbox' !== suffix.toLowerCase()) { + return '(' + suffix + ')'; } } - if ((suffix && '(' + name + ')' === suffix) || '(inbox)' === suffix.toLowerCase()) { - suffix = ''; - } - - return suffix; + return ''; }, collapsed: { diff --git a/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml b/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml index fa70fb844..0c386ab1d 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/_source.en.yml @@ -71,7 +71,6 @@ en: INBOX_NAME: "Inbox" SENT_NAME: "Sent" DRAFTS_NAME: "Drafts" - SPAM_NAME: "Spam" TRASH_NAME: "Trash" ARCHIVE_NAME: "Archive" QUOTA: @@ -297,9 +296,6 @@ en: TITLE_SYSTEM_FOLDERS: "Select system folders" SELECT_CHOOSE_ONE: "Choose one" SELECT_UNUSE_NAME: "Do not use" - LABEL_SENT: "Sent" - LABEL_DRAFTS: "Drafts" - LABEL_TRASH: "Trash" NOTIFICATION_SENT: | You haven't selected "Sent" system folder messages are put to after sending. If you don't want to save sent message, please select "Do not use" option. diff --git a/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml b/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml index 553f9abfb..b90148225 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/de_DE.yml @@ -71,7 +71,6 @@ de_DE: INBOX_NAME: "Posteingang" SENT_NAME: "Gesendet" DRAFTS_NAME: "Entwürfe" - SPAM_NAME: "Spam" TRASH_NAME: "Papierkorb" ARCHIVE_NAME: "Archiv" QUOTA: @@ -297,9 +296,6 @@ de_DE: TITLE_SYSTEM_FOLDERS: "Wählen Sie die Systemordner aus" SELECT_CHOOSE_ONE: "Wählen Sie einen aus" SELECT_UNUSE_NAME: "Nicht anwenden" - LABEL_SENT: "Gesendet" - LABEL_DRAFTS: "Entwürfe" - LABEL_TRASH: "Papierkorb" NOTIFICATION_SENT: | Sie haben keinen "Gesendet"-Systemordner gewählt, in dem Nachrichten nach dem Versenden gespeichert werden. Falls Sie versandte Nachrichten nicht speichern möchten, wählen Sie die Option "Nicht anwenden". diff --git a/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml b/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml index 29b53a443..98d310644 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/en_GB.yml @@ -71,7 +71,6 @@ en_GB: INBOX_NAME: "Inbox" SENT_NAME: "Sent" DRAFTS_NAME: "Drafts" - SPAM_NAME: "Spam" TRASH_NAME: "Trash" ARCHIVE_NAME: "Archive" QUOTA: @@ -297,9 +296,6 @@ en_GB: TITLE_SYSTEM_FOLDERS: "Select system folders" SELECT_CHOOSE_ONE: "Choose one" SELECT_UNUSE_NAME: "Do not use" - LABEL_SENT: "Sent" - LABEL_DRAFTS: "Drafts" - LABEL_TRASH: "Trash" NOTIFICATION_SENT: | You haven't selected "Sent" system folder messages are put to after sending. If you don't want to save sent message, please select "Do not use" option. diff --git a/snappymail/v/0.0.0/app/localization/webmail/en_US.yml b/snappymail/v/0.0.0/app/localization/webmail/en_US.yml index 954e85de0..16ab1fea4 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/en_US.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/en_US.yml @@ -71,7 +71,6 @@ en_US: INBOX_NAME: "Inbox" SENT_NAME: "Sent" DRAFTS_NAME: "Drafts" - SPAM_NAME: "Spam" TRASH_NAME: "Trash" ARCHIVE_NAME: "Archive" QUOTA: @@ -297,9 +296,6 @@ en_US: TITLE_SYSTEM_FOLDERS: "Select system folders" SELECT_CHOOSE_ONE: "Choose one" SELECT_UNUSE_NAME: "Do not use" - LABEL_SENT: "Sent" - LABEL_DRAFTS: "Drafts" - LABEL_TRASH: "Trash" NOTIFICATION_SENT: | You haven't selected "Sent" system folder messages are put to after sending. If you don't want to save sent message, please select "Do not use" option. diff --git a/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml b/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml index b4c75884f..50cfd1648 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/es_ES.yml @@ -71,7 +71,6 @@ es_ES: INBOX_NAME: "Bandeja de Entrada" SENT_NAME: "Enviados" DRAFTS_NAME: "Borradores" - SPAM_NAME: "Correo electrónico no deseado" TRASH_NAME: "Papelera" ARCHIVE_NAME: "Archivo" QUOTA: @@ -297,9 +296,6 @@ es_ES: TITLE_SYSTEM_FOLDERS: "Seleccione las carpetas del sistema" SELECT_CHOOSE_ONE: "Elija una" SELECT_UNUSE_NAME: "No usar" - LABEL_SENT: "Enviados" - LABEL_DRAFTS: "Borradores" - LABEL_TRASH: "Papelera" NOTIFICATION_SENT: | Usted no ha seleccionado la carpeta del sistema para guardar los "Enviados". Si no desea guardar los mensajes enviados, por favor seleccione la opción "No usar". diff --git a/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml b/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml index 5e54173a0..45c77f4c7 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/fr_FR.yml @@ -71,7 +71,6 @@ fr_FR: INBOX_NAME: "Boîte de réception" SENT_NAME: "Envoyés" DRAFTS_NAME: "Brouillons" - SPAM_NAME: "Indésirables" TRASH_NAME: "Corbeille" ARCHIVE_NAME: "Archive" QUOTA: @@ -297,9 +296,6 @@ fr_FR: TITLE_SYSTEM_FOLDERS: "Sélectionner les dossiers systèmes" SELECT_CHOOSE_ONE: "Faites un choix" SELECT_UNUSE_NAME: "Ne pas utiliser" - LABEL_SENT: "Envoyés" - LABEL_DRAFTS: "Brouillons" - LABEL_TRASH: "Corbeille" NOTIFICATION_SENT: | Vous n'avez pas sélectionné de dossier "Envoyés" où copier les messages après envoi. Si vous ne souhaitez pas enregistrer une copie des messages envoyés, sélectionnez l'option "Ne pas utiliser". diff --git a/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml b/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml index 859c05361..de7cbc72f 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/nl_NL.yml @@ -71,7 +71,6 @@ nl_NL: INBOX_NAME: "Postvak IN" SENT_NAME: "Verzonden items" DRAFTS_NAME: "Concepten" - SPAM_NAME: "Ongewenste e-mail" TRASH_NAME: "Verwijderde items" ARCHIVE_NAME: "Archief" QUOTA: @@ -297,9 +296,6 @@ nl_NL: TITLE_SYSTEM_FOLDERS: "Selecteer systeem mappen" SELECT_CHOOSE_ONE: "Kies één" SELECT_UNUSE_NAME: "Niet gebruiken" - LABEL_SENT: "Verzonden items" - LABEL_DRAFTS: "Concepten" - LABEL_TRASH: "Verwijderde items" NOTIFICATION_SENT: | U heeft nog geen "Verzonden items" folder aangeduid waar de berichten geplaatst worden na het versturen. Indien u geen verzonden berichten wilt bewaren, kies de "Niet gebruiken" optie. diff --git a/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml b/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml index a600ac5cb..b5a3bab15 100644 --- a/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml +++ b/snappymail/v/0.0.0/app/localization/webmail/zh_CN.yml @@ -71,7 +71,6 @@ zh_CN: INBOX_NAME: "收件箱" SENT_NAME: "已发邮件" DRAFTS_NAME: "草稿" - SPAM_NAME: "垃圾邮件" TRASH_NAME: "已删除邮件" ARCHIVE_NAME: "存档" QUOTA: @@ -296,9 +295,6 @@ zh_CN: TITLE_SYSTEM_FOLDERS: "选择系统文件夹" SELECT_CHOOSE_ONE: "选择一个" SELECT_UNUSE_NAME: "无" - LABEL_SENT: "已发邮件" - LABEL_DRAFTS: "草稿" - LABEL_TRASH: "已删除邮件" NOTIFICATION_SENT: | 您没有选择“已发邮件”文件夹来存储已发送邮件。 如果您不希望保存已发送邮件,请选择“无”选项。 diff --git a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderSystem.html b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderSystem.html index d239ea992..ff3c0de6a 100644 --- a/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderSystem.html +++ b/snappymail/v/0.0.0/app/templates/Views/User/PopupsFolderSystem.html @@ -13,7 +13,7 @@