Skip to content

Commit

Permalink
fix(annotate): modal and docked modes allow options configuration eve…
Browse files Browse the repository at this point in the history
…n with empty highlights, also fixed translations (PR #2215 Fixes #2214)
  • Loading branch information
danielweck committed May 16, 2024
1 parent 6c7eb29 commit 5f1d1b2
Show file tree
Hide file tree
Showing 27 changed files with 38 additions and 65 deletions.
21 changes: 11 additions & 10 deletions src/renderer/reader/components/ReaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ export const ReaderMenu: React.FC<IBaseProps> = (props) => {
// const pubId = useSelector((state: IReaderRootState) => state.reader.info.publicationIdentifier);
const searchEnable = useSelector((state: IReaderRootState) => state.search.enable);
const bookmarks = useSelector((state: IReaderRootState) => state.reader.bookmark).map(([, v]) => v);
const annotations = useSelector((state: IReaderRootState) => state.reader.annotation).map(([, v]) => v);
// const annotations = useSelector((state: IReaderRootState) => state.reader.annotation).map(([, v]) => v);
const readerConfig = useSelector((state: IReaderRootState) => state.reader.config);

// const isFixedLayoutPublication = r2Publication.Metadata?.Rendition?.Layout === "fixed";
Expand Down Expand Up @@ -1298,8 +1298,9 @@ export const ReaderMenu: React.FC<IBaseProps> = (props) => {
svg: TargetIcon,
};

// disabled={!annotations || annotations.length === 0}
const AnnotationTrigger =
<Tabs.Trigger value="tab-annotation" key={"tab-annotation"} data-value={"tab-annotation"} title={__("reader.marks.annotations")} disabled={!annotations || annotations.length === 0}>
<Tabs.Trigger value="tab-annotation" key={"tab-annotation"} data-value={"tab-annotation"} title={__("reader.marks.annotations")} >
<SVG ariaHidden svg={AnnotationIcon} />
<h3>{__("reader.marks.annotations")}</h3>
</Tabs.Trigger>;
Expand Down Expand Up @@ -1467,14 +1468,14 @@ export const ReaderMenu: React.FC<IBaseProps> = (props) => {
<SVG ariaHidden svg={ChevronIcon} />
</span>
</summary>
{dockedMode ? <div className={stylesAnnotations.annotations_checkbox}>
<input type="checkbox" id="advancedAnnotations" name="advancedAnnotations" checked={serialAnnotator} onChange={() => { setSerialAnnotatorMode(!serialAnnotator); }} />
<label htmlFor="advancedAnnotations">
<h4>{__("reader.annotations.advancedMode")}</h4>
{__("reader.annotations.advancedModeDetails")}
</label>
</div> : <></>
}
{/* {dockedMode ? */}
<div className={stylesAnnotations.annotations_checkbox}>
<input type="checkbox" id="advancedAnnotations" name="advancedAnnotations" checked={serialAnnotator} onChange={() => { setSerialAnnotatorMode(!serialAnnotator); }} />
<label htmlFor="advancedAnnotations">
<h4>{__("reader.annotations.advancedMode")}</h4>
</label>
</div>
{/* : <></>} */}
<div className={stylesAnnotations.annotations_checkbox}>
<input type="checkbox" id="quickAnnotations" name="quickAnnotations" checked={readerConfig.annotation_popoverNotOpenOnNoteTaking}
onChange={() => { dispatch(readerLocalActionSetConfig.build({ ...readerConfig, annotation_popoverNotOpenOnNoteTaking: !readerConfig.annotation_popoverNotOpenOnNoteTaking })); }}
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
5 changes: 2 additions & 3 deletions src/resources/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"lcpRightsCopy": "Copied characters",
"lcpRightsPrint": "Printed pages",
"lcpStart": "Start",
"LicenseLCP": "License (LCP)",
"licenceLCP": "License (LCP)",
"licenseOutOfDate": "Out of date LCP License.",
"licenseSignatureDateInvalid": "Invalid LCP license signature date.",
"licenseSignatureInvalid": "Invalid LCP license signature.",
Expand All @@ -303,8 +303,7 @@
"annotations": {
"Color": "Color",
"addNote": "Annotate",
"advancedMode": "Instant mode",
"advancedModeDetails": "(auto create when select text)",
"advancedMode": "Instant mode (auto create after select)",
"annotationsOptions": "Options",
"highlight": "Highlight",
"noSelectionToast": "No selection",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/eu.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
13 changes: 6 additions & 7 deletions src/resources/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -302,15 +302,14 @@
"reader": {
"annotations": {
"Color": "Couleur",
"addNote": "Ajouter une note",
"advancedMode": "Mode avancé",
"advancedModeDetails": "Mode serial annotateur",
"annotationsOptions": "Options d'annotation",
"addNote": "Annoter",
"advancedMode": "Mode instantané (création automatique après sélection)",
"annotationsOptions": "Options",
"highlight": "Surligner",
"noSelectionToast": "Aucune sélection",
"quickAnnotations": "Annotation rapide",
"saveNote": "Sauvegarder la note",
"toggleMarginMarks": "Afficher les marqueurs de note dans la marge"
"quickAnnotations": "Annotation rapide (sans éditeur)",
"saveNote": "Sauvegarder",
"toggleMarginMarks": "Afficher dans la marge"
},
"divina": {
"mute": "desactiver le son",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/gl.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/hr.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/ka.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/lt.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/pt-br.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/pt-pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/sl.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
1 change: 0 additions & 1 deletion src/resources/locales/zh-tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@
"Color": "",
"addNote": "",
"advancedMode": "",
"advancedModeDetails": "",
"annotationsOptions": "",
"highlight": "",
"noSelectionToast": "",
Expand Down
41 changes: 19 additions & 22 deletions src/typings/en.translation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,6 @@ declare namespace typed_i18n {
readonly "Color": string,
readonly "addNote": string,
readonly "advancedMode": string,
readonly "advancedModeDetails": string,
readonly "annotationsOptions": string,
readonly "highlight": string,
readonly "noSelectionToast": string,
Expand Down Expand Up @@ -809,14 +808,14 @@ declare namespace typed_i18n {
readonly "text": string,
readonly "theme": {
readonly "name": {
readonly "Neutral": string,
readonly "Night": string,
readonly "Sepia": string,
readonly "Contrast1": string,
readonly "Contrast2": string,
readonly "Contrast3": string,
readonly "Contrast4": string,
readonly "Paper": string
readonly "Neutral": string,
readonly "Night": string,
readonly "Paper": string,
readonly "Sepia": string
},
readonly "title": string
},
Expand All @@ -842,7 +841,6 @@ declare namespace typed_i18n {
readonly "Color": string,
readonly "addNote": string,
readonly "advancedMode": string,
readonly "advancedModeDetails": string,
readonly "annotationsOptions": string,
readonly "highlight": string,
readonly "noSelectionToast": string,
Expand All @@ -853,7 +851,6 @@ declare namespace typed_i18n {
(_: "reader.annotations.Color", __?: {}): string;
(_: "reader.annotations.addNote", __?: {}): string;
(_: "reader.annotations.advancedMode", __?: {}): string;
(_: "reader.annotations.advancedModeDetails", __?: {}): string;
(_: "reader.annotations.annotationsOptions", __?: {}): string;
(_: "reader.annotations.highlight", __?: {}): string;
(_: "reader.annotations.noSelectionToast", __?: {}): string;
Expand Down Expand Up @@ -1026,14 +1023,14 @@ declare namespace typed_i18n {
readonly "text": string,
readonly "theme": {
readonly "name": {
readonly "Neutral": string,
readonly "Night": string,
readonly "Sepia": string,
readonly "Contrast1": string,
readonly "Contrast2": string,
readonly "Contrast3": string,
readonly "Contrast4": string,
readonly "Paper": string
readonly "Neutral": string,
readonly "Night": string,
readonly "Paper": string,
readonly "Sepia": string
},
readonly "title": string
},
Expand Down Expand Up @@ -1106,35 +1103,35 @@ declare namespace typed_i18n {
(_: "reader.settings.text", __?: {}): string;
(_: "reader.settings.theme", __?: {}): {
readonly "name": {
readonly "Neutral": string,
readonly "Night": string,
readonly "Sepia": string,
readonly "Contrast1": string,
readonly "Contrast2": string,
readonly "Contrast3": string,
readonly "Contrast4": string,
readonly "Paper": string
readonly "Neutral": string,
readonly "Night": string,
readonly "Paper": string,
readonly "Sepia": string
},
readonly "title": string
};
(_: "reader.settings.theme.name", __?: {}): {
readonly "Neutral": string,
readonly "Night": string,
readonly "Sepia": string,
readonly "Contrast1": string,
readonly "Contrast2": string,
readonly "Contrast3": string,
readonly "Contrast4": string,
readonly "Paper": string
readonly "Neutral": string,
readonly "Night": string,
readonly "Paper": string,
readonly "Sepia": string
};
(_: "reader.settings.theme.name.Neutral", __?: {}): string;
(_: "reader.settings.theme.name.Night", __?: {}): string;
(_: "reader.settings.theme.name.Sepia", __?: {}): string;
(_: "reader.settings.theme.name.Contrast1", __?: {}): string;
(_: "reader.settings.theme.name.Contrast2", __?: {}): string;
(_: "reader.settings.theme.name.Contrast3", __?: {}): string;
(_: "reader.settings.theme.name.Contrast4", __?: {}): string;
(_: "reader.settings.theme.name.Neutral", __?: {}): string;
(_: "reader.settings.theme.name.Night", __?: {}): string;
(_: "reader.settings.theme.name.Paper", __?: {}): string;
(_: "reader.settings.theme.name.Sepia", __?: {}): string;
(_: "reader.settings.theme.title", __?: {}): string;
(_: "reader.settings.wordSpacing", __?: {}): string;
(_: "reader.svg", __?: {}): { readonly "left": string, readonly "right": string };
Expand Down

0 comments on commit 5f1d1b2

Please sign in to comment.