+
+ /**
+ * Fires when scripts and styles are enqueued for the editor.
+ *
+ * @since 3.9.0
+ *
+ * @param array $to_load An array containing boolean values whether TinyMCE
+ * and Quicktags are being loaded.
+ */
+ do_action( 'wp_enqueue_editor', array(
+ 'tinymce' => self::$has_tinymce,
+ 'quicktags' => self::$has_quicktags,
+ ) );
+ }
+
+ public static function wp_mce_translation() {
+
+ $mce_translation = array(
+ // Default TinyMCE strings
+ 'New document' => __( 'New document' ),
+ 'Formats' => _x( 'Formats', 'TinyMCE' ),
+
+ 'Headings' => _x( 'Headings', 'TinyMCE' ),
+ 'Heading 1' => __( 'Heading 1' ),
+ 'Heading 2' => __( 'Heading 2' ),
+ 'Heading 3' => __( 'Heading 3' ),
+ 'Heading 4' => __( 'Heading 4' ),
+ 'Heading 5' => __( 'Heading 5' ),
+ 'Heading 6' => __( 'Heading 6' ),
+
+ /* translators: block tags */
+ 'Blocks' => _x( 'Blocks', 'TinyMCE' ),
+ 'Paragraph' => __( 'Paragraph' ),
+ 'Blockquote' => __( 'Blockquote' ),
+ 'Div' => _x( 'Div', 'HTML tag' ),
+ 'Pre' => _x( 'Pre', 'HTML tag' ),
+ 'Address' => _x( 'Address', 'HTML tag' ),
+
+ 'Inline' => _x( 'Inline', 'HTML elements' ),
+ 'Underline' => __( 'Underline' ),
+ 'Strikethrough' => __( 'Strikethrough' ),
+ 'Subscript' => __( 'Subscript' ),
+ 'Superscript' => __( 'Superscript' ),
+ 'Clear formatting' => __( 'Clear formatting' ),
+ 'Bold' => __( 'Bold' ),
+ 'Italic' => __( 'Italic' ),
+ 'Code' => _x( 'Code', 'editor button' ),
+ 'Source code' => __( 'Source code' ),
+ 'Font Family' => __( 'Font Family' ),
+ 'Font Sizes' => __( 'Font Sizes' ),
+
+ 'Align center' => __( 'Align center' ),
+ 'Align right' => __( 'Align right' ),
+ 'Align left' => __( 'Align left' ),
+ 'Justify' => __( 'Justify' ),
+ 'Increase indent' => __( 'Increase indent' ),
+ 'Decrease indent' => __( 'Decrease indent' ),
+
+ 'Cut' => __( 'Cut' ),
+ 'Copy' => __( 'Copy' ),
+ 'Paste' => __( 'Paste' ),
+ 'Select all' => __( 'Select all' ),
+ 'Undo' => __( 'Undo' ),
+ 'Redo' => __( 'Redo' ),
+
+ 'Ok' => __( 'OK' ),
+ 'Cancel' => __( 'Cancel' ),
+ 'Close' => __( 'Close' ),
+ 'Visual aids' => __( 'Visual aids' ),
+
+ 'Bullet list' => __( 'Bulleted list' ),
+ 'Numbered list' => __( 'Numbered list' ),
+ 'Square' => _x( 'Square', 'list style' ),
+ 'Default' => _x( 'Default', 'list style' ),
+ 'Circle' => _x( 'Circle', 'list style' ),
+ 'Disc' => _x('Disc', 'list style' ),
+ 'Lower Greek' => _x( 'Lower Greek', 'list style' ),
+ 'Lower Alpha' => _x( 'Lower Alpha', 'list style' ),
+ 'Upper Alpha' => _x( 'Upper Alpha', 'list style' ),
+ 'Upper Roman' => _x( 'Upper Roman', 'list style' ),
+ 'Lower Roman' => _x( 'Lower Roman', 'list style' ),
+
+ // Anchor plugin
+ 'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
+ 'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
+ 'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
+
+ // Fullpage plugin
+ 'Document properties' => __( 'Document properties' ),
+ 'Robots' => __( 'Robots' ),
+ 'Title' => __( 'Title' ),
+ 'Keywords' => __( 'Keywords' ),
+ 'Encoding' => __( 'Encoding' ),
+ 'Description' => __( 'Description' ),
+ 'Author' => __( 'Author' ),
+
+ // Media, image plugins
+ 'Insert/edit image' => __( 'Insert/edit image' ),
+ 'General' => __( 'General' ),
+ 'Advanced' => __( 'Advanced' ),
+ 'Source' => __( 'Source' ),
+ 'Border' => __( 'Border' ),
+ 'Constrain proportions' => __( 'Constrain proportions' ),
+ 'Vertical space' => __( 'Vertical space' ),
+ 'Image description' => __( 'Image description' ),
+ 'Style' => __( 'Style' ),
+ 'Dimensions' => __( 'Dimensions' ),
+ 'Insert image' => __( 'Insert image' ),
+ 'Insert date/time' => __( 'Insert date/time' ),
+ 'Insert/edit video' => __( 'Insert/edit video' ),
+ 'Poster' => __( 'Poster' ),
+ 'Alternative source' => __( 'Alternative source' ),
+ 'Paste your embed code below:' => __( 'Paste your embed code below:' ),
+ 'Insert video' => __( 'Insert video' ),
+ 'Embed' => __( 'Embed' ),
+
+ // Each of these have a corresponding plugin
+ 'Special character' => __( 'Special character' ),
+ 'Right to left' => _x( 'Right to left', 'editor button' ),
+ 'Left to right' => _x( 'Left to right', 'editor button' ),
+ 'Emoticons' => __( 'Emoticons' ),
+ 'Nonbreaking space' => __( 'Nonbreaking space' ),
+ 'Page break' => __( 'Page break' ),
+ 'Paste as text' => __( 'Paste as text' ),
+ 'Preview' => __( 'Preview' ),
+ 'Print' => __( 'Print' ),
+ 'Save' => __( 'Save' ),
+ 'Fullscreen' => __( 'Fullscreen' ),
+ 'Horizontal line' => __( 'Horizontal line' ),
+ 'Horizontal space' => __( 'Horizontal space' ),
+ 'Restore last draft' => __( 'Restore last draft' ),
+ 'Insert/edit link' => __( 'Insert/edit link' ),
+ 'Remove link' => __( 'Remove link' ),
+
+ // Spelling, search/replace plugins
+ 'Could not find the specified string.' => __( 'Could not find the specified string.' ),
+ 'Replace' => _x( 'Replace', 'find/replace' ),
+ 'Next' => _x( 'Next', 'find/replace' ),
+ /* translators: previous */
+ 'Prev' => _x( 'Prev', 'find/replace' ),
+ 'Whole words' => _x( 'Whole words', 'find/replace' ),
+ 'Find and replace' => __( 'Find and replace' ),
+ 'Replace with' => _x('Replace with', 'find/replace' ),
+ 'Find' => _x( 'Find', 'find/replace' ),
+ 'Replace all' => _x( 'Replace all', 'find/replace' ),
+ 'Match case' => __( 'Match case' ),
+ 'Spellcheck' => __( 'Check Spelling' ),
+ 'Finish' => _x( 'Finish', 'spellcheck' ),
+ 'Ignore all' => _x( 'Ignore all', 'spellcheck' ),
+ 'Ignore' => _x( 'Ignore', 'spellcheck' ),
+
+ // TinyMCE tables
+ 'Insert table' => __( 'Insert table' ),
+ 'Delete table' => __( 'Delete table' ),
+ 'Table properties' => __( 'Table properties' ),
+ 'Row properties' => __( 'Table row properties' ),
+ 'Cell properties' => __( 'Table cell properties' ),
+
+ 'Row' => __( 'Row' ),
+ 'Rows' => __( 'Rows' ),
+ 'Column' => _x( 'Column', 'table column' ),
+ 'Cols' => _x( 'Cols', 'table columns' ),
+ 'Cell' => _x( 'Cell', 'table cell' ),
+ 'Header cell' => __( 'Header cell' ),
+ 'Header' => _x( 'Header', 'table header' ),
+ 'Body' => _x( 'Body', 'table body' ),
+ 'Footer' => _x( 'Footer', 'table footer' ),
+
+ 'Insert row before' => __( 'Insert row before' ),
+ 'Insert row after' => __( 'Insert row after' ),
+ 'Insert column before' => __( 'Insert column before' ),
+ 'Insert column after' => __( 'Insert column after' ),
+ 'Paste row before' => __( 'Paste table row before' ),
+ 'Paste row after' => __( 'Paste table row after' ),
+ 'Delete row' => __( 'Delete row' ),
+ 'Delete column' => __( 'Delete column' ),
+ 'Cut row' => __( 'Cut table row' ),
+ 'Copy row' => __( 'Copy table row' ),
+ 'Merge cells' => __( 'Merge table cells' ),
+ 'Split cell' => __( 'Split table cell' ),
+
+ 'Height' => __( 'Height' ),
+ 'Width' => __( 'Width' ),
+ 'Caption' => __( 'Caption' ),
+ 'Alignment' => __( 'Alignment' ),
+ 'Left' => __( 'Left' ),
+ 'Center' => __( 'Center' ),
+ 'Right' => __( 'Right' ),
+ 'None' => _x( 'None', 'table cell alignment attribute' ),
+
+ 'Row group' => __( 'Row group' ),
+ 'Column group' => __( 'Column group' ),
+ 'Row type' => __( 'Row type' ),
+ 'Cell type' => __( 'Cell type' ),
+ 'Cell padding' => __( 'Cell padding' ),
+ 'Cell spacing' => __( 'Cell spacing' ),
+ 'Scope' => _x( 'Scope', 'table cell scope attribute' ),
+
+ 'Insert template' => _x( 'Insert template', 'TinyMCE' ),
+ 'Templates' => _x( 'Templates', 'TinyMCE' ),
+
+ 'Background color' => __( 'Background color' ),
+ 'Text color' => __( 'Text color' ),
+ 'Show blocks' => _x( 'Show blocks', 'editor button' ),
+ 'Show invisible characters' => __( 'Show invisible characters' ),
+
+ /* translators: word count */
+ 'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ),
+ 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' => __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" . __( 'If you’re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),
+ 'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' => __( 'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' ),
+ 'You have unsaved changes are you sure you want to navigate away?' => __( 'The changes you made will be lost if you navigate away from this page.' ),
+ 'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' => __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser’s edit menu instead.' ),
+
+ // TinyMCE menus
+ 'Insert' => _x( 'Insert', 'TinyMCE menu' ),
+ 'File' => _x( 'File', 'TinyMCE menu' ),
+ 'Edit' => _x( 'Edit', 'TinyMCE menu' ),
+ 'Tools' => _x( 'Tools', 'TinyMCE menu' ),
+ 'View' => _x( 'View', 'TinyMCE menu' ),
+ 'Table' => _x( 'Table', 'TinyMCE menu' ),
+ 'Format' => _x( 'Format', 'TinyMCE menu' ),
+
+ // WordPress strings
+ 'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ),
+ 'Toolbar Toggle' => __( 'Toolbar Toggle' ),
+ 'Insert Read More tag' => __( 'Insert Read More tag' ),
+ 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor
+ 'Distraction Free Writing' => __( 'Distraction Free Writing' ),
+ );
+
+ /**
+ * Link plugin (not included):
+ * Insert link
+ * Target
+ * New window
+ * Text to display
+ * The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?
+ * The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?
+ * Url
+ */
+
+ $baseurl = self::$baseurl;
+ $mce_locale = self::$mce_locale;
+
+ /**
+ * Filter translated strings prepared for TinyMCE.
+ *
+ * @since 3.9.0
+ *
+ * @param array $mce_translation Key/value pairs of strings.
+ * @param string $mce_locale Locale.
+ */
+ $mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
+
+ foreach ( $mce_translation as $key => $value ) {
+ if ( false !== strpos( $value, '&' ) ) {
+ $mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
+ }
+ }
+
+ // Set direction
+ if ( is_rtl() ) {
+ $mce_translation['_dir'] = 'rtl';
+ }
+
+ return "tinymce.addI18n( '$mce_locale', " . json_encode( $mce_translation ) . ");\n" .
+ "tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n";