From 1f5ce3f8030bdc221ac520c2070ad22556c06dbc Mon Sep 17 00:00:00 2001 From: Mara Date: Thu, 19 Oct 2023 10:53:13 +0200 Subject: [PATCH] fix: rename "default folder" by "root folder" in the settings (didn't change any behavior) the other description was wrong and doesn't help user --- src/i18n/locales/en.json | 4 +++- src/i18n/locales/fr.json | 1 + src/settings.ts | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 72c45a46..d1fd2d6b 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -490,7 +490,8 @@ "defaultFolder": { "desc": "Set the default reception folder. Let it empty to use the root of the repository.", "placeholder": "docs", - "title": "Default Folder" + "title": "Default Folder", + "other" : "Use this folder as root within the repository (each path will be prepend by it)" }, "folderBehavior": { "desc": "Choose the file tree in the repository, with using a properties key, a fixed folder or your Obsidian file tree.", @@ -513,6 +514,7 @@ }, "rootFolder": { "desc": "Append this path to the folder set by the properties key", + "other": "Use this folder as root within the repository (each path will be prepend by it).", "title": "Root folder" }, "title": "Upload configuration", diff --git a/src/i18n/locales/fr.json b/src/i18n/locales/fr.json index 8879875f..f89b6147 100644 --- a/src/i18n/locales/fr.json +++ b/src/i18n/locales/fr.json @@ -513,6 +513,7 @@ }, "rootFolder": { "desc": "Ajouter ce chemin au dossier définit par la clé de propriété.", + "other": "Utilisez ce dossier comme racine dans le référentiel (chaque chemin sera précédé de ce nom).", "title": "Dossier racine" }, "title": "Configuration du transfert", diff --git a/src/settings.ts b/src/settings.ts index 84438597..33815924 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -378,9 +378,19 @@ export class GithubPublisherSettingsTab extends PluginSettingTab { }); }); + const defaultFolder = uploadSettings.behavior !== FolderSettings.yaml ? + { + desc: i18next.t("settings.upload.rootFolder.other"), + title: i18next.t("settings.upload.rootFolder.title"), + } + : { + desc: i18next.t("settings.upload.defaultFolder.desc"), + title: i18next.t("settings.upload.defaultFolder.title"), + }; + new Setting(this.settingsPage) - .setName(i18next.t("settings.upload.defaultFolder.title")) - .setDesc(i18next.t("settings.upload.defaultFolder.desc")) + .setName(defaultFolder.title) + .setDesc(defaultFolder.desc) .addText((text) => { text.setPlaceholder(i18next.t("settings.upload.defaultFolder.placeholder")) .setValue(uploadSettings.defaultName)