Skip to content

Commit 46ac923

Browse files
committed
fix: annotation named colours (removed 2 blue hues, kept translated "cyan"), now need to handle import/export (Issue #2806 )
1 parent 8acc43e commit 46ac923

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

src/renderer/reader/components/AnnotationEdit.tsx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,26 @@ interface IProps {
4343
btext?: string;
4444
}
4545

46+
// DO NOT REMOVE THIS COMMENT BLOCK (USED FOR TRANSLATOR KEYS DETECTION DURING CODE SCANNING)
4647
// __("reader.annotations.colors.red")
4748
// __("reader.annotations.colors.orange")
4849
// __("reader.annotations.colors.yellow")
4950
// __("reader.annotations.colors.green")
50-
// __("reader.annotations.colors.bluegreen")
51-
// __("reader.annotations.colors.lightblue")
51+
// __xxx("reader.annotations.colors.bluegreen") // ===> "bluegreen" translation becomes unused!
52+
// __xxx("reader.annotations.colors.lightblue") // ===> "lightblue" translation becomes unused!
5253
// __("reader.annotations.colors.cyan")
5354
// __("reader.annotations.colors.purple")
5455

56+
// https://github.com/readium/annotations/blob/main/README.md#14-body
5557
export const annotationsColorsLight: Record<string, TTranslatorKeyParameter> = {
56-
"#EB9694": "reader.annotations.colors.red",
57-
"#FAD0C3": "reader.annotations.colors.orange",
58-
"#FEF3BD": "reader.annotations.colors.yellow",
59-
"#C1EAC5": "reader.annotations.colors.green",
60-
"#BEDADC": "reader.annotations.colors.bluegreen",
61-
"#C4DEF6": "reader.annotations.colors.lightblue",
62-
"#BED3F3": "reader.annotations.colors.cyan",
63-
"#D4C4FB": "reader.annotations.colors.purple",
58+
"#EB9694": "reader.annotations.colors.red", // "pink"
59+
"#FAD0C3": "reader.annotations.colors.orange", // "orange"
60+
"#FEF3BD": "reader.annotations.colors.yellow", // "yellow"
61+
"#C1EAC5": "reader.annotations.colors.green", // "green"
62+
// "#BEDADC": "reader.annotations.colors.bluegreen", // ===> "bluegreen" translation becomes unused!
63+
// "#C4DEF6": "reader.annotations.colors.lightblue", // ===> "lightblue" translation becomes unused!
64+
"#BED3F3": "reader.annotations.colors.cyan", // "blue"
65+
"#D4C4FB": "reader.annotations.colors.purple", // "purple"
6466
};
6567

6668
const drawType: TDrawType[] = [
@@ -191,7 +193,7 @@ export const AnnotationEdit: React.FC<IProps> = (props) => {
191193
checked={colorSelected === colorHex}
192194
aria-label={__(translatorKey)}
193195
/>
194-
<label htmlFor={`anno_color_${uuid}_${colorHex}`}
196+
<label title={__(translatorKey)} htmlFor={`anno_color_${uuid}_${colorHex}`}
195197
style={{ backgroundColor: colorHex, border: colorSelected === colorHex ? "1px solid var(--color-dark-grey)" : "" }}
196198
>
197199
{colorSelected === colorHex ? <SVG ariaHidden svg={CheckIcon} /> : <></>}

src/renderer/reader/components/ReaderMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,7 @@ const AnnotationList: React.FC<{ annotationUUIDFocused: string, resetAnnotationU
10491049
</div>
10501050
</summary>
10511051
<TagList items={annotationsColors} className={stylesAnnotations.annotations_filter_taglist}>
1052-
{(item) => <Tag className={stylesAnnotations.annotations_filter_color} style={{ backgroundColor: item.hex, outlineColor: item.hex }} id={item.hex} textValue={item.name}></Tag>}
1052+
{(item) => <Tag className={stylesAnnotations.annotations_filter_color} style={{ backgroundColor: item.hex, outlineColor: item.hex }} id={item.hex} textValue={item.name} ref={(r) => { if (r && (r as unknown as HTMLDivElement).setAttribute) { (r as unknown as HTMLDivElement).setAttribute("title", item.name); } }}></Tag>}
10531053
</TagList>
10541054
</details>
10551055
</TagGroup>

0 commit comments

Comments
 (0)