Skip to content

Commit e98d97a

Browse files
authored
feat(i18n): readermode translations and icon (#1961)
* fix(readermode): Translations and a new icon for ReaderMode * Formatted * Replaced icon
1 parent c33f96e commit e98d97a

30 files changed

+101
-10
lines changed

quartz/components/ReaderMode.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,31 @@
22
import readerModeScript from "./scripts/readermode.inline"
33
import styles from "./styles/readermode.scss"
44
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
5+
import { i18n } from "../i18n"
56
import { classNames } from "../util/lang"
67

7-
const ReaderMode: QuartzComponent = ({ displayClass }: QuartzComponentProps) => {
8+
const ReaderMode: QuartzComponent = ({ displayClass, cfg }: QuartzComponentProps) => {
89
return (
910
<button class={classNames(displayClass, "readermode")}>
1011
<svg
1112
xmlns="http://www.w3.org/2000/svg"
13+
xmlnsXlink="http://www.w3.org/1999/xlink"
14+
version="1.1"
1215
class="readerIcon"
13-
viewBox="0 0 24 24"
14-
fill="none"
16+
fill="currentColor"
1517
stroke="currentColor"
16-
stroke-width="2"
18+
stroke-width="0.2"
1719
stroke-linecap="round"
1820
stroke-linejoin="round"
21+
width="64px"
22+
height="64px"
23+
viewBox="0 0 24 24"
24+
aria-label={i18n(cfg.locale).components.readerMode.title}
1925
>
20-
<rect x="6" y="4" width="12" height="16" rx="1"></rect>
21-
<line x1="9" y1="8" x2="15" y2="8"></line>
22-
<line x1="9" y1="12" x2="15" y2="12"></line>
23-
<line x1="9" y1="16" x2="13" y2="16"></line>
26+
<title>{i18n(cfg.locale).components.readerMode.title}</title>
27+
<g transform="translate(-1.8, -1.8) scale(1.15, 1.2)">
28+
<path d="M8.9891247,2.5 C10.1384702,2.5 11.2209868,2.96705384 12.0049645,3.76669482 C12.7883914,2.96705384 13.8709081,2.5 15.0202536,2.5 L18.7549359,2.5 C19.1691495,2.5 19.5049359,2.83578644 19.5049359,3.25 L19.5046891,4.004 L21.2546891,4.00457396 C21.6343849,4.00457396 21.9481801,4.28672784 21.9978425,4.6528034 L22.0046891,4.75457396 L22.0046891,20.25 C22.0046891,20.6296958 21.7225353,20.943491 21.3564597,20.9931534 L21.2546891,21 L2.75468914,21 C2.37499337,21 2.06119817,20.7178461 2.01153575,20.3517706 L2.00468914,20.25 L2.00468914,4.75457396 C2.00468914,4.37487819 2.28684302,4.061083 2.65291858,4.01142057 L2.75468914,4.00457396 L4.50368914,4.004 L4.50444233,3.25 C4.50444233,2.87030423 4.78659621,2.55650904 5.15267177,2.50684662 L5.25444233,2.5 L8.9891247,2.5 Z M4.50368914,5.504 L3.50468914,5.504 L3.50468914,19.5 L10.9478955,19.4998273 C10.4513189,18.9207296 9.73864328,18.5588115 8.96709342,18.5065584 L8.77307039,18.5 L5.25444233,18.5 C4.87474657,18.5 4.56095137,18.2178461 4.51128895,17.8517706 L4.50444233,17.75 L4.50368914,5.504 Z M19.5049359,17.75 C19.5049359,18.1642136 19.1691495,18.5 18.7549359,18.5 L15.2363079,18.5 C14.3910149,18.5 13.5994408,18.8724714 13.0614828,19.4998273 L20.5046891,19.5 L20.5046891,5.504 L19.5046891,5.504 L19.5049359,17.75 Z M18.0059359,3.999 L15.0202536,4 L14.8259077,4.00692283 C13.9889509,4.06666544 13.2254227,4.50975805 12.7549359,5.212 L12.7549359,17.777 L12.7782651,17.7601316 C13.4923805,17.2719483 14.3447024,17 15.2363079,17 L18.0059359,16.999 L18.0056891,4.798 L18.0033792,4.75457396 L18.0056891,4.71 L18.0059359,3.999 Z M8.9891247,4 L6.00368914,3.999 L6.00599909,4.75457396 L6.00599909,4.75457396 L6.00368914,4.783 L6.00368914,16.999 L8.77307039,17 C9.57551536,17 10.3461406,17.2202781 11.0128313,17.6202194 L11.2536891,17.776 L11.2536891,5.211 C10.8200889,4.56369974 10.1361548,4.13636104 9.37521067,4.02745763 L9.18347055,4.00692283 L8.9891247,4 Z" />
29+
</g>
2430
</svg>
2531
</button>
2632
)

quartz/components/styles/readermode.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
width: 20px;
1616
height: 20px;
1717
top: calc(50% - 10px);
18+
fill: var(--darkgray);
1819
stroke: var(--darkgray);
1920
transition: opacity 0.1s ease;
2021
}

quartz/i18n/locales/ar-SA.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ export default {
3232
explorer: {
3333
title: "المستعرض",
3434
},
35+
readerMode: {
36+
title: "وضع القارئ",
37+
},
3538
footer: {
3639
createdWith: "أُنشئ باستخدام",
3740
},

quartz/i18n/locales/ca-ES.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default {
2929
lightMode: "Mode clar",
3030
darkMode: "Mode fosc",
3131
},
32+
readerMode: {
33+
title: "Mode lector",
34+
},
3235
explorer: {
3336
title: "Explorador",
3437
},

quartz/i18n/locales/cs-CZ.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default {
2929
lightMode: "Světlý režim",
3030
darkMode: "Tmavý režim",
3131
},
32+
readerMode: {
33+
title: "Režim čtečky",
34+
},
3235
explorer: {
3336
title: "Procházet",
3437
},

quartz/i18n/locales/de-DE.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ export default {
2626
noBacklinksFound: "Keine Backlinks gefunden",
2727
},
2828
themeToggle: {
29-
lightMode: "Light Mode",
30-
darkMode: "Dark Mode",
29+
lightMode: "Heller Modus",
30+
darkMode: "Dunkler Modus",
31+
},
32+
readerMode: {
33+
title: "Lesemodus",
3134
},
3235
explorer: {
3336
title: "Explorer",

quartz/i18n/locales/definition.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export interface Translation {
3131
lightMode: string
3232
darkMode: string
3333
}
34+
readerMode: {
35+
title: string
36+
}
3437
explorer: {
3538
title: string
3639
}

quartz/i18n/locales/en-GB.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default {
2929
lightMode: "Light mode",
3030
darkMode: "Dark mode",
3131
},
32+
readerMode: {
33+
title: "Reader mode",
34+
},
3235
explorer: {
3336
title: "Explorer",
3437
},

quartz/i18n/locales/en-US.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default {
2929
lightMode: "Light mode",
3030
darkMode: "Dark mode",
3131
},
32+
readerMode: {
33+
title: "Reader mode",
34+
},
3235
explorer: {
3336
title: "Explorer",
3437
},

quartz/i18n/locales/es-ES.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ export default {
2929
lightMode: "Modo claro",
3030
darkMode: "Modo oscuro",
3131
},
32+
readerMode: {
33+
title: "Modo lector",
34+
},
3235
explorer: {
3336
title: "Explorador",
3437
},

0 commit comments

Comments
 (0)