TinyMCE strings: Merge, remove, reorganize, restore, clarify.

see #27453, #24067.


git-svn-id: https://develop.svn.wordpress.org/trunk@27618 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-19 07:17:07 +00:00
parent bc2512f8cc
commit 506d92e2fe
1 changed files with 179 additions and 148 deletions

View File

@ -517,77 +517,80 @@ final class _WP_Editors {
$mce_translation = array( $mce_translation = array(
// Default TinyMCE strings // Default TinyMCE strings
'Cut' => __('Cut'),
'Header 2' => __('Header 2'),
'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 the Ctrl+X/C/V keyboard shortcuts instead.'),
'Div' => __('Div'),
'Paste' => __('Paste'),
'Close' => __('Close'),
'Pre' => __('Pre'),
'Align right' => __('Align right'),
'New document' => __( 'New document' ), 'New document' => __( 'New document' ),
'Formats' => _x( 'Formats', 'TinyMCE' ),
'Headers' => _x( 'Headers', 'TinyMCE' ),
'Header 1' => __( 'Heading 1' ),
'Header 2' => __( 'Heading 2' ),
'Header 3' => __( 'Heading 3' ),
'Header 4' => __( 'Heading 4' ),
'Header 5' => __( 'Heading 5' ),
'Header 6' => __( 'Heading 6' ),
/* translators: block tags */
'Blocks' => _x( 'Blocks', 'TinyMCE' ),
'Paragraph' => __( 'Paragraph' ),
'Blockquote' => __( 'Blockquote' ), 'Blockquote' => __( 'Blockquote' ),
'Numbered list' => __('Numbered list'), 'Div' => _x( 'Div', 'HTML tag' ),
'Increase indent' => __('Increase indent'), 'Pre' => _x( 'Pre', 'HTML tag' ),
'Formats' => __('Formats'),
'Headers' => __('Headers'), 'Inline' => _x( 'Inline', 'HTML elements' ),
'Select all' => __('Select all'), 'Underline' => __( 'Underline' ),
'Header 3' => __('Header 3'),
'Blocks' => __('Blocks'),
'Undo' => __('Undo'),
'Strikethrough' => __( 'Strikethrough' ), 'Strikethrough' => __( 'Strikethrough' ),
'Bullet list' => __('Bullet list'), 'Subscript' => __( 'Subscript' ),
'Header 1' => __('Header 1'),
'Superscript' => __( 'Superscript' ), 'Superscript' => __( 'Superscript' ),
'Clear formatting' => __( 'Clear formatting' ), 'Clear formatting' => __( 'Clear formatting' ),
'Subscript' => __('Subscript'),
'Header 6' => __('Header 6'),
'Redo' => __('Redo'),
'Paragraph' => __('Paragraph'),
'Ok' => __('Ok'),
'Bold' => __('Bold'), 'Bold' => __('Bold'),
'Code' => __('Code'),
'Italic' => __('Italic'), 'Italic' => __('Italic'),
'Align center' => __('Align center'), 'Code' => _x( 'Code', 'editor button' ),
'Header 5' => __('Header 5'),
'Decrease indent' => __('Decrease indent'),
'Header 4' => __('Header 4'),
'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.'),
'Underline' => __('Underline'),
'Cancel' => __('Cancel'),
'Justify' => __('Justify'),
'Inline' => __('Inline'),
'Copy' => __('Copy'),
'Align left' => __('Align left'),
'Visual aids' => __('Visual aids'),
'Lower Greek' => __('Lower Greek'),
'Square' => __('Square'),
'Default' => __('Default'),
'Lower Alpha' => __('Lower Alpha'),
'Circle' => __('Circle'),
'Disc' => __('Disc'),
'Upper Alpha' => __('Upper Alpha'),
'Upper Roman' => __('Upper Roman'),
'Lower Roman' => __('Lower Roman'),
'Name' => __('Name'),
'Anchor' => __('Anchor'),
'You have unsaved changes are you sure you want to navigate away?' => __('You have unsaved changes are you sure you want to navigate away?'),
'Restore last draft' => __('Restore last draft'),
'Special character' => __('Special character'),
'Source code' => __( 'Source code' ), 'Source code' => __( 'Source code' ),
'Right to left' => __('Right to left'),
'Left to right' => __('Left to right'), 'Align center' => __('Align center'),
'Emoticons' => __('Emoticons'), 'Align right' => __('Align right'),
'Robots' => __('Robots'), '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' ), 'Document properties' => __( 'Document properties' ),
'Robots' => __( 'Robots' ),
'Title' => __( 'Title' ), 'Title' => __( 'Title' ),
'Keywords' => __( 'Keywords' ), 'Keywords' => __( 'Keywords' ),
'Encoding' => __( 'Encoding' ), 'Encoding' => __( 'Encoding' ),
'Description' => __( 'Description' ), 'Description' => __( 'Description' ),
'Author' => __( 'Author' ), 'Author' => __( 'Author' ),
'Fullscreen' => __('Fullscreen'),
'Horizontal line' => __('Horizontal line'), // Media, image plugins
'Horizontal space' => __('Horizontal space'),
'Insert/edit image' => __('Insert/edit image'), 'Insert/edit image' => __('Insert/edit image'),
'General' => __('General'), 'General' => __('General'),
'Advanced' => __('Advanced'), 'Advanced' => __('Advanced'),
@ -600,96 +603,115 @@ final class _WP_Editors {
'Dimensions' => __('Dimensions'), 'Dimensions' => __('Dimensions'),
'Insert image' => __('Insert image'), 'Insert image' => __('Insert image'),
'Insert date/time' => __('Insert date/time'), 'Insert date/time' => __('Insert date/time'),
'Remove link' => __('Remove link'),
'Url' => __('Url'),
'Text to display' => __('Text to display'),
'Anchors' => __('Anchors'),
'Insert link' => __('Insert link'),
'New window' => __('New window'),
'None' => __('None'),
'Target' => __('Target'),
'Insert/edit link' => __('Insert/edit link'),
'Insert/edit video' => __('Insert/edit video'), 'Insert/edit video' => __('Insert/edit video'),
'Poster' => __('Poster'), 'Poster' => __('Poster'),
'Alternative source' => __('Alternative source'), 'Alternative source' => __('Alternative source'),
'Paste your embed code below:' => __('Paste your embed code below:'), 'Paste your embed code below:' => __('Paste your embed code below:'),
'Insert video' => __('Insert video'), 'Insert video' => __('Insert video'),
'Embed' => __('Embed'), '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' ), 'Nonbreaking space' => __( 'Nonbreaking space' ),
'Page break' => __( 'Page break' ), 'Page break' => __( 'Page break' ),
'Paste as text' => __( 'Paste as text' ), 'Paste as text' => __( 'Paste as text' ),
'Preview' => __( 'Preview' ), 'Preview' => __( 'Preview' ),
'Print' => __( 'Print' ), 'Print' => __( 'Print' ),
'Save' => __( 'Save' ), 'Save' => __( 'Save' ),
'Fullscreen' => __( 'Fullscreen' ),
'Horizontal line' => __( 'Horizontal line' ),
'Horizontal space' => __( 'Horizontal space' ),
'Restore last draft' => __( 'Restore last draft' ),
// Spelling, search/replace plugins
'Could not find the specified string.' => __( 'Could not find the specified string.' ), 'Could not find the specified string.' => __( 'Could not find the specified string.' ),
'Replace' => __('Replace'), 'Replace' => _x( 'Replace', 'find/replace' ),
'Next' => __('Next'), 'Next' => _x( 'Next', 'find/replace' ),
'Whole words' => __('Whole words'), /* translators: previous */
'Prev' => _x( 'Prev', 'find/replace' ),
'Whole words' => _x( 'Whole words', 'find/replace' ),
'Find and replace' => __('Find and replace' ), 'Find and replace' => __('Find and replace' ),
'Replace with' => __('Replace with'), 'Replace with' => _x('Replace with', 'find/replace' ),
'Find' => __('Find'), 'Find' => _x( 'Find', 'find/replace' ),
'Replace all' => __('Replace all'), 'Replace all' => _x( 'Replace all', 'find/replace' ),
'Match case' => __('Match case'), 'Match case' => __('Match case'),
'Prev' => __('Prev'), 'Spellcheck' => __( 'Check Spelling' ),
'Spellcheck' => __('Spellcheck'), 'Finish' => _x( 'Finish', 'spellcheck' ),
'Finish' => __('Finish'), 'Ignore all' => _x( 'Ignore all', 'spellcheck' ),
'Ignore all' => __('Ignore all'), 'Ignore' => _x( 'Ignore', 'spellcheck' ),
'Ignore' => __('Ignore'),
'Insert row before' => __('Insert row before'), // TinyMCE tables
'Rows' => __('Rows'), 'Insert table' => __( 'Insert table' ),
'Height' => __('Height'), 'Delete table' => __( 'Delete table' ),
'Paste row after' => __('Paste row after'), 'Table properties' => __( 'Table properties' ),
'Alignment' => __('Alignment'), 'Row properties' => __( 'Table row properties' ),
'Column group' => __('Column group'), 'Cell properties' => __( 'Table cell properties' ),
'Row' => __( 'Row' ), '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 before' => __( 'Insert column before' ),
'Split cell' => __('Split cell'), '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 merged table cells' ),
'Height' => __( 'Height' ),
'Width' => __('Width'),
'Caption' => __( 'Caption' ),
'Alignment' => __( 'Alignment' ),
'Left' => __( 'Left' ),
'Center' => __( 'Center' ),
'Right' => __( 'Right' ),
'Row group' => __( 'Row group' ),
'Column group' => __( 'Column group' ),
'Row type' => __( 'Row type' ),
'Cell type' => __( 'Cell type' ),
'Cell padding' => __( 'Cell padding' ), 'Cell padding' => __( 'Cell padding' ),
'Cell spacing' => __( 'Cell spacing' ), 'Cell spacing' => __( 'Cell spacing' ),
'Row type' => __('Row type'), 'Scope' => _x( 'Scope', 'table cell scope attribute' ),
'Insert table' => __('Insert table'),
'Body' => __('Body'), 'Insert template' => _x( 'Insert template', 'TinyMCE' ),
'Caption' => __('Caption'), 'Templates' => _x( 'Templates', 'TinyMCE' ),
'Footer' => __('Footer'),
'Delete row' => __('Delete row'),
'Paste row before' => __('Paste row before'),
'Scope' => __('Scope'),
'Delete table' => __('Delete table'),
'Header cell' => __('Header cell'),
'Column' => __('Column'),
'Cell' => __('Cell'),
'Header' => __('Header'),
'Cell type' => __('Cell type'),
'Copy row' => __('Copy row'),
'Row properties' => __('Row properties'),
'Table properties' => __('Table properties'),
'Row group' => __('Row group'),
'Right' => __('Right'),
'Insert column after' => __('Insert column after'),
'Cols' => __('Cols'),
'Insert row after' => __('Insert row after'),
'Width' => __('Width'),
'Cell properties' => __('Cell properties'),
'Left' => __('Left'),
'Cut row' => __('Cut row'),
'Delete column' => __('Delete column'),
'Center' => __('Center'),
'Merge cells' => __('Merge cells'),
'Insert template' => __('Insert template'),
'Templates' => __('Templates'),
'Background color' => __( 'Background color' ), 'Background color' => __( 'Background color' ),
'Text color' => __( 'Text color' ), 'Text color' => __( 'Text color' ),
'Show blocks' => __('Show blocks'), 'Show blocks' => _x( 'Show blocks', 'editor button' ),
'Show invisible characters' => __( 'Show invisible characters' ), 'Show invisible characters' => __( 'Show invisible characters' ),
'Words: {0}' => __('Words: {0}'),
'Insert' => __('Insert'), /* translators: word count */
'File' => __('File'), 'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ),
'Edit' => __('Edit'), '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.'),
'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'), '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'),
'Tools' => __('Tools'), '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.' ),
'View' => __('View'), '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 the Ctrl+X/C/V keyboard shortcuts instead.'),
'Table' => __('Table'),
'Format' => __('Format'), // 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 // WordPress strings
'Help' => __('Help'), 'Help' => __('Help'),
@ -701,12 +723,21 @@ final class _WP_Editors {
$baseurl = self::$baseurl; $baseurl = self::$baseurl;
$mce_locale = self::$mce_locale; $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 ); $mce_translation = apply_filters( 'wp_mce_translation', $mce_translation, $mce_locale );
foreach ( $mce_translation as $key => $value ) { foreach ( $mce_translation as $key => $value ) {
if ( strpos( $value, '&' ) !== false ) if ( false !== strpos( $value, '&' ) ) {
$mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' ); $mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
} }
}
return "tinymce.addI18n( '$mce_locale', " . json_encode( $mce_translation ) . ");\n" . return "tinymce.addI18n( '$mce_locale', " . json_encode( $mce_translation ) . ");\n" .
"tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n"; "tinymce.ScriptLoader.markDone( '$baseurl/langs/$mce_locale.js' );\n";