Skip to content

Commit

Permalink
ESLint: Improve lint regex for preventing "toggle" word usage in tran…
Browse files Browse the repository at this point in the history
…slation ready functions (#68958)

* fix: Improve lint regex for toggle word detection
* fix: Change strings to use alternate word for toggle

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: afercia <[email protected]>
  • Loading branch information
5 people authored Feb 13, 2025
1 parent e9bb574 commit 9ea69df
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const restrictedSyntax = [
},
{
selector:
'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] > Literal[value=/^toggle\\b/i]',
'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] > Literal[value=/toggle\\b/i]',
message: "Avoid using the verb 'Toggle' in translatable strings",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ function ToolSelector( props, ref ) {
</NavigableMenu>
<div className="block-editor-tool-selector__help">
{ __(
'Tools provide different sets of interactions for blocks. Toggle between simplified content tools (Write) and advanced visual editing tools (Design).'
'Tools provide different sets of interactions for blocks. Choose between simplified content tools (Write) and advanced visual editing tools (Design).'
) }
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/hooks/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ function LayoutPanelPure( {
'Nested blocks use content width with options for full and wide widths.'
)
: __(
'Nested blocks will fill the width of this container. Toggle to constrain.'
'Nested blocks will fill the width of this container.'
)
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default function BottomSheetSwitchCell( props ) {
accessibilityRole="none"
accessibilityHint={
/* translators: accessibility text (hint for switches) */
__( 'Double tap to toggle setting' )
__( 'Double tap to change setting' )
}
onPress={ onPress }
editable={ false }
Expand Down

0 comments on commit 9ea69df

Please sign in to comment.