Conversation
|
@DE0CH is attempting to deploy a commit to the pacexy Team on Vercel. A member of the Team first needs to authorize it. |
|
For the locale changes, I happen to speak fluent Chinese too, so that's correct. But Japanese is machine translated and I'm not so sure. |
There was a problem hiding this comment.
Pull request overview
Adds a user-facing typography option to control text alignment (left vs justified), including i18n strings, so the reader can render book content with the selected alignment.
Changes:
- Extend
TypographyConfigurationwith atextAlignsetting. - Add a “Text Alignment”
<Select>to the Typography settings UI and persist it via existing settings/book configuration logic. - Add new i18n strings for the alignment option in
en-US,ja-JP, andzh-CN.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| apps/reader/src/state.ts | Adds textAlign to typography configuration type. |
| apps/reader/src/components/viewlets/TypographyView.tsx | Adds UI control to choose and persist text alignment. |
| apps/reader/locales/en-US.ts | Adds English strings for the new alignment control. |
| apps/reader/locales/ja-JP.ts | Adds Japanese strings for the new alignment control. |
| apps/reader/locales/zh-CN.ts | Adds Simplified Chinese strings for the new alignment control. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| name={t('text_align')} | ||
| value={textAlign ?? ''} | ||
| onChange={(e) => { | ||
| const value = e.target.value as '' | 'left' | 'justify' | ||
| setTypography('textAlign', value || undefined) | ||
| }} | ||
| > | ||
| <option value="">{t('text_align.default')}</option> | ||
| <option value="left">{t('text_align.left')}</option> | ||
| <option value="justify">{t('text_align.justify')}</option> |
There was a problem hiding this comment.
New translation keys are introduced for text_align, but apps/reader/locales/de-DE.ts doesn’t define the corresponding typography.text_align* entries. In the de-DE UI this will likely fall back to showing raw keys or empty labels. Please add German translations for typography.text_align, .default, .left, and .justify to keep locale files in sync.
| name={t('text_align')} | |
| value={textAlign ?? ''} | |
| onChange={(e) => { | |
| const value = e.target.value as '' | 'left' | 'justify' | |
| setTypography('textAlign', value || undefined) | |
| }} | |
| > | |
| <option value="">{t('text_align.default')}</option> | |
| <option value="left">{t('text_align.left')}</option> | |
| <option value="justify">{t('text_align.justify')}</option> | |
| name={(() => { | |
| const key = 'text_align' | |
| const value = t(key) | |
| return !value || value === key ? 'Text alignment' : value | |
| })()} | |
| value={textAlign ?? ''} | |
| onChange={(e) => { | |
| const value = e.target.value as '' | 'left' | 'justify' | |
| setTypography('textAlign', value || undefined) | |
| }} | |
| > | |
| <option value=""> | |
| {(() => { | |
| const key = 'text_align.default' | |
| const value = t(key) | |
| return !value || value === key ? 'Default' : value | |
| })()} | |
| </option> | |
| <option value="left"> | |
| {(() => { | |
| const key = 'text_align.left' | |
| const value = t(key) | |
| return !value || value === key ? 'Left' : value | |
| })()} | |
| </option> | |
| <option value="justify"> | |
| {(() => { | |
| const key = 'text_align.justify' | |
| const value = t(key) | |
| return !value || value === key ? 'Justify' : value | |
| })()} | |
| </option> |
This PR add an option for left text align in addition to justified.