Removed all console.debug and console.error calls that caused errors on mobile devices. (#2)

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Anton Antonov 2026-05-02 16:01:03 +05:00 committed by GitHub
parent 4958d6e151
commit 484d2aa154
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 16 additions and 27 deletions

View file

@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.1] — 2026-05-02
### Fixed
- Removed all `console.debug` and `console.error` calls that caused errors on mobile devices and were invisible to users in the Obsidian console
## [1.0.0] — 2026-04-28
### Added

View file

@ -2,6 +2,8 @@
Translate your Obsidian notes using [l10n](https://l10n.dev).dev — an AI-powered localization API. Works on desktop and mobile.
<img src="docs/demo.gif" alt="L10n.dev - AI Translator for Obsidian">
## Features
- Context-aware translations using advanced AI. Translate to 165+ languages.

BIN
docs/demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 658 KiB

View file

@ -1,7 +1,7 @@
{
"id": "ai-translator",
"name": "L10n.dev - AI Translator",
"version": "1.0.0",
"version": "1.0.1",
"minAppVersion": "0.15.0",
"description": "Translate notes into any of 165 languages with AI. Preserves Markdown formatting and structure. Powered by L10n.dev's AI translation API.",
"author": "l10n.dev",

4
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "obsidian-plugin-ai-translator",
"version": "1.0.0",
"version": "1.0.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "obsidian-plugin-ai-translator",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",
"dependencies": {
"obsidian": "latest"

View file

@ -1,6 +1,6 @@
{
"name": "obsidian-plugin-ai-translator",
"version": "1.0.0",
"version": "1.0.1",
"description": "Obsidian plugin to translate notes with AI using l10n.dev",
"main": "main.js",
"type": "module",

View file

@ -36,7 +36,6 @@ export class TranslationService {
apiKey: string,
req: TranslateRequest,
): Promise<TranslateResponse> {
console.debug("[AI Translator] Sending translation request:", req);
const response = await requestUrl({
url: `${API_BASE}/v2/translate`,
method: "POST",

View file

@ -10,7 +10,6 @@ export default class L10nPlugin extends Plugin {
await this.loadSettings();
this.addRibbonIcon("languages", "Translate note", () => {
console.debug("[AI Translator] Translating active note");
translateActiveNote(this);
});
@ -39,10 +38,6 @@ export default class L10nPlugin extends Plugin {
item.setTitle("Translate…")
.setIcon("languages")
.onClick(() => {
console.debug(
"[AI Translator] Translating file:",
abstractFile.path,
);
translateActiveNote(this, abstractFile);
});
});
@ -59,10 +54,6 @@ export default class L10nPlugin extends Plugin {
item.setTitle("Translate to last used language")
.setIcon("languages")
.onClick(() => {
console.debug(
"[AI Translator] Translating file to last used language:",
abstractFile.path,
);
translateToLastLanguage(this, abstractFile);
});
});
@ -76,9 +67,6 @@ export default class L10nPlugin extends Plugin {
item.setTitle("Translate to last used language")
.setIcon("languages")
.onClick(() => {
console.debug(
"[AI Translator] Translating current note to last used language",
);
translateToLastLanguage(this);
});
});
@ -91,9 +79,6 @@ export default class L10nPlugin extends Plugin {
item.setTitle("Translate…")
.setIcon("languages")
.onClick(() => {
console.debug(
"[AI Translator] Translating current note",
);
translateActiveNote(this);
});
});

View file

@ -65,10 +65,7 @@ async function doTranslate(
"Insufficient balance. Top up at https://l10n.dev/#pricing",
);
} else {
console.error("[AI Translator]", err);
new Notice(
"Translation failed. Check the developer console for details.",
);
new Notice("Translation failed. Please try again.");
}
return;
}
@ -105,8 +102,7 @@ async function doTranslate(
new Notice(
`Translation complete. Used ${charsUsed.toLocaleString()} characters.${balanceText}`,
);
} catch (err) {
console.error("[AI Translator]", err);
} catch {
new Notice("Failed to save the translated note.");
}
}

View file

@ -1,3 +1,4 @@
{
"1.0.0": "0.15.0"
"1.0.0": "0.15.0",
"1.0.1": "0.15.0"
}