mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-06-16 20:01:17 -04:00
fix: update Chinese translations for color terms and adjust padding in header styles
This commit is contained in:
@@ -612,16 +612,16 @@
|
||||
"Not supported yet": "暂不支持",
|
||||
"Update to": "更新至",
|
||||
"Date": "更新日期:",
|
||||
"Blue": "天蓝",
|
||||
"Red": "赤红",
|
||||
"Green": "翠绿",
|
||||
"Purple": "紫罗兰",
|
||||
"Orange": "橙色",
|
||||
"Pink": "粉色",
|
||||
"Yellow": "黄色",
|
||||
"Violet": "紫色",
|
||||
"Sky": "天空蓝",
|
||||
"Slate": "石板灰",
|
||||
"Blue": "碧落",
|
||||
"Red": "胭脂",
|
||||
"Green": "苍翠",
|
||||
"Purple": "紫苑",
|
||||
"Orange": "橘黄",
|
||||
"Pink": "芙蓉",
|
||||
"Yellow": "流金",
|
||||
"Violet": "幽兰",
|
||||
"Sky": "霁蓝",
|
||||
"Slate": "烟岚",
|
||||
"Unauthorize": "取消授权",
|
||||
"Show page border": "显示版框",
|
||||
"Remember window's size": "记忆阅读器窗口大小",
|
||||
|
||||
@@ -331,79 +331,28 @@ class PopupAssist extends React.Component<PopupAssistProps, PopupAssistState> {
|
||||
|
||||
{this.state.isAddNew && (
|
||||
<div
|
||||
className="trans-add-new-container"
|
||||
style={{ fontWeight: 500, marginTop: "60px", height: "170px" }}
|
||||
style={{
|
||||
marginTop: "150px",
|
||||
textAlign: "center",
|
||||
fontSize: "17px",
|
||||
color: "#f16464",
|
||||
}}
|
||||
>
|
||||
<textarea
|
||||
name="url"
|
||||
placeholder={this.props.t(
|
||||
"Paste the code of the plugin here, check out document to learn how to get more plugins"
|
||||
)}
|
||||
id="trans-add-content-box"
|
||||
className="trans-add-content-box"
|
||||
onContextMenu={() => {
|
||||
handleContextMenu("trans-add-content-box");
|
||||
<span
|
||||
style={{
|
||||
textDecoration: "underline",
|
||||
cursor: "pointer",
|
||||
textAlign: "center",
|
||||
}}
|
||||
/>
|
||||
<div className="trans-add-button-container">
|
||||
<div
|
||||
className="trans-add-cancel"
|
||||
style={{ color: "#f16464" }}
|
||||
onClick={() => {
|
||||
if (
|
||||
ConfigService.getReaderConfig("lang") &&
|
||||
ConfigService.getReaderConfig("lang").startsWith("zh")
|
||||
) {
|
||||
openExternalUrl(getWebsiteUrl() + "/zh/plugin");
|
||||
} else {
|
||||
openExternalUrl(getWebsiteUrl() + "/en/plugin");
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Trans>Document</Trans>
|
||||
</div>
|
||||
<div
|
||||
className="trans-add-cancel"
|
||||
onClick={() => {
|
||||
this.setState({ isAddNew: false });
|
||||
}}
|
||||
>
|
||||
<Trans>Cancel</Trans>
|
||||
</div>
|
||||
<div
|
||||
className="trans-add-confirm"
|
||||
onClick={async () => {
|
||||
let value: string = (
|
||||
document.querySelector(
|
||||
"#trans-add-content-box"
|
||||
) as HTMLTextAreaElement
|
||||
).value;
|
||||
if (value) {
|
||||
let plugin: any = JSON.parse(value);
|
||||
plugin.key = plugin.identifier;
|
||||
if (!(await checkPlugin(plugin))) {
|
||||
toast.error(this.props.t("Plugin verification failed"));
|
||||
return;
|
||||
}
|
||||
if (
|
||||
this.props.plugins.find((item) => item.key === plugin.key)
|
||||
) {
|
||||
await DatabaseService.updateRecord(plugin, "plugins");
|
||||
} else {
|
||||
await DatabaseService.saveRecord(plugin, "plugins");
|
||||
}
|
||||
this.props.handleFetchPlugins();
|
||||
toast.success(this.props.t("Addition successful"));
|
||||
}
|
||||
this.setState({
|
||||
isAddNew: false,
|
||||
answer: this.props.t("Please select the service"),
|
||||
});
|
||||
}}
|
||||
>
|
||||
<Trans>Confirm</Trans>
|
||||
</div>
|
||||
</div>
|
||||
onClick={() => {
|
||||
this.props.handleOpenMenu(false);
|
||||
this.props.handleMenuMode("");
|
||||
this.props.handleSetting(true);
|
||||
this.props.handleSettingMode("plugins");
|
||||
}}
|
||||
>
|
||||
<Trans>Add new plugin</Trans>
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
{!this.state.isAddNew && (
|
||||
|
||||
@@ -3,6 +3,8 @@ import {
|
||||
handleOpenMenu,
|
||||
handleMenuMode,
|
||||
handleFetchPlugins,
|
||||
handleSetting,
|
||||
handleSettingMode,
|
||||
} from "../../../store/actions";
|
||||
import { stateType } from "../../../store";
|
||||
import { withTranslation } from "react-i18next";
|
||||
@@ -18,6 +20,8 @@ const actionCreator = {
|
||||
handleOpenMenu,
|
||||
handleMenuMode,
|
||||
handleFetchPlugins,
|
||||
handleSetting,
|
||||
handleSettingMode,
|
||||
};
|
||||
export default connect(
|
||||
mapStateToProps,
|
||||
|
||||
@@ -6,6 +6,8 @@ export interface PopupAssistProps {
|
||||
handleOpenMenu: (isOpenMenu: boolean) => void;
|
||||
handleMenuMode: (menu: string) => void;
|
||||
handleFetchPlugins: () => void;
|
||||
handleSetting: (isShow: boolean) => void;
|
||||
handleSettingMode: (settingMode: string) => void;
|
||||
t: (title: string) => string;
|
||||
}
|
||||
export interface PopupAssistState {
|
||||
|
||||
@@ -536,6 +536,7 @@ class TextToSpeech extends React.Component<
|
||||
this.setState({ languageList, voiceList });
|
||||
};
|
||||
render() {
|
||||
console.log(this.state.voiceList);
|
||||
return (
|
||||
<>
|
||||
<div className="tts-player-container">
|
||||
@@ -711,9 +712,13 @@ class TextToSpeech extends React.Component<
|
||||
className="lang-setting-dropdown"
|
||||
id="text-speech-voice"
|
||||
onChange={(event) => {
|
||||
ConfigService.setReaderConfig("voiceName", event.target.value);
|
||||
console.log("chagned", event.target.value);
|
||||
let selectedValue = event.target.value;
|
||||
let [voiceName, plugin] = selectedValue.split("#");
|
||||
console.log(voiceName, plugin, this.voices);
|
||||
ConfigService.setReaderConfig("voiceName", voiceName);
|
||||
let voice = this.voices.find(
|
||||
(item) => item.name === event.target.value
|
||||
(item) => item.name === voiceName && item.plugin === plugin
|
||||
);
|
||||
if (!voice) {
|
||||
return;
|
||||
@@ -723,6 +728,7 @@ class TextToSpeech extends React.Component<
|
||||
} else {
|
||||
ConfigService.setReaderConfig("voiceEngine", "system");
|
||||
}
|
||||
console.log(voice);
|
||||
if (
|
||||
voice.plugin === "official-ai-voice-plugin" &&
|
||||
event.target.value.indexOf("Neural") > -1
|
||||
@@ -747,11 +753,14 @@ class TextToSpeech extends React.Component<
|
||||
(item) => {
|
||||
return (
|
||||
<option
|
||||
value={item.name}
|
||||
key={item.name}
|
||||
value={[item.name, item.plugin].join("#")}
|
||||
key={[item.name, item.plugin].join("#")}
|
||||
className="lang-setting-option"
|
||||
selected={
|
||||
item.name === ConfigService.getReaderConfig("voiceName")
|
||||
item.name ===
|
||||
ConfigService.getReaderConfig("voiceName") &&
|
||||
item.plugin ===
|
||||
ConfigService.getReaderConfig("voiceEngine")
|
||||
}
|
||||
>
|
||||
{this.props.t(item.displayName || item.name)}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
.header-chapter-name,
|
||||
.header-book-name {
|
||||
width: 50%;
|
||||
padding-left: 5%;
|
||||
padding-right: 5%;
|
||||
padding-left: 10%;
|
||||
padding-right: 10%;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
|
||||
Reference in New Issue
Block a user