Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce duplication of font library group headings #63532

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function FontFamilies() {
<VStack spacing={ 4 }>
{ themeFonts.length > 0 && (
<VStack>
<Subtitle level={ 3 }>{ __( 'Theme Fonts' ) }</Subtitle>
<Subtitle level={ 3 }>{ __( 'Theme' ) }</Subtitle>
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a place where we should use _x and/or a translator comment to provide a context for translation. Translating just the word "Theme" or "Custom" in isolation may be challenging.

Suggested change
<Subtitle level={ 3 }>{ __( 'Theme' ) }</Subtitle>
/* translators: Heading for a list of fonts provided by the theme. */
<Subtitle level={ 3 }>{ _x( 'Theme', 'font source' ) }</Subtitle>

<ItemGroup isBordered isSeparated>
{ themeFonts.map( ( font ) => (
<FontFamilyItem
Expand All @@ -65,9 +65,7 @@ function FontFamilies() {
) }
{ customFonts.length > 0 && (
<VStack>
<Subtitle level={ 3 }>
{ __( 'Custom fonts' ) }
</Subtitle>
<Subtitle level={ 3 }>{ __( 'Custom' ) }</Subtitle>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<Subtitle level={ 3 }>{ __( 'Custom' ) }</Subtitle>
/* translators: Heading for a list of fonts installed by the user. */
<Subtitle level={ 3 }>{ _x( 'Custom', 'font source' ) }</Subtitle>

<ItemGroup isBordered isSeparated>
{ customFonts.map( ( font ) => (
<FontFamilyItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function InstalledFonts() {
{ baseThemeFonts.length > 0 && (
<VStack>
<h2 className="font-library-modal__fonts-title">
{ __( 'Theme Fonts' ) }
{ __( 'Theme' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ __( 'Theme' ) }
/* translators: Heading for a list of fonts provided by the theme. */
{ _x( 'Theme', 'font source' ) }

</h2>
{ /*
* Disable reason: The `list` ARIA role is redundant but
Expand Down Expand Up @@ -209,7 +209,7 @@ function InstalledFonts() {
{ baseCustomFonts.length > 0 && (
<VStack>
<h2 className="font-library-modal__fonts-title">
{ __( 'Custom fonts' ) }
{ __( 'Custom' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{ __( 'Custom' ) }
/* translators: Heading for a list of fonts installed by the user. */
{ _x( 'Custom', 'font source' ) }

</h2>
{ /*
* Disable reason: The `list` ARIA role is redundant but
Expand Down
Loading