Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/plain-font-names.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@youversion/platform-react-ui': patch
---

Keep the reader font labels Inter and Untitled Serif in every language.
35 changes: 35 additions & 0 deletions packages/ui/src/components/bible-reader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
} from '@/lib/verse-html-utils';

import { installResizeObserverStub } from '@/test/dom-stubs';
import i18n from '@/i18n';

installResizeObserverStub();

Expand Down Expand Up @@ -460,6 +461,40 @@ it('keeps chapter targets canonical while semantic icons follow RTL interface di
).toContain('8.29289');
});

it('keeps Inter and Untitled Serif in Arabic and Welsh reader font settings', async () => {
const previousLanguage = i18n.language;

function renderFontSettings(): ReturnType<typeof render> {
return render(
<BibleThemeSettingsContent
theme="light"
fontSize={16}
fontFamily={INTER_FONT}
lineSpacing={BIBLE_READER_SPACING.DEFAULT}
onFontSelected={vi.fn()}
onFontIncreased={vi.fn()}
onFontDecreased={vi.fn()}
onChangeLineSpacing={vi.fn()}
/>,
);
}

try {
await i18n.changeLanguage('ar');
const arabic = renderFontSettings();
expect(screen.getByRole('button', { name: /Inter/ })).toBeInTheDocument();
expect(screen.queryByText('إدخال')).not.toBeInTheDocument();
arabic.unmount();

await i18n.changeLanguage('cy');
renderFontSettings();
expect(screen.getByRole('button', { name: /Untitled Serif/ })).toBeInTheDocument();
expect(screen.queryByText('Serif Dideitl')).not.toBeInTheDocument();
} finally {
await i18n.changeLanguage(previousLanguage);
}
});

describe('BibleReader version picker language', () => {
it('seeds the version picker with defaultLanguageId instead of the browser language', () => {
const { overrides, requestedLanguages } = overridesRecordingVersionLanguage();
Expand Down
7 changes: 5 additions & 2 deletions packages/ui/src/components/bible-reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1379,6 +1379,9 @@ function UserMenu() {
);
}

const INTER_FONT_NAME = 'Inter';
const UNTITLED_SERIF_FONT_NAME = 'Untitled Serif';

export function BibleThemeSettingsContent({
theme,
fontSize,
Expand Down Expand Up @@ -1464,7 +1467,7 @@ export function BibleThemeSettingsContent({
>
{t('fontLabel')}
</span>
<span className="yv:sm:text-xl yv:text-base">{t('interFontName')}</span>
<span className="yv:sm:text-xl yv:text-base">{INTER_FONT_NAME}</span>
</div>
</Button>
<Button
Expand All @@ -1489,7 +1492,7 @@ export function BibleThemeSettingsContent({
{t('fontLabel')}
</span>
<span className="yv:sm:text-xl yv:text-base yv:font-serif">
{t('untitledSerifFontName')}
{UNTITLED_SERIF_FONT_NAME}
</span>
</div>
</Button>
Expand Down
Loading