Skip to content

Add left text align#198

Open
DE0CH wants to merge 3 commits intopacexy:mainfrom
DE0CH:feature/text-align
Open

Add left text align#198
DE0CH wants to merge 3 commits intopacexy:mainfrom
DE0CH:feature/text-align

Conversation

@DE0CH
Copy link
Copy Markdown

@DE0CH DE0CH commented Mar 12, 2026

This PR add an option for left text align in addition to justified.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 12, 2026

@DE0CH is attempting to deploy a commit to the pacexy Team on Vercel.

A member of the Team first needs to authorize it.

@DE0CH
Copy link
Copy Markdown
Author

DE0CH commented Mar 13, 2026

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TypographyConfiguration with a textAlign setting.
  • 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, and zh-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.

Comment on lines +166 to +175
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>
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants