Make WordPress Core

Opened 7 days ago

Last modified 5 days ago

#64982 new defect (bug)

library should be changed to media library in core or needs gettext

Reported by: timse201's profile timse201 Owned by:
Milestone: 7.0 Priority: normal
Severity: normal Version: trunk
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

https://translate.wordpress.org/projects/wp/dev/de/default/?filters%5Bstatus%5D=either&filters%5Boriginal_id%5D=16513323&filters%5Btranslation_id%5D=115284524

library is used for media library and for Gutenberg libraries. We have a single short word in German for media library that differs.

Change History (5)

#1 @audrasjb
6 days ago

  • Milestone changed from Awaiting Review to 7.0

To be clear, what is needed here is a context for translators, using the _x() function.
See https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#disambiguation-by-context

#2 @audrasjb
6 days ago

  • Keywords needs-patch added

This ticket was mentioned in PR #11404 on WordPress/wordpress-develop by @sanket.parmar.


5 days ago
#3

  • Keywords has-patch added; needs-patch removed

## Summary

The string "Library" was used in two unrelated contexts without translator context:

  • As the Media Library submenu item in the admin menu
  • As the installed fonts tab label in the Font Library page

In languages like German, these concepts use different words (Mediathek vs. Bibliothek), making a single translation impossible without disambiguation.

## Changes

  • wp-admin/menu.php: Changed __( 'Library' ) to _x( 'Library', 'Media Library menu item' ) for the Media submenu entry.
  • wp-includes/build/routes/font-list/content.js and content.min.js: Changed __("Library") to _x("Library", "Font library") for the installed-fonts tab title, aligning it with the already-correct _x() usage in the Font Library modal.

## Testing

No functional change in English. Translators can now provide distinct translations for each context via _x().

---

Trac ticket: https://core.trac.wordpress.org/ticket/64982

This ticket was mentioned in Slack in #core by audrasjb. View the logs.


5 days ago

#5 @audrasjb
5 days ago

This fixes the issue, but I'd rather add a context for both strings.

Note: See TracTickets for help on using tickets.