Skip to content

Commit

Permalink
Merge pull request #44 from wearerequired/fix/i18n-label
Browse files Browse the repository at this point in the history
Make 'Default Help Document' label translatable
  • Loading branch information
markjaquith authored Aug 3, 2020
2 parents b65fb9e + 14eedd6 commit de9f2e1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions classes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public function enqueue_block_editor_assets() {
if ( self::is_block_editor() && self::POST_TYPE === get_post_type() ) {
$asset = $this->include_file( '/dist/block-editor.asset.php' );
wp_enqueue_script( 'cws-wp-block-editor', $this->get_url() . 'dist/block-editor.js', $asset['dependencies'], $asset['version'], true );
wp_set_script_translations( 'cws-wp-block-editor', 'wp-help' );
wp_dequeue_style( 'twentytwenty-block-editor-styles' );
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { compose } from '@wordpress/compose';
import { withSelect, withDispatch } from '@wordpress/data';
import { PluginPostStatusInfo } from '@wordpress/edit-post';
import { registerPlugin } from '@wordpress/plugins';
import { __ } from '@wordpress/i18n';

const DEFAULT_DOCUMENT = 'is_default_doc';

Expand All @@ -21,7 +22,7 @@ function WpHelp({ isDefault, setDefaultDocument }) {
return (
<PluginPostStatusInfo>
<CheckboxControl
label="Default Help Document"
label={__('Default Help Document', 'wp-help')}
checked={isDefault}
onChange={setDefaultDocument}
/>
Expand Down

0 comments on commit de9f2e1

Please sign in to comment.