#58138 closed enhancement (fixed)
For echo the translated string, use _e() instead of __()
Reported by: | mujuonly | Owned by: | audrasjb |
---|---|---|---|
Milestone: | 6.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | I18N | Keywords: | has-patch |
Focuses: | coding-standards | Cc: |
Description
If you want to echo the translated string, then you will be using _e()
and when you just want to have the translated string, then you will be using __()
.
Used echo __( 'Search Media' )
in /wp-admin/includes/media.php
Change History (11)
This ticket was mentioned in PR #4332 on WordPress/wordpress-develop by @mujuonly.
21 months ago
#1
- Keywords has-patch added; needs-patch removed
#2
@
21 months ago
- Component changed from General to I18N
- Milestone changed from Awaiting Review to 6.3
- Version 6.2 deleted
Hello, thanks for the ticket & patch!
Good point.
Also, I think the translation string should include the :
character. In some locales, this character has to be translatable. For example we need a non-breaking space before :
in fr_FR
.
#3
@
21 months ago
Good catch
Also, I think the translation string should include the : character.
+1 on this part. Punctuation should always be included in the translation string.
#4
@
21 months ago
@vladytimy @audrasjb The current code is like echo __( 'Search Media' ) . ':';
, so it should be like _e( 'Search Media:' );
right.?
This ticket was mentioned in PR #4333 on WordPress/wordpress-develop by @mujuonly.
21 months ago
#6
Punctuation should always be included in the translation string
Trac ticket: https://core.trac.wordpress.org/ticket/58138
#8
@
21 months ago
PR LGTM
@mujuonly Also check if the same occurrence is not again in the file(s).
#9
@
21 months ago
- Owner changed from mujuonly to audrasjb
Hi there! thanks for ticket and PR!
The PR 4333 ready to go.
Assign to @audrasjb for final review and commit.
@audrasjb commented on PR #4333:
21 months ago
#11
Committed in https://core.trac.wordpress.org/changeset/55684
To echo the translated string, then you will be using _e()
Trac ticket: https://core.trac.wordpress.org/ticket/58138