Skip to content

Commit

Permalink
fix(settings): fix graphical bugs with yaml settings and add translat…
Browse files Browse the repository at this point in the history
…ion for error
  • Loading branch information
Mara-Li committed Aug 24, 2023
1 parent d05a5de commit ca14104
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"success": "Successfully deleted {{- nb}} files."
},
"error": {
"autoClean": "The default folder is empty, auto-cleaning will be disabled.",
"dataview": "Unable to render dataview query. Please update the dataview plugin to the last version.",
"errorConfig": "Error configuring {{- repo.owner}}/{{- repo.repo}}. Please check your settings.",
"errorPublish": "Error during upload to {{- repo.owner}}/{{- repo.repo}}",
Expand Down
1 change: 1 addition & 0 deletions src/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"success": "Suppression réussie de {{- nb}} fichiers."
},
"error": {
"autoClean": "Le dossier par défaut est vide, l'auto-nettoyage sera désactivée.",
"dataview": "Impossible de convertir la requête Dataview. Veuillez mettre à jour le module Dataview à la dernière version;",
"errorConfig": "Erreur de configuration pour {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}. Merci de vérifier vos paramètres.",
"errorPublish": "Erreur lors de la publication sur {{- repo.owner}}/{{- repo.repo}}:{{- repo.branch}}",
Expand Down
4 changes: 2 additions & 2 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export class GithubPublisherSettingsTab extends PluginSettingTab {
this.plugin
);
await this.plugin.saveSettings();
this.renderUploadConfiguration();
this.renderSettingsPage(EnumbSettingsTabId.upload);
});
});
const frontmatterTitleSet = new Setting(this.settingsPage)
Expand Down Expand Up @@ -500,7 +500,7 @@ export class GithubPublisherSettingsTab extends PluginSettingTab {
.onChange(async (value) => {
uploadSettings.folderNote.enable = value;
await this.plugin.saveSettings();
this.renderSettingsPage("upload-configuration");
this.renderSettingsPage(EnumbSettingsTabId.upload);
});
});

Expand Down
5 changes: 3 additions & 2 deletions src/settings/style.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import i18next from "i18next";
import { Notice, Setting } from "obsidian";

import GithubPublisherPlugin from "../main";
Expand Down Expand Up @@ -66,7 +67,7 @@ export async function autoCleanCondition(
) {
const settings = plugin.settings.upload;
if (value.length === 0 && settings.defaultName) {
new Notice("The default folder is empty, the autoclean settings will be disabled");
new Notice(i18next.t("error.autoClean"));
settings.autoclean.enable = false;
await plugin.saveSettings();
autoCleanSetting.setDisabled(true);
Expand All @@ -78,7 +79,7 @@ export async function autoCleanCondition(
value.length === 0 &&
settings.behavior !== FolderSettings.yaml
) {
new Notice("The default folder is empty, the autoclean settings will be disabled");
new Notice(i18next.t("error.autoClean"));
settings.autoclean.enable = false;
autoCleanSetting.setDisabled(true);
// @ts-ignore
Expand Down

0 comments on commit ca14104

Please sign in to comment.