Opened 6 weeks ago
Closed 2 weeks ago
#64982 closed defect (bug) (fixed)
library should be changed to media library in core or needs gettext
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | trunk |
| Component: | I18N | Keywords: | has-patch commit dev-reviewed |
| Focuses: | Cc: |
Description
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 (14)
This ticket was mentioned in PR #11404 on WordPress/wordpress-develop by @sanket.parmar.
6 weeks 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.jsandcontent.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.
6 weeks ago
#5
follow-up:
↓ 10
@
6 weeks ago
This fixes the issue, but I'd rather add a context for both strings.
This ticket was mentioned in PR #11515 on WordPress/wordpress-develop by @trickster301.
5 weeks ago
#6
Fix : https://core.trac.wordpress.org/ticket/64982
Both strings now have translator context
This ticket was mentioned in Slack in #core-test by gaisma22. View the logs.
4 weeks ago
This ticket was mentioned in Slack in #core-test by sanjay_jadav. View the logs.
4 weeks ago
#9
@
4 weeks ago
Patch Testing Report
Patch Tested: https://github.com/WordPress/wordpress-develop/pull/11515
Environment
- WordPress: 7.1-alpha-20260409.094020
- PHP: 8.3.30
- Server: PHP.wasm
- Database: WP_SQLite_Driver (Server: 8.0.38 / Client: 3.51.0)
- Browser: Chrome 147.0.0.0
- OS: Windows
- Theme: Twenty Twenty-Five 1.4
- MU Plugins: None
- Plugins: Test Reports 1.2.1
Steps Taken
- Loaded PR #11515 using the WordPress PR option in Playground.
- Opened File browser and navigated to /wordpress/wp-admin/menu.php.
- Searched for _x( 'Library', 'media library' ) on line 75. Confirmed the patch applied correctly.
✅ Patch is solving the problem
Expected Result
The Media Library submenu item now uses _x() with translator
context instead of ().
No visual change expected in English.
Translators can now provide accurate translations for their
language once language files are updated.
Additional Notes
- Patch confirmed applied via file browser in Playground.
- No visual change expected. Verification is code-level only.
Screenshots/Screencast with results
#10
in reply to:
↑ 5
@
3 weeks ago
Replying to audrasjb:
This fixes the issue, but I'd rather add a context for both strings.
It appears that the other instance would need to be changed in Gutenberg, so I think PR 11404 is good to go for core.
Nitpicking: I would suggest media library menu item as the context (no capitalization), that would be consistent with a few existing admin menu strings:
_x( 'Editor', 'site editor menu item' )_x( 'Design', 'design menu item' )_x( 'Patterns', 'patterns menu item' )
#11
@
3 weeks ago
- Owner set to SergeyBiryukov
- Resolution set to fixed
- Status changed from new to closed
In 62256:
#12
@
3 weeks ago
- Keywords commit dev-feedback added
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening for 7.0 consideration.
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