This commit is contained in:
troyeguo
2025-01-20 18:20:59 +08:00
parent d6e234308a
commit 434b1821b2
22 changed files with 112 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
!macro customUnInstall
MessageBox MB_YESNO "Do you want to delete user settings?" /SD IDNO IDNO SkipRemoval
MessageBox MB_YESNO "Do you want to delete all your data including books, notes, highlights, bookmarks, configurations?" /SD IDNO IDNO SkipRemoval
SetShellVarContext current
RMDir /r "$APPDATA\koodo-reader"
SkipRemoval:

View File

@@ -8,14 +8,12 @@ body {
.booklist-shelf-list,
.lang-setting-dropdown,
.delete-tag-container,
.add-dialog-shelf-list-option,
.setting-subtitle,
.book-subcontent-name {
color: rgba(235, 235, 235, 1);
}
.add-dialog-shelf-list-box,
.add-dialog-shelf-list-option,
.add-dialog-new-shelf-box,
.add-dialog-cancel,
.delete-dialog-cancel,
@@ -67,6 +65,7 @@ body {
.edit-dialog-confirm,
.change-location-button,
.token-dialog-confirm,
.add-dialog-shelf-list-option,
.voice-add-confirm,
.new-version-open,
.update-dialog-container-button,

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

File diff suppressed because one or more lines are too long

View File

@@ -354,7 +354,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -349,7 +349,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -348,7 +348,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -349,7 +349,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -368,7 +368,7 @@
"Get rid of window frame, make reader hide into Word or any text editor, and can't be detected. You need to set up the reader's position, size and style first.": "Get rid of window frame, make reader hide into Word or any text editor, and can't be detected. You need to set up the reader's position, size and style first.",
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Book won't be opened in a separate window but directly opened in the main window": "Book won't be opened in a separate window but directly opened in the main window",

View File

@@ -286,7 +286,7 @@
"Auto Update relies on GitHub Release for package hosting, if your internet doesn't have stable connection to GitHub, we highly recommand you to turn off this option": "Braitheann Auto Update ar Scaoileadh GitHub le haghaidh óstáil pacáiste, mura bhfuil nasc cobhsaí ag d'idirlíon le GitHub, molaimid go mór duit an rogha seo a mhúchadh",
"File size": "Méid an chomhaid",
"Take effect at next startup": "Bí i bhfeidhm ag an gcéad tosú",
"View mode": ""Mód amhairc",
"View mode": "Mód amhairc",
"Prototype": "Fréamhshamhail",
"Download desktop version": "Íoslódáil leagan deisce",
"No favorite books": "Níl aon leabhair is fearr leat",
@@ -407,4 +407,4 @@
"Pot is running": "Tá pota ag rith",
"This feature is only available in the developer version": "Níl an ghné seo ar fáil ach sa leagan forbróra",
"Subject can't be empty": "Ní féidir le hábhar a bheith folamh"
}
}

View File

@@ -353,7 +353,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -355,7 +355,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -349,7 +349,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -347,7 +347,7 @@
"The imported books will not be copied to library, only linked to the original book path": "The imported books will not be copied to the library, only linked to the original book path",
"Reader menu will not be triggered by hovering but clicking on the area": "Reader menu will not be triggered by hovering but clicking on the area",
"Gesture and UI optimization for touch screen": "Gesture and UI optimization for touch screen",
"The book that you read from last time will be open automatically when launching": "The book you read last will open automatically at launch",
"The book that you read from last time will be open automatically when launching": "The last book you read will open automatically at launch",
"All the folded content will be expanded in the navigation panel": "All the folded content will be expanded in the navigation panel",
"Reader window will be maximized to fit the screen when opening a book": "Reader window will be maximized to fit the screen when opening a book",
"Open books in the main window": "Open books in the main window",

View File

@@ -171,35 +171,44 @@ class FeedbackDialog extends Component<
: { marginTop: "30px" }
}
/>
<input
type="file"
multiple={true}
id="feedback-file-box"
name="file"
className="feedback-file-box"
onChange={(event) => {
if (!event || !event.target || !event.target.files) {
toast.error("Empty files");
}
let files: any = event.target.files;
let zip = new JSZip();
for (let index = 0; index < files.length; index++) {
const file = files[index];
var fileSize = file.size;
var fileSizeMB = fileSize / (1024 * 1024);
if (fileSizeMB > 20) {
toast.error(this.props.t("File size is larger than 20MB"));
event.target.value = "";
break;
} else {
zip.file(file.name, file);
<div className="feedback-dialog-file-container">
<div className="feedback-dialog-file-text">
<Trans>Upload attachments</Trans>
</div>
<div></div>
<input
type="file"
multiple={true}
id="feedback-file-box"
name="file"
className="feedback-file-box"
onChange={(event) => {
if (!event || !event.target || !event.target.files) {
toast.error("Empty files");
}
}
zip.generateAsync({ type: "blob" }).then((content) => {
this.setState({ fileContent: content });
});
}}
/>
let files: any = event.target.files;
let zip = new JSZip();
for (let index = 0; index < files.length; index++) {
const file = files[index];
var fileSize = file.size;
var fileSizeMB = fileSize / (1024 * 1024);
if (fileSizeMB > 20) {
toast.error(
this.props.t("File size is larger than 20MB")
);
event.target.value = "";
break;
} else {
zip.file(file.name, file);
}
}
zip.generateAsync({ type: "blob" }).then((content) => {
this.setState({ fileContent: content });
});
}}
/>
</div>
<textarea
name="content"
placeholder={this.props.t("Detailed description of the problem")}

View File

@@ -10,12 +10,29 @@
animation: popup 0.1s ease-in-out 0s 1;
border-radius: 5px;
}
.feedback-dialog-file-container {
width: 100%;
height: 30px;
/* margin-top: 10px; */
margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: center;
}
.feedback-file-box {
display: inline-block;
height: 30px;
margin-left: 35px;
/* margin-left: 35px; */
cursor: pointer;
font-size: 15px;
color: rgb(35, 170, 242);
}
.feedback-dialog-file-text {
margin-left: 25px;
min-width: 100px;
height: 30px;
font-size: 15px;
margin-top: 5px;
}
.feedback-file-box::placeholder {
color: #999;

View File

@@ -151,6 +151,9 @@ export const langList = [
{ label: "བོད་སྐད།", value: "bo" },
{ label: "हिंदी", value: "hi" },
{ label: "Magyar", value: "hu" },
{ label: "Gaeilge", value: "ga" },
{ label: "Svenska", value: "sv" },
{ label: "Tagalog", value: "tl" },
];
export const searchList = [

View File

@@ -3,6 +3,9 @@ const resources = [
"./assets/locales/ar/translation.json",
"./assets/locales/bg/translation.json",
"./assets/locales/bn/translation.json",
"./assets/locales/tl/translation.json",
"./assets/locales/sv/translation.json",
"./assets/locales/ga/translation.json",
"./assets/locales/bo/translation.json",
"./assets/locales/cs/translation.json",
"./assets/locales/da/translation.json",

View File

@@ -18,6 +18,9 @@ import translationHI from "./assets/locales/hi/translation.json";
import translationBG from "./assets/locales/bg/translation.json";
import translationIT from "./assets/locales/it/translation.json";
import translationBN from "./assets/locales/bn/translation.json";
import translationTL from "./assets/locales/tl/translation.json";
import translationSV from "./assets/locales/sv/translation.json";
import translationGA from "./assets/locales/ga/translation.json";
import translationNL from "./assets/locales/nl/translation.json";
import translationKO from "./assets/locales/ko/translation.json";
import translationDE from "./assets/locales/de/translation.json";
@@ -86,6 +89,15 @@ const resources = {
bn: {
translation: translationBN,
},
tl: {
translation: translationTL,
},
sv: {
translation: translationSV,
},
ga: {
translation: translationGA,
},
ko: {
translation: translationKO,
},

View File

@@ -68,6 +68,15 @@ const Router = () => {
} else if (navigator.language.startsWith("bn")) {
i18n.changeLanguage("bn");
ConfigService.setReaderConfig("lang", "bn");
} else if (navigator.language.startsWith("tl")) {
i18n.changeLanguage("tl");
ConfigService.setReaderConfig("lang", "tl");
} else if (navigator.language.startsWith("sv")) {
i18n.changeLanguage("sv");
ConfigService.setReaderConfig("lang", "sv");
} else if (navigator.language.startsWith("ga")) {
i18n.changeLanguage("ga");
ConfigService.setReaderConfig("lang", "ga");
} else if (navigator.language.startsWith("th")) {
i18n.changeLanguage("th");
ConfigService.setReaderConfig("lang", "th");

View File

@@ -8,6 +8,7 @@ import DatabaseService from "../storage/databaseService";
import { saveAs } from "file-saver";
import JSZip from "jszip";
declare var window: any;
export const databaseList = ["books", "notes", "bookmarks", "words", "plugins"];
export const backup = async (service: string): Promise<Boolean> => {
let fileName = "data.zip";
if (service === "local") {
@@ -79,6 +80,7 @@ export const backupFromPath = async (targetPath: string, fileName: string) => {
fs.mkdirSync(path.join(targetPath));
}
backupToConfigJson();
if (fs.existsSync(path.join(dataPath, "book"))) {
zip.addLocalFolder(path.join(dataPath, "book"), "book");
}
@@ -88,21 +90,19 @@ export const backupFromPath = async (targetPath: string, fileName: string) => {
if (fs.existsSync(path.join(dataPath, "config", "config.json"))) {
zip.addLocalFile(path.join(dataPath, "config", "config.json"), "config");
}
if (fs.existsSync(path.join(dataPath, "config", "notes.db"))) {
zip.addLocalFile(path.join(dataPath, "config", "notes.db"), "config");
}
if (fs.existsSync(path.join(dataPath, "config", "books.db"))) {
zip.addLocalFile(path.join(dataPath, "config", "books.db"), "config");
}
if (fs.existsSync(path.join(dataPath, "config", "bookmarks.db"))) {
zip.addLocalFile(path.join(dataPath, "config", "bookmarks.db"), "config");
}
if (fs.existsSync(path.join(dataPath, "config", "words.db"))) {
zip.addLocalFile(path.join(dataPath, "config", "words.db"), "config");
}
if (fs.existsSync(path.join(dataPath, "config", "plugins.db"))) {
zip.addLocalFile(path.join(dataPath, "config", "plugins.db"), "config");
for (let i = 0; i < databaseList.length; i++) {
await window.require("electron").ipcRenderer.invoke("close-database", {
dbName: databaseList[i],
storagePath: getStorageLocation(),
});
if (fs.existsSync(path.join(dataPath, "config", databaseList[i] + ".db"))) {
zip.addLocalFile(
path.join(dataPath, "config", databaseList[i] + ".db"),
"config"
);
}
}
await zip.writeZip(path.join(targetPath, fileName));
// return new Blob([zip.toBuffer()], { type: "application/zip" });