Skip to content

Commit

Permalink
Discussions panel: Distinguish between verb and adjective form of ope…
Browse files Browse the repository at this point in the history
…n for internationalization (WordPress#63791)

Co-authored-by: talldan <talldanwp@git.wordpress.org>
Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent d10c203 commit a0ed76b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/editor/src/components/post-comments/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import {
RadioControl,
__experimentalText as Text,
Expand All @@ -18,7 +18,7 @@ const COMMENT_OPTIONS = [
{
label: (
<>
{ __( 'Open' ) }
{ _x( 'Open', 'Adjective: e.g. "Comments are open"' ) }
<Text variant="muted" size={ 12 }>
{ __( 'Visitors can add new comments and replies.' ) }
</Text>
Expand Down
8 changes: 5 additions & 3 deletions packages/editor/src/components/post-discussion/panel.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import {
Dropdown,
Button,
Expand Down Expand Up @@ -62,9 +62,11 @@ function PostDiscussionToggle( { isOpen, onClick } ) {
let label;
if ( commentStatus === 'open' ) {
if ( pingStatus === 'open' ) {
label = __( 'Open' );
label = _x( 'Open', 'Adjective: e.g. "Comments are open"' );
} else {
label = trackbacksSupported ? __( 'Comments only' ) : __( 'Open' );
label = trackbacksSupported
? __( 'Comments only' )
: _x( 'Open', 'Adjective: e.g. "Comments are open"' );
}
} else if ( pingStatus === 'open' ) {
label = commentsSupported ? __( 'Pings only' ) : __( 'Pings enabled' );
Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/components/site-discussion/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { __, _x } from '@wordpress/i18n';
import { useSelect, useDispatch } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
import {
Expand All @@ -25,7 +25,7 @@ const COMMENT_OPTIONS = [
{
label: (
<>
{ __( 'Open' ) }
{ _x( 'Open', 'Adjective: e.g. "Comments are open"' ) }
<Text variant="muted" size={ 12 }>
{ __( 'Visitors can add new comments and replies.' ) }
</Text>
Expand Down

0 comments on commit a0ed76b

Please sign in to comment.