WordPress.org

Plugin Directory

Changeset 555859


Ignore:
Timestamp:
06/11/12 00:38:20 (22 months ago)
Author:
moraleida.me
Message:

0.2 stable with proper localization.

Location:
default-values-for-attachments/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • default-values-for-attachments/trunk/default-values-for-attachments.php

    r552596 r555859  
    44Plugin URI: http://plugins.moraleida.me/default-values 
    55Description: Set default Title, Caption or Description for every image you upload. 
    6 Version: 0.1 
     6Version: 0.2 
    77Author: Ricardo Moraleida 
    88Author URI: http://moraleida.me 
     
    2929// Proper localization 
    3030function me_dvfa_locale_init() { 
    31     load_plugin_textdomain('me_dvfa_locale', false, basename( dirname( __FILE__ ) ) . '/languages' ); 
     31    load_plugin_textdomain('me_dvfa_locale', false, basename( dirname( __FILE__ ) ) . '/languages/' ); 
    3232} 
    33 add_action('init', 'me_dvfa_locale_init'); 
     33add_action('plugins_loaded', 'me_dvfa_locale_init'); 
    3434 
    3535 
     
    3737// Create the Media Menu 
    3838function me_dvfa_media_menu_page() { 
    39     add_media_page('Default Values', 'Default Values', 'activate_plugins', 'me_dvfa_default_values', 'me_dfva_options'); 
     39    add_media_page('Default Values', __('Default Values', 'me_dvfa_locale'), 'activate_plugins', 'me_dvfa_default_values', 'me_dfva_options'); 
    4040} 
    4141add_action('admin_menu', 'me_dvfa_media_menu_page'); 
     
    8282?> 
    8383    <div class="wrap"> 
    84     <h2>Set Default Media Values</h2> 
     84    <h2><?php  _e('Set Default Media Values','me_dvfa_locale'); ?></h2> 
    8585    <p><?php  _e('Use the form below to set default values for every media item you upload on this site. Any field left blank on the upload process will be replaced by the corresponding values below.','me_dvfa_locale'); ?></p> 
    8686    <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>" class="media-upload-form" id="me_dfva_default_values"> 
     
    9898            </td> 
    9999            <td> 
    100             <p><strong><?php  _e('File name:'); ?></strong><?php  _e('your-uploaded-file-name.jpg','me_dvfa_locale'); ?></p> 
    101             <p><strong><?php  _e('File type:'); ?></strong> image/jpeg</p> 
    102             <p><strong><?php  _e('Upload date:'); ?></strong><?php echo date(' d/m/Y'); ?></p><p><strong><?php  _e('Dimensions:'); ?></strong> <span id='media-dims-15'>1024&nbsp;&times;&nbsp;768</span> </p> 
     100            <p><strong><?php  _e('File name:',"me_dvfa_locale"); ?></strong><?php  _e('your-uploaded-file-name.jpg','me_dvfa_locale'); ?></p> 
     101            <p><strong><?php  _e('File type:',"me_dvfa_locale"); ?></strong> image/jpeg</p> 
     102            <p><strong><?php  _e('Upload date:',"me_dvfa_locale"); ?></strong><?php echo date(' d/m/Y'); ?></p><p><strong><?php  _e('Dimensions:',"me_dvfa_locale"); ?></strong> <span id='media-dims-15'>1024&nbsp;&times;&nbsp;768</span> </p> 
    103103                        </td> 
    104104                </tr> 
     
    108108        <tr><td style='display:none' colspan='2' class='image-editor' id='image-editor-15'></td></tr> 
    109109        <tr class='post_title form-required'> 
    110             <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_title'><span class='alignleft'><?php  _e('Title'); ?></span><span class="alignright"><abbr title="required" class="required">*</abbr></span><br class='clear' /></label></th> 
     110            <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_title'><span class='alignleft'><?php  _e('Title',"me_dvfa_locale"); ?></span><span class="alignright"><abbr title="required" class="required">*</abbr></span><br class='clear' /></label></th> 
    111111            <td class='field'><input type='text' class='text' id='me_dvfa_default_attachment_title' name='me_dvfa_default_attachment_title' value='<?php echo $title_val; ?>'  aria-required='true'  /></td> 
    112112        </tr> 
    113113        <tr class='image_alt'> 
    114             <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_alt_text'><span class='alignleft'><?php  _e('Alternate Text'); ?></span><br class='clear' /></label></th> 
    115             <td class='field'><input type='text' class='text' readonly='readonly' id='me_dvfa_default_attachment_alt_text' name='me_dvfa_default_attachment_alt_text' value=''  /><p class='help'><?php  _e('Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;'); ?></p></td> 
     114            <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_alt_text'><span class='alignleft'><?php  _e('Alternate Text',"me_dvfa_locale"); ?></span><br class='clear' /></label></th> 
     115            <td class='field'><input type='text' class='text' readonly='readonly' id='me_dvfa_default_attachment_alt_text' name='me_dvfa_default_attachment_alt_text' value=''  /><p class='help'><?php  _e('Alt text for the image, e.g. &#8220;The Mona Lisa&#8221;',"me_dvfa_locale"); ?></p></td> 
    116116        </tr> 
    117117        <tr class='post_excerpt'> 
    118             <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_caption'><span class='alignleft'><?php  _e('Caption'); ?></span><br class='clear' /></label></th> 
     118            <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_caption'><span class='alignleft'><?php  _e('Caption',"me_dvfa_locale"); ?></span><br class='clear' /></label></th> 
    119119            <td class='field'><input type='text' class='text' id='me_dvfa_default_attachment_caption' name='me_dvfa_default_attachment_caption' value='<?php echo $caption_val; ?>'  /></td> 
    120120        </tr> 
    121121        <tr class='post_content'> 
    122             <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_description'><span class='alignleft'><?php  _e('Description'); ?></span><br class='clear' /></label></th> 
     122            <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_description'><span class='alignleft'><?php  _e('Description',"me_dvfa_locale"); ?></span><br class='clear' /></label></th> 
    123123            <td class='field'><textarea id='me_dvfa_default_attachment_description' name='me_dvfa_default_attachment_description' ><?php echo $description_val; ?></textarea></td> 
    124124        </tr> 
    125125        <tr class='image_url'> 
    126             <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_url'><span class='alignleft'><?php  _e('File URL'); ?></span><br class='clear' /></label></th> 
    127             <td class='field'><input type='text' class='text urlfield' readonly='readonly' name='attachments[15][url]' value='<?php echo $upload_dir['baseurl']; ?><?php  _e('/yyyy/mm/your-uploaded-file-name.jpg','me_dvfa_locale'); ?>' /><br /><p class='help'><?php  _e('Location of the uploaded file.'); ?></p></td> 
     126            <th valign='top' scope='row' class='label'><label for='me_dvfa_default_attachment_url'><span class='alignleft'><?php  _e('File URL',"me_dvfa_locale"); ?></span><br class='clear' /></label></th> 
     127            <td class='field'><input type='text' class='text urlfield' readonly='readonly' name='attachments[15][url]' value='<?php echo $upload_dir['baseurl']; ?><?php  _e('/yyyy/mm/your-uploaded-file-name.jpg','me_dvfa_locale'); ?>' /><br /><p class='help'><?php  _e('Location of the uploaded file.',"me_dvfa_locale"); ?></p></td> 
    128128        </tr> 
    129129    </tbody> 
     
    165165        if ( strlen(trim($post['post_title'])) == 0 && !$title_val ) { 
    166166                    $post['post_title'] = preg_replace('/\.\w+$/', '', basename($post['guid'])); 
    167                     $post['errors']['post_title']['errors'][] = __('Empty Title filled from filename.'); 
     167                    $post['errors']['post_title']['errors'][] = __('Empty Title filled from filename.',"me_dvfa_locale"); 
    168168        }  
    169169                // if the user hasn't input any post_title but we do have a default value on the DB, use user defaults 
  • default-values-for-attachments/trunk/readme.txt

    r552596 r555859  
    55Requires at least: 2.5 
    66Tested up to: 3.3.2 
    7 Stable tag: 0.1 
     7Stable tag: 0.2 
    88License: GPLv2 or later 
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html 
     
    3939 
    4040= 0.1 = 
     41Added proper localization and pt_BR translation files. 
     42= 0.1 = 
    4143First version. Experimental. 
    4244 
    4345== Upgrade Notice == 
    4446 
     47= 0.2 = 
     48Added proper localization and pt_BR translation files. 
    4549= 0.1 = 
    4650First version. Experimental. 
Note: See TracChangeset for help on using the changeset viewer.