Plugin Directory

Changeset 602500


Ignore:
Timestamp:
09/22/2012 08:45:24 PM (14 years ago)
Author:
bjorsq
Message:

i18n stuff

Location:
rich-text-excerpts/trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • rich-text-excerpts/trunk/rich-text-excerpts.js

    r601970 r602500  
    55Author: Peter Edwards
    66Author URI: http://bjorsq.net
    7 Version: 1.0
     7Version: 1.2beta
    88License: GPLv3
    99
  • rich-text-excerpts/trunk/rich-text-excerpts.php

    r601976 r602500  
    66Author: Peter Edwards
    77Author URI: http://bjorsq.net
    8 Version: 1.1
     8Version: 1.2beta
    99License: GPLv3
    1010
     
    5252        add_action( 'admin_menu', array('RichTextExcerpts', 'add_plugin_admin_menu') );
    5353        add_action( 'admin_init', array('RichTextExcerpts', 'register_plugin_options') );
     54        /**
     55         * register text domain
     56         */
     57        add_action('plugins_loaded', array('RichTextExcerpts', 'load_text_domain'));
     58    }
     59
     60    /**
     61     * i18n
     62     */
     63    public static function load_text_domain()
     64    {
     65        load_plugin_textdomain( 'rich-text-excerpts', false, dirname(plugin_basename(__FILE__)) . '/languages/');
    5466    }
    5567
     
    8395        global $post;
    8496        $plugin_options = self::get_plugin_options();
    85         print('<div style="margin-bottom:1em;clear:both;width:100%;"><h3><label for="excerpt">Excerpt</label></h3>');
     97        printf('<div style="margin-bottom:1em;clear:both;width:100%%;"><h3><label for="excerpt">%s</label></h3>', __('Excerpt', 'rich-text-excerpts'));
    8698        /* options for editor */
    8799        $options = array(
     
    134146    {
    135147        /* Plugin Options page */
    136         $options_page = add_submenu_page("options-general.php", "Rich Text Excerpts", "Rich Text Excerpts", "manage_options", "rich_text_excerpts_options", array('RichTextExcerpts', "plugin_options_page") );
     148        $options_page = add_submenu_page("options-general.php", __('Rich Text Excerpts', 'rich-text-excerpts'), __('Rich Text Excerpts', 'rich-text-excerpts'), "manage_options", "rich_text_excerpts_options", array('RichTextExcerpts', "plugin_options_page") );
    137149        /* Use the admin_print_scripts action to add scripts for theme options */
    138150        add_action( 'admin_print_scripts-' . $options_page, array('RichTextExcerpts', 'plugin_admin_scripts') );
     
    154166    public static function plugin_options_page()
    155167    {
    156         print('<div class="wrap"><div class="icon32" id="icon-options-general"><br /></div><h2>Rich Text Excerpts Options</h2>');
     168        printf('<div class="wrap"><div class="icon32" id="icon-options-general"><br /></div><h2>%s</h2>', __('Rich Text Excerpts Options', 'rich-text-excerpts'));
    157169        settings_errors('rich_text_excerpts_options');
    158170        print('<form method="post" action="options.php">');
    159171        settings_fields('rich_text_excerpts_options');
    160172        do_settings_sections('rte');
    161         printf('<p class="submit"><input type="submit" class="button-primary" name="Submit" value="%s" /></p>', _('Save Changes'));
     173        printf('<p class="submit"><input type="submit" class="button-primary" name="Submit" value="%s" /></p>', __('Save Changes', 'rich-text-excerpts'));
    162174        print('</form></div>');
    163175    }
     
    179191        add_settings_field(
    180192            'supported_post_types',
    181             'Choose which post types will have rich text editor for excerpts',
     193            __('Choose which post types will have rich text editor for excerpts', 'rich-text-excerpts'),
    182194            array('RichTextExcerpts', 'options_setting_post_types'),
    183195            'rte',
     
    188200        add_settings_section(
    189201            'editor-options',
    190             'Editor Options',
     202            __('Editor Options', 'rich-text-excerpts'),
    191203            array('RichTextExcerpts', 'options_section_text'),
    192204            'rte'
     
    194206        add_settings_field(
    195207            'editor_type',
    196             'Choose which Editor is used for excerpts',
     208            __('Choose which Editor is used for excerpts', 'rich-text-excerpts'),
    197209            array('RichTextExcerpts', 'options_setting_editor_type'),
    198210            'rte',
     
    202214        add_settings_field(
    203215            'editor_settings',
    204             'Editor Settings',
     216            __('Editor Settings', 'rich-text-excerpts'),
    205217            array('RichTextExcerpts', 'options_editor_settings'),
    206218            'rte',
     
    256268            }
    257269        }
    258         print('<p>Post types not selected here will use the regular plain text editor for excerpts. If the post type you want is not listed here, it does not currently support excerpts - to add support for excerpts to a post type, see <a href="http://codex.wordpress.org/Function_Reference/add_post_type_support">add_post_type_support()</a> in the Wordpress Codex.</p>');
     270        print('<p>');
     271        printf(__('Post types not selected here will use the regular plain text editor for excerpts. If the post type you want is not listed here, it does not currently support excerpts - to add support for excerpts to a post type, see %s in the Wordpress Codex', 'rich-text-excerpts'), '<a href="http://codex.wordpress.org/Function_Reference/add_post_type_support">add_post_type_support()</a>');
     272        print('.</p>');
    259273    }
    260274
     
    266280        $options = self::get_plugin_options();
    267281        $chckd = ($options["editor_type"] === "teeny")? ' checked="checked"': '';
    268         printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-teeny" class="rte-options-editor-type" value="teeny"%s /> <label for="rich_text_excerpts_options-editor_type-teeny">Use the minimal editor configuration used in PressThis</label></p>', $chckd);
     282        printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-teeny" class="rte-options-editor-type" value="teeny"%s /> <label for="rich_text_excerpts_options-editor_type-teeny">%s</label></p>', $chckd, __('Use the minimal editor configuration used in PressThis', 'rich-text-excerpts'));
    269283        $chckd = ($options["editor_type"] === "teeny")? '': ' checked="checked"';
    270         printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-tiny" class="rte-options-editor-type" value="tiny"%s /> <label for="rich_text_excerpts_options-editor_type-tiny">Use the full version of the editor</label></p>', $chckd);
    271         print('<p>Choose whether to use the full TinyMCE editor, or the &ldquo;teeny&rdquo; version of the editor (recommended). Customising the full TinyMCE editor is best carried out using a plugin like TinyMCE Advanced. If you choose to use the &ldquo;teeny&rdquo; version of the editor, you can customise the controls it will have here.</p>');
     284        printf('<p><input type="radio" name="rich_text_excerpts_options[editor_type]" id="rich_text_excerpts_options-editor_type-tiny" class="rte-options-editor-type" value="tiny"%s /> <label for="rich_text_excerpts_options-editor_type-tiny">%s</label></p>', $chckd, __('Use the full version of the editor', 'rich-text-excerpts'));
     285        printf('<p>%s.</p>', __('Choose whether to use the full TinyMCE editor, or the &ldquo;teeny&rdquo; version of the editor (recommended). Customising the full TinyMCE editor is best carried out using a plugin like TinyMCE Advanced. If you choose to use the &ldquo;teeny&rdquo; version of the editor, you can customise the controls it will have here', 'rich-text-excerpts'));
    272286    }
    273287
     
    279293        $options = self::get_plugin_options();
    280294        $chckd = $options['editor_settings']['wpautop']? '': ' checked="checked"';
    281         printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][wpautop]" id="rich_text_excerpts_options-editor_settings-wpautop"%s /> <label for="rich_text_excerpts_options-editor_settings-wpautop">Stop removing the &lt;p&gt; and &lt;br&gt; tags when saving and show them in the HTML editor This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently.</label></p>', $chckd);
     295        printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][wpautop]" id="rich_text_excerpts_options-editor_settings-wpautop"%s /> <label for="rich_text_excerpts_options-editor_settings-wpautop">%s.</label></p>', $chckd, __('Stop removing the &lt;p&gt; and &lt;br&gt; tags when saving and show them in the HTML editor This will make it possible to use more advanced coding in the HTML editor without the back-end filtering affecting it much. However it may behave unexpectedly in rare cases, so test it thoroughly before enabling it permanently', 'rich-text-excerpts'));
    282296        $chckd = $options['editor_settings']['media_buttons']? 'checked="checked"': '';
    283         printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][media_buttons]" id="rich_text_excerpts_options-editor_settings-media_buttons"%s /> <label for="rich_text_excerpts_options-editor_settings-media_buttons">Enable upload media button</label></p>', $chckd);
    284         printf('<p><input type="text" length="2" name="rich_text_excerpts_options[editor_settings][textarea_rows]" id="rich_text_excerpts_options-editor_settings-textarea_rows" value="%d" /> <label for="rich_text_excerpts_options-editor_settings-textarea_rows">Number of rows to use in the text editor (minimum is 3)</label></p>', intVal($options['editor_settings']['textarea_rows']));
    285         print('<p><strong>Toolbar Buttons and Plugins</strong></p>');
     297        printf('<p><input type="checkbox" name="rich_text_excerpts_options[editor_settings][media_buttons]" id="rich_text_excerpts_options-editor_settings-media_buttons"%s /> <label for="rich_text_excerpts_options-editor_settings-media_buttons">%s</label></p>', $chckd, __('Enable upload media button', 'rich-text-excerpts'));
     298        printf('<p><input type="text" length="2" name="rich_text_excerpts_options[editor_settings][textarea_rows]" id="rich_text_excerpts_options-editor_settings-textarea_rows" value="%d" /> <label for="rich_text_excerpts_options-editor_settings-textarea_rows">%s</label></p>', intVal($options['editor_settings']['textarea_rows']), __('Number of rows to use in the text editor (minimum is 3)', 'rich-text-excerpts'));
     299        printf('<p><strong>%s</strong></p>', __('Toolbar Buttons and Plugins', 'rich-text-excerpts'));
    286300        /**
    287301         * settings for teeny text editor
    288302         */
    289303        print('<div id="editor_type_teeny_options">');
    290         print('<p>For a list of buttons and plugins in TinyMCE, <a href="http://www.tinymce.com/wiki.php/Buttons/controls">see this page on the TinyMCE wiki</a>. There is also some documentation on the <a href="http://codex.wordpress.org/TinyMCE">implementation of TinyMCE in Wordpress on the Wordpress Codex</a>.</p><p>Button and plugin names should be separated using commas.</p>');
    291         printf('<p><label for="rich_text_excerpts_options-editor_settings-plugins">Plugins to add - make sure you add any plugin specific buttons to the editor below.</label><br /><input type="text" length="50" name="rich_text_excerpts_options[editor_settings][plugins]" id="rich_text_excerpts_options-editor_settings-plugins" value="%s" /></p>', implode(',', $options['editor_settings']['plugins']));
    292         printf('<p><label for="rich_text_excerpts_options-editor_settings-buttons">Toolbar buttons - use the word &lsquo;separator&rsquo; to separate groups of buttons</label><br /><textarea name="rich_text_excerpts_options[editor_settings][buttons]" id="rich_text_excerpts_options-editor_settings-buttons" cols="100" rows="3">%s</textarea></p>', implode(',', $options['editor_settings']['buttons']));
     304        printf('<p>%s.</p>', __('For a list of buttons and plugins in TinyMCE, <a href="http://www.tinymce.com/wiki.php/Buttons/controls">see this page on the TinyMCE wiki</a>. There is also some documentation on the <a href="http://codex.wordpress.org/TinyMCE">implementation of TinyMCE in Wordpress on the Wordpress Codex</a>.</p><p>Button and plugin names should be separated using commas', 'rich-text-excerpts'));
     305        printf('<p><label for="rich_text_excerpts_options-editor_settings-plugins">%s.</label><br /><input type="text" length="50" name="rich_text_excerpts_options[editor_settings][plugins]" id="rich_text_excerpts_options-editor_settings-plugins" value="%s" /></p>', __('Plugins to add - make sure you add any plugin specific buttons to the editor below', 'rich-text-excerpts'), implode(',', $options['editor_settings']['plugins']));
     306        printf('<p><label for="rich_text_excerpts_options-editor_settings-buttons">%s</label><br /><textarea name="rich_text_excerpts_options[editor_settings][buttons]" id="rich_text_excerpts_options-editor_settings-buttons" cols="100" rows="3">%s</textarea></p>', __('Toolbar buttons - use the word &lsquo;separator&rsquo; to separate groups of buttons', 'rich-text-excerpts'), implode(',', $options['editor_settings']['buttons']));
    293307        print('</div>');
    294308        /**
     
    297311        print('<div id="editor_type_tiny_options">');
    298312        if (is_plugin_active('tinymce-advanced/tinymce-advanced.php')) {
    299             printf('<p id=""><a href="%s">Configure the buttons for the advanced editor using the TinyMCE Advanced plugin</a>.</p>', admin_url('options-general.php?page=tinymce-advanced'));
     313            printf('<p><a href="%s">%s</a>.</p>', admin_url('options-general.php?page=tinymce-advanced'), __('Configure the buttons for the advanced editor using the TinyMCE Advanced plugin', 'rich-text-excerpts'));
    300314        } else {
    301             printf('<p>If you want to configure the buttons for the advanced editor, <a href="%s">install and activate the TinyMCE Advanced plugin</a>.</p>', admin_url('plugins.php'));
     315            printf('<p><a href="%s">%s</a>.</p>', admin_url('plugins.php'), __('If you want to configure the buttons for the advanced editor, install and activate the TinyMCE Advanced plugin', 'rich-text-excerpts'));
    302316        }
    303317        print('</div>');
Note: See TracChangeset for help on using the changeset viewer.