From c25dd9912ac499225dca72802731caac4e45d593 Mon Sep 17 00:00:00 2001 From: ryan Date: Sat, 9 Feb 2008 06:43:15 +0000 Subject: [PATCH] gettext for tinymce strings. Props azaozz. see #5769 git-svn-id: http://svn.automattic.com/wordpress/trunk@6765 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/js/tinymce/langs/en.js | 154 ------- wp-includes/js/tinymce/langs/wp-langs.php | 400 ++++++++++++++++++ .../js/tinymce/plugins/media/langs/en_dlg.js | 103 ----- .../js/tinymce/plugins/paste/langs/en_dlg.js | 5 - .../js/tinymce/plugins/wordpress/langs/en.js | 8 - .../js/tinymce/themes/advanced/langs/en.js | 62 --- .../tinymce/themes/advanced/langs/en_dlg.js | 51 --- wp-includes/js/tinymce/tiny_mce_config.php | 11 +- wp-includes/js/tinymce/tiny_mce_gzip.php | 142 ++----- wp-includes/js/tinymce/tiny_mce_popup.js | 2 +- wp-includes/script-loader.php | 2 +- 11 files changed, 447 insertions(+), 493 deletions(-) create mode 100644 wp-includes/js/tinymce/langs/wp-langs.php diff --git a/wp-includes/js/tinymce/langs/en.js b/wp-includes/js/tinymce/langs/en.js index 3be7a2c3d1..e69de29bb2 100644 --- a/wp-includes/js/tinymce/langs/en.js +++ b/wp-includes/js/tinymce/langs/en.js @@ -1,154 +0,0 @@ -tinyMCE.addI18n({en:{ -common:{ -edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?", -apply:"Apply", -insert:"Insert", -update:"Update", -cancel:"Cancel", -close:"Close", -browse:"Browse", -class_name:"Class", -not_set:"-- Not set --", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?", -clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.", -popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.", -invalid_data:"Error: Invalid values entered, these are marked in red.", -more_colors:"More colors" -}, -contextmenu:{ -align:"Alignment", -left:"Left", -center:"Center", -right:"Right", -full:"Full" -}, -insertdatetime:{ -date_fmt:"%Y-%m-%d", -time_fmt:"%H:%M:%S", -insertdate_desc:"Insert date", -inserttime_desc:"Insert time", -months_long:"January,February,March,April,May,June,July,August,September,October,November,December", -months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec", -day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday", -day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun" -}, -print:{ -print_desc:"Print" -}, -preview:{ -preview_desc:"Preview" -}, -directionality:{ -ltr_desc:"Direction left to right", -rtl_desc:"Direction right to left" -}, -layer:{ -insertlayer_desc:"Insert new layer", -forward_desc:"Move forward", -backward_desc:"Move backward", -absolute_desc:"Toggle absolute positioning", -content:"New layer..." -}, -save:{ -save_desc:"Save", -cancel_desc:"Cancel all changes" -}, -nonbreaking:{ -nonbreaking_desc:"Insert non-breaking space character" -}, -iespell:{ -iespell_desc:"Run spell checking", -download:"ieSpell not detected. Do you want to install it now?" -}, -advhr:{ -advhr_desc:"Horizontale rule" -}, -emotions:{ -emotions_desc:"Emotions" -}, -searchreplace:{ -search_desc:"Find", -replace_desc:"Find/Replace" -}, -advimage:{ -image_desc:"Insert/edit image" -}, -advlink:{ -link_desc:"Insert/edit link" -}, -xhtmlxtras:{ -cite_desc:"Citation", -abbr_desc:"Abbreviation", -acronym_desc:"Acronym", -del_desc:"Deletion", -ins_desc:"Insertion", -attribs_desc:"Insert/Edit Attributes" -}, -style:{ -desc:"Edit CSS Style" -}, -paste:{ -paste_text_desc:"Paste as Plain Text", -paste_word_desc:"Paste from Word", -selectall_desc:"Select All" -}, -paste_dlg:{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}, -table:{ -desc:"Inserts a new table", -row_before_desc:"Insert row before", -row_after_desc:"Insert row after", -delete_row_desc:"Delete row", -col_before_desc:"Insert column before", -col_after_desc:"Insert column after", -delete_col_desc:"Remove column", -split_cells_desc:"Split merged table cells", -merge_cells_desc:"Merge table cells", -row_desc:"Table row properties", -cell_desc:"Table cell properties", -props_desc:"Table properties", -paste_row_before_desc:"Paste table row before", -paste_row_after_desc:"Paste table row after", -cut_row_desc:"Cut table row", -copy_row_desc:"Copy table row", -del:"Delete table", -row:"Row", -col:"Column", -cell:"Cell" -}, -autosave:{ -unload_msg:"The changes you made will be lost if you navigate away from this page." -}, -fullscreen:{ -desc:"Toggle fullscreen mode" -}, -media:{ -desc:"Insert / edit embedded media", -edit:"Edit embedded media" -}, -fullpage:{ -desc:"Document properties" -}, -template:{ -desc:"Insert predefined template content" -}, -visualchars:{ -desc:"Visual control characters on/off." -}, -spellchecker:{ -desc:"Toggle spellchecker", -menu:"Spellchecker settings", -ignore_word:"Ignore word", -ignore_words:"Ignore all", -langs:"Languages", -wait:"Please wait...", -sug:"Suggestions", -no_sug:"No suggestions", -no_mpell:"No misspellings found." -}, -pagebreak:{ -desc:"Insert page break." -}}}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php new file mode 100644 index 0000000000..549fd80587 --- /dev/null +++ b/wp-includes/js/tinymce/langs/wp-langs.php @@ -0,0 +1,400 @@ + \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/media/langs/en_dlg.js b/wp-includes/js/tinymce/plugins/media/langs/en_dlg.js index cb72e82a59..e69de29bb2 100644 --- a/wp-includes/js/tinymce/plugins/media/langs/en_dlg.js +++ b/wp-includes/js/tinymce/plugins/media/langs/en_dlg.js @@ -1,103 +0,0 @@ -tinyMCE.addI18n('en.media_dlg',{ -title:"Insert / edit embedded media", -general:"General", -advanced:"Advanced", -file:"File/URL", -list:"List", -size:"Dimensions", -preview:"Preview", -constrain_proportions:"Constrain proportions", -type:"Type", -id:"Id", -name:"Name", -class_name:"Class", -vspace:"V-Space", -hspace:"H-Space", -play:"Auto play", -loop:"Loop", -menu:"Show menu", -quality:"Quality", -scale:"Scale", -align:"Align", -salign:"SAlign", -wmode:"WMode", -bgcolor:"Background", -base:"Base", -flashvars:"Flashvars", -liveconnect:"SWLiveConnect", -autohref:"AutoHREF", -cache:"Cache", -hidden:"Hidden", -controller:"Controller", -kioskmode:"Kiosk mode", -playeveryframe:"Play every frame", -targetcache:"Target cache", -correction:"No correction", -enablejavascript:"Enable JavaScript", -starttime:"Start time", -endtime:"End time", -href:"Href", -qtsrcchokespeed:"Choke speed", -target:"Target", -volume:"Volume", -autostart:"Auto start", -enabled:"Enabled", -fullscreen:"Fullscreen", -invokeurls:"Invoke URLs", -mute:"Mute", -stretchtofit:"Stretch to fit", -windowlessvideo:"Windowless video", -balance:"Balance", -baseurl:"Base URL", -captioningid:"Captioning id", -currentmarker:"Current marker", -currentposition:"Current position", -defaultframe:"Default frame", -playcount:"Play count", -rate:"Rate", -uimode:"UI Mode", -flash_options:"Flash options", -qt_options:"Quicktime options", -wmp_options:"Windows media player options", -rmp_options:"Real media player options", -shockwave_options:"Shockwave options", -autogotourl:"Auto goto URL", -center:"Center", -imagestatus:"Image status", -maintainaspect:"Maintain aspect", -nojava:"No java", -prefetch:"Prefetch", -shuffle:"Shuffle", -console:"Console", -numloop:"Num loops", -controls:"Controls", -scriptcallbacks:"Script callbacks", -swstretchstyle:"Stretch style", -swstretchhalign:"Stretch H-Align", -swstretchvalign:"Stretch V-Align", -sound:"Sound", -progress:"Progress", -qtsrc:"QT Src", -qt_stream_warn:"Streamed rtsp resources should be added to the QT Src field under the advanced tab.\nYou should also add a non streamed version to the Src field..", -align_top:"Top", -align_right:"Right", -align_bottom:"Bottom", -align_left:"Left", -align_center:"Center", -align_top_left:"Top left", -align_top_right:"Top right", -align_bottom_left:"Bottom left", -align_bottom_right:"Bottom right", -flv_options:"Flash video options", -flv_scalemode:"Scale mode", -flv_buffer:"Buffer", -flv_startimage:"Start image", -flv_starttime:"Start time", -flv_defaultvolume:"Default volumne", -flv_hiddengui:"Hidden GUI", -flv_autostart:"Auto start", -flv_loop:"Loop", -flv_showscalemodes:"Show scale modes", -flv_smoothvideo:"Smooth video", -flv_jscallback:"JS Callback" -}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/paste/langs/en_dlg.js b/wp-includes/js/tinymce/plugins/paste/langs/en_dlg.js index 823eb16a75..e69de29bb2 100644 --- a/wp-includes/js/tinymce/plugins/paste/langs/en_dlg.js +++ b/wp-includes/js/tinymce/plugins/paste/langs/en_dlg.js @@ -1,5 +0,0 @@ -tinyMCE.addI18n('en.paste_dlg',{ -text_title:"Use CTRL+V on your keyboard to paste the text into the window.", -text_linebreaks:"Keep linebreaks", -word_title:"Use CTRL+V on your keyboard to paste the text into the window." -}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js index b7acfb5732..e69de29bb2 100644 --- a/wp-includes/js/tinymce/plugins/wordpress/langs/en.js +++ b/wp-includes/js/tinymce/plugins/wordpress/langs/en.js @@ -1,8 +0,0 @@ -tinyMCE.addI18n('en.wordpress',{ -wp_adv_desc : 'Show/Hide Advanced Toolbar', -wp_more_desc : 'Split post with More tag', -wp_page_desc : 'Split post with Page tag', -wp_help_desc : 'Help', -wp_more_alt : 'More...', -wp_page_alt : 'Next page...' -}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/langs/en.js b/wp-includes/js/tinymce/themes/advanced/langs/en.js index 52989e3936..e69de29bb2 100644 --- a/wp-includes/js/tinymce/themes/advanced/langs/en.js +++ b/wp-includes/js/tinymce/themes/advanced/langs/en.js @@ -1,62 +0,0 @@ -tinyMCE.addI18n('en.advanced',{ -style_select:"Styles", -font_size:"Font size", -fontdefault:"Font family", -block:"Format", -paragraph:"Paragraph", -div:"Div", -address:"Address", -pre:"Preformatted", -h1:"Heading 1", -h2:"Heading 2", -h3:"Heading 3", -h4:"Heading 4", -h5:"Heading 5", -h6:"Heading 6", -blockquote:"Blockquote", -code:"Code", -samp:"Code sample", -dt:"Definition term ", -dd:"Definition description", -bold_desc:"Bold (Ctrl+B)", -italic_desc:"Italic (Ctrl+I)", -underline_desc:"Underline (Ctrl+U)", -striketrough_desc:"Strikethrough", -justifyleft_desc:"Align left", -justifycenter_desc:"Align center", -justifyright_desc:"Align right", -justifyfull_desc:"Align full", -bullist_desc:"Unordered list", -numlist_desc:"Ordered list", -outdent_desc:"Outdent", -indent_desc:"Indent", -undo_desc:"Undo (Ctrl+Z)", -redo_desc:"Redo (Ctrl+Y)", -link_desc:"Insert/edit link", -unlink_desc:"Unlink", -image_desc:"Insert/edit image", -cleanup_desc:"Cleanup messy code", -code_desc:"Edit HTML Source", -sub_desc:"Subscript", -sup_desc:"Superscript", -hr_desc:"Insert horizontal ruler", -removeformat_desc:"Remove formatting", -custom1_desc:"Your custom description here", -forecolor_desc:"Select text color", -backcolor_desc:"Select background color", -charmap_desc:"Insert custom character", -visualaid_desc:"Toggle guidelines/invisible elements", -anchor_desc:"Insert/edit anchor", -cut_desc:"Cut", -copy_desc:"Copy", -paste_desc:"Paste", -image_props_desc:"Image properties", -newdocument_desc:"New document", -help_desc:"Help", -blockquote_desc:"Blockquote", -clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?", -path:"Path", -newdocument:"Are you sure you want clear all contents?", -toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X", -more_colors:"More colors" -}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/themes/advanced/langs/en_dlg.js b/wp-includes/js/tinymce/themes/advanced/langs/en_dlg.js index 80e49419c6..e69de29bb2 100644 --- a/wp-includes/js/tinymce/themes/advanced/langs/en_dlg.js +++ b/wp-includes/js/tinymce/themes/advanced/langs/en_dlg.js @@ -1,51 +0,0 @@ -tinyMCE.addI18n('en.advanced_dlg',{ -about_title:"About TinyMCE", -about_general:"About", -about_help:"Help", -about_license:"License", -about_plugins:"Plugins", -about_plugin:"Plugin", -about_author:"Author", -about_version:"Version", -about_loaded:"Loaded plugins", -anchor_title:"Insert/edit anchor", -anchor_name:"Anchor name", -code_title:"HTML Source Editor", -code_wordwrap:"Word wrap", -colorpicker_title:"Select a color", -colorpicker_picker_tab:"Picker", -colorpicker_picker_title:"Color picker", -colorpicker_palette_tab:"Palette", -colorpicker_palette_title:"Palette colors", -colorpicker_named_tab:"Named", -colorpicker_named_title:"Named colors", -colorpicker_color:"Color:", -colorpicker_name:"Name:", -charmap_title:"Select custom character", -image_title:"Insert/edit image", -image_src:"Image URL", -image_alt:"Image description", -image_list:"Image list", -image_border:"Border", -image_dimensions:"Dimensions", -image_vspace:"Vertical space", -image_hspace:"Horizontal space", -image_align:"Alignment", -image_align_baseline:"Baseline", -image_align_top:"Top", -image_align_middle:"Middle", -image_align_bottom:"Bottom", -image_align_texttop:"Text top", -image_align_textbottom:"Text bottom", -image_align_left:"Left", -image_align_right:"Right", -link_title:"Insert/edit link", -link_url:"Link URL", -link_target:"Target", -link_target_same:"Open link in the same window", -link_target_blank:"Open link in a new window", -link_titlefield:"Title", -link_is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?", -link_is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?", -link_list:"Link list" -}); \ No newline at end of file diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php index 63c78d8bdf..2f0c5e30d4 100644 --- a/wp-includes/js/tinymce/tiny_mce_config.php +++ b/wp-includes/js/tinymce/tiny_mce_config.php @@ -2,7 +2,8 @@ @ require('../../../wp-config.php'); cache_javascript_headers(); - function wp_translate_tinymce_lang($text) { + // deprecated + function wp_translate_tinymce_lang($text) { if ( ! function_exists('__') ) { return $text; } else { @@ -52,7 +53,7 @@ if ( $_SERVER['HTTPS'] == 'on' ) $mce_css = str_replace('http://', 'https://', $mce_css); - $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower(get_locale()); + $mce_locale = ( '' == get_locale() ) ? 'en' : strtolower( substr(get_locale(), 0, 2) ); // only ISO 639-1 ?> initArray = { @@ -76,10 +77,6 @@ initArray = { convert_urls : false, relative_urls : false, remove_script_host : false, - force_p_newlines : true, - force_br_newlines : false, - convert_newlines_to_brs : false, - remove_linebreaks : false, fix_list_elements : true, fix_table_elements : true, gecko_spellcheck : true, @@ -89,7 +86,7 @@ initArray = { content_css : "", - save_callback : "switchEditors.saveCallback", + save_callback : "switchEditors.saveCallback", plugins : "" }; diff --git a/wp-includes/js/tinymce/tiny_mce_gzip.php b/wp-includes/js/tinymce/tiny_mce_gzip.php index 2544543e8f..a6795dd610 100644 --- a/wp-includes/js/tinymce/tiny_mce_gzip.php +++ b/wp-includes/js/tinymce/tiny_mce_gzip.php @@ -1,5 +1,5 @@ '); // Send request diff --git a/wp-includes/js/tinymce/tiny_mce_popup.js b/wp-includes/js/tinymce/tiny_mce_popup.js index c57a4b0b2c..2f47bdcd02 100644 --- a/wp-includes/js/tinymce/tiny_mce_popup.js +++ b/wp-includes/js/tinymce/tiny_mce_popup.js @@ -83,7 +83,7 @@ tinyMCEPopup = { requireLangPack : function() { var u = this.getWindowArg('plugin_url') || this.getWindowArg('theme_url'); - if (u) + if (u && u.indexOf('wp-includes') == -1 ) document.write(''); }, diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index b226059159..6d44e7d4bf 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -30,7 +30,7 @@ class WP_Scripts { $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' ); // Modify this version when tinyMCE plugins are changed - $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20080129' ); + $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '20080208' ); $mce_config = apply_filters('tiny_mce_config_url', '/wp-includes/js/tinymce/tiny_mce_config.php'); $this->add( 'wp_tiny_mce', $mce_config, array('tiny_mce'), '20080129' );