[wp-trac] [WordPress Trac] #60509: Font Collection: Font name and description are not translatable

WordPress Trac noreply at wordpress.org
Mon Feb 12 19:29:34 UTC 2024


#60509: Font Collection: Font name and description are not translatable
--------------------------+---------------------
 Reporter:  wildworks     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.5
Component:  Editor        |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+---------------------

Comment (by mmaattiiaass):

 > If I'm understanding properly:
 > - Performance: To lazy load the files: only load the fonts on usage, not
 registration.
 > - Update: To be able to update the collections outside the WP update
 lifecycle.
 > - It's also a huge file (2.3m)

 @youknowriad, yes, those were the main considerations.



 ----


 > Unless we move this file to version control

 @swissspidy Would that be possible?


 > Unless we move this file to version control, I think updating
 wp_register_font_collection is the only way.

 I don't think that updating the function signature as suggested here
 (https://core.trac.wordpress.org/ticket/60509#comment:5) would solve the
 problem because, in that case, font family names can't be translated, so
 the problem persists.

 ----


 > Now that I think about it more, I think we should update
 wp_register_font_collection to accept an array of options as a second
 argument regardless of how we'll do i18n.

 @youknowriad This is currently working like that. See these 2 examples:


 {{{
     $my_collection = array(
         'name'          => 'PHP Custom Collection',
         'description'   => __( 'Custom fonts collection' ),
         'font_families' => $font_families,
         'categories'    => $categories
     );

     wp_register_font_collection( 'my-collection', $my_collection );
 }}}
 and



 {{{
 wp_resgiter_font_collection( "my-collection", "/path/to/json.json"  );
 }}}

 both are valid.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60509#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list