multranslate
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -266,4 +266,11 @@ #!/usr/bin/env node | ||
import path from 'path' | ||
import { fileURLToPath } from 'url' | ||
const __filename = fileURLToPath(import.meta.url) | ||
const __dirname = path.dirname(__filename) | ||
function writeHistory(data) { | ||
const db = new Database('./translation-history.db') | ||
const dbPath = path.join(__dirname, 'translation-history.db') | ||
const db = new Database(dbPath) | ||
db.exec(` | ||
@@ -282,3 +289,4 @@ CREATE TABLE IF NOT EXISTS translationTable ( | ||
function readHistory(id) { | ||
const db = new Database('./translation-history.db') | ||
const dbPath = path.join(__dirname, 'translation-history.db') | ||
const db = new Database(dbPath) | ||
const query = 'SELECT inputText,created_at FROM translationTable WHERE id = ?' | ||
@@ -291,3 +299,4 @@ const get = db.prepare(query) | ||
function getAllId() { | ||
const db = new Database('./translation-history.db') | ||
const dbPath = path.join(__dirname, 'translation-history.db') | ||
const db = new Database(dbPath) | ||
let result | ||
@@ -780,3 +789,3 @@ // Проверяем, что таблица существует | ||
const newText = lastText.inputText.replace(/\n/g, '\r') | ||
infoBox.content = `${infoContent} History: ${curID}/${maxID} (${parseData(lastText.created_at)})` | ||
infoBox.content = `${infoContent} History: ${curID+1}/${maxID+1} (${parseData(lastText.created_at)})` | ||
buffer.setText(newText) | ||
@@ -806,3 +815,3 @@ buffer.setCursorPosition(newText.length) | ||
const newText = lastText.inputText.replace(/\n/g, '\r') | ||
infoBox.content = `${infoContent} History: ${curID}/${maxID} (${parseData(lastText.created_at)})` | ||
infoBox.content = `${infoContent} History: ${curID+1}/${maxID+1} (${parseData(lastText.created_at)})` | ||
buffer.setText(newText) | ||
@@ -809,0 +818,0 @@ buffer.setCursorPosition(newText.length) |
{ | ||
"name": "multranslate", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "Cross-platform TUI for translating text in multiple translators simultaneously, with support for translation history and automatic language detection.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
1142184
1665