Skip to content

Commit

Permalink
Font Libary: Add missing translation functions
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano committed Jan 29, 2024
1 parent 9ad7304 commit c3bb64c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions lib/experimental/fonts/font-library/class-wp-font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public static function unregister_font_collection( $slug ) {
_doing_it_wrong(
__METHOD__,
/* translators: %s: Font collection slug. */
sprintf( __( 'Font collection "%s" not found.', 'default' ), $slug ),
sprintf( __( 'Font collection "%s" not found.', 'gutenberg' ), $slug ),
'6.5.0'
);
return false;
Expand Down Expand Up @@ -143,7 +143,7 @@ public static function get_font_collection( $slug ) {
if ( array_key_exists( $slug, self::$collections ) ) {
return self::$collections[ $slug ];
}
return new WP_Error( 'font_collection_not_found', 'Font collection not found.' );
return new WP_Error( 'font_collection_not_found', __( 'Font collection not found.', 'gutenberg' ) );
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function get_items( $request ) {
if ( $page > $max_pages && $total_items > 0 ) {
return new WP_Error(
'rest_post_invalid_page_number',
__( 'The page number requested is larger than the number of pages available.', 'default' ),
__( 'The page number requested is larger than the number of pages available.', 'gutenberg' ),
array( 'status' => 400 )
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function register_routes() {
'force' => array(
'type' => 'boolean',
'default' => false,
'description' => __( 'Whether to bypass Trash and force deletion.', 'default' ),
'description' => __( 'Whether to bypass Trash and force deletion.', 'gutenberg' ),
),
),
),
Expand Down Expand Up @@ -469,7 +469,7 @@ public function get_item_schema() {
// Base properties for every Post.
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the post.', 'default' ),
'description' => __( 'Unique identifier for the post.', 'gutenberg' ),
'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true,
Expand Down Expand Up @@ -658,7 +658,7 @@ public function get_create_params() {
protected function get_parent_font_family_post( $font_family_id ) {
$error = new WP_Error(
'rest_post_invalid_parent',
__( 'Invalid post parent ID.', 'default' ),
__( 'Invalid post parent ID.', 'gutenberg' ),
array( 'status' => 404 )
);

Expand Down Expand Up @@ -777,7 +777,7 @@ public function handle_font_file_upload_error( $file, $message ) {
$status = 500;
$code = 'rest_font_upload_unknown_error';

if ( __( 'Sorry, you are not allowed to upload this file type.', 'default' ) === $message ) {
if ( __( 'Sorry, you are not allowed to upload this file type.', 'gutenberg' ) === $message ) {
$status = 400;
$code = 'rest_font_upload_invalid_file_type';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function get_item_schema() {
// Base properties for every Post.
'properties' => array(
'id' => array(
'description' => __( 'Unique identifier for the post.', 'default' ),
'description' => __( 'Unique identifier for the post.', 'gutenberg' ),
'type' => 'integer',
'context' => array( 'view', 'edit', 'embed' ),
'readonly' => true,
Expand Down Expand Up @@ -301,19 +301,19 @@ public function get_item_schema() {
'context' => array( 'view', 'edit', 'embed' ),
'properties' => array(
'name' => array(
'description' => 'Name of the font family preset, translatable.',
'description' => __( 'Name of the font family preset, translatable.', 'gutenberg' ),
'type' => 'string',
),
'slug' => array(
'description' => 'Kebab-case unique identifier for the font family preset.',
'description' => __( 'Kebab-case unique identifier for the font family preset.', 'gutenberg' ),
'type' => 'string',
),
'fontFamily' => array(
'description' => 'CSS font-family value.',
'description' => __( 'CSS font-family value.', 'gutenberg' ),
'type' => 'string',
),
'preview' => array(
'description' => 'URL to a preview image of the font family.',
'description' => __( 'URL to a preview image of the font family.', 'gutenberg' ),
'type' => 'string',
),
),
Expand Down
2 changes: 1 addition & 1 deletion lib/experimental/fonts/font-library/font-library.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function wp_unregister_font_collection( $collection_id ) {

$google_fonts = array(
'slug' => 'google-fonts',
'name' => 'Google Fonts',
'name' => __( 'Google Fonts', 'gutenberg' ),
'description' => __( 'Add from Google Fonts. Fonts are copied to and served from your site.', 'gutenberg' ),
'src' => 'https://s.w.org/images/fonts/17.6/collections/google-fonts-with-preview.json',
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function GoogleFontsConfirmDialog() {
<div className="font-library__google-fonts-confirm">
<Card>
<CardBody>
<Text as="h3">Connect to Google Fonts</Text>
<Text as="h3">{ __( 'Connect to Google Fonts' ) }</Text>
<Spacer margin={ 6 } />
<Text as="p">
{ __(
Expand Down

0 comments on commit c3bb64c

Please sign in to comment.