Plugin Directory

Changeset 136867


Ignore:
Timestamp:
07/20/2009 05:25:57 AM (17 years ago)
Author:
sakuratan
Message:

I18N, po subdirectory added.

Location:
nitwpress/trunk
Files:
4 added
1 edited

Legend:

Unmodified
Added
Removed
  • nitwpress/trunk/nitwpress.php

    r135955 r136867  
    191191}
    192192
     193function nitwpress_display_error($mesg) {
     194    echo "<p style=\"color:red\">ERROR: {$mesg}</p>";
     195}
     196
    193197/*
    194198 * Widget manager.
     
    203207?>
    204208<form method="post">
    205   <h3>Twitter account</h3>
     209  <h3><?php _e('Twitter account', 'nitwpress') ?></h3>
    206210  <table>
    207211    <tr>
    208       <td>Username:</td>
     212      <td><?php _e('Username:', 'nitwpress') ?></td>
    209213      <td><input type="text" name="nitwpress_username" value="<?php echo htmlspecialchars($options['username']) ?>" /></td>
    210214    </tr>
    211215
    212216    <tr>
    213       <td>Password:</td>
     217      <td><?php _e('Password:', 'nitwpress') ?></td>
    214218      <td><input type="password" name="nitwpress_password" value="<?php echo htmlspecialchars($options['password']) ?>" /></td>
    215219    </tr>
    216220  </table>
    217221
    218   <h3>Widget title</h3>
     222  <h3><?php _e('Widget title', 'nitwpress') ?></h3>
    219223
    220224  <div><input type="text" name="nitwpress_widgettitle" value="<?php echo htmlspecialchars($options['widgettitle']) ?>" style="width:100%" /></div>
    221225
    222   <p>(The widget suppress the widget title when this field is empty.)</p>
    223 
    224   <h3>CSS for widget content</h3>
     226  <p><?php _e('(The widget suppress the widget title when this field is empty.)', 'nitwpress') ?></p>
     227
     228  <h3><?php _e('CSS for widget content', 'nitwpress') ?></h3>
    225229
    226230  <div><input type="text" name="nitwpress_widgetstyles" value="<?php echo htmlspecialchars($options['widgetstyles']) ?>" style="width:100%" /></div>
    227   <p>(The widget content area have &quot;nitwpress_widget_content&quot; class. You can use the CSS class for designing the widget with out this field.)</p>
    228 
    229   <h3>Font colors</h3>
     231  <p><?php _e('(The widget content area have &quot;nitwpress_widget_content&quot; class. You can use the CSS class for designing the widget with out this field.)', 'nitwpress') ?></p>
     232
     233  <h3><?php _e('Font colors', 'nitwpress') ?></h3>
    230234
    231235  <table>
    232236    <tr>
    233       <td>Color of comments:</td>
     237      <td><?php _e('Color of comments:', 'nitwpress') ?></td>
    234238      <td><input type="text" name="nitwpress_fontcolor" value="<?php echo htmlspecialchars($options['fontcolor']) ?>" size="7" /></td>
    235239    </tr>
    236240    <tr>
    237       <td>Color of links:</td>
     241      <td><?php _e('Color of links:', 'nitwpress') ?></td>
    238242      <td><input type="text" name="nitwpress_linkcolor" value="<?php echo htmlspecialchars($options['linkcolor']) ?>" size="7" /></td>
    239243    </tr>
    240244  </table>
    241245
    242   <p>(Use hash color code (e.g. #ffffff) or &quot;auto&quot; for these fields.
    243   HTML color name (e.g. white) is not acceptable.
    244   The widget will read default font and link colors from Twitter API if you choose &quot;auto&quot;.)</p>
    245 
    246   <h3>Frame for icon image</h3>
     246  <p><?php _e('(Use hash color code (e.g. #ffffff) or &quot;auto&quot; for these fields. HTML color name (e.g. white) is not acceptable. The widget will read default font and link colors from Twitter API if you choose &quot;auto&quot;.)', 'nitwpress', 'nitwpress') ?></p>
     247  <h3><?php _e('Frame for icon image', 'nitwpress') ?></h3>
    247248
    248249  <p><input type="checkbox" id="nitwpress_iconframe_checkbox" name="nitwpress_iconframe" value="1" <?php if ($options['iconframe']) { echo 'checked="checked"'; } ?> />
    249   <label for="nitwpress_iconframe_checkbox">Enable icon image frame.</label></p>
    250   <p>Color of icon frame: <input type="text" name="nitwpress_iconframecolor" value="<?php echo htmlspecialchars($options['iconframecolor']) ?>" size="7" /><br />
    251   (Use hash color code (e.g. #ffffff) for this field.
    252   HTML color name (e.g. white) is not acceptable.)</p>
    253 
    254   <h3>Miscellaneous options</h3>
    255 
    256   <p>Update timeline cache at every <input type="text" name="nitwpress_interval" value="<?php echo htmlspecialchars($options['interval']) ?>" size="3" /> minutes.</p>
     250  <label for="nitwpress_iconframe_checkbox"><?php _e('Enable icon image frame.', 'nitwpress') ?></label></p>
     251  <p><?php _e('Color of icon frame:', 'nitwpress') ?> <input type="text" name="nitwpress_iconframecolor" value="<?php echo htmlspecialchars($options['iconframecolor']) ?>" size="7" /><br />
     252  <?php _e('(Use hash color code (e.g. #ffffff) for this field. HTML color name (e.g. white) is not acceptable.)', 'nitwpress') ?></p>
     253
     254  <h3><?php _e('Miscellaneous options', 'nitwpress') ?></h3>
     255
     256  <p><?php _e('Cache updating interval:', 'nitwpress') ?> <input type="text" name="nitwpress_interval" value="<?php echo htmlspecialchars($options['interval']) ?>" size="3" /> <?php _e('(minutes)', 'nitwpress') ?></p>
    257257
    258258  <p><input type="checkbox" id="nitwpress_logo_checkbox" name="nitwpress_logo" value="1" <?php if ($options['logo']) { echo 'checked="checked"'; } ?> />
    259   <label for="nitwpress_logo_checkbox">Display NiTwPress logo on Flash.</label></p>
     259  <label for="nitwpress_logo_checkbox"><?php _e('Display NiTwPress logo on Flash.', 'nitwpress') ?></label></p>
    260260</form>
    261261<?php
    262262
    263     if (!is_dir(NITWPRESS_CACHEDIR)) :
    264 ?>
    265 <p style="color:red">ERROR: Missing permissions for writing on
    266 <?php echo NITWPRESS_CACHEDIR ?><br />
    267 Fix the error before enter your Twitter account</p>
    268 <?php
    269     endif;
     263    if (!is_dir(NITWPRESS_CACHEDIR)) {
     264    nitwpress_display_error(sprintf(__("Missing permissions for writing on %s. Fix the error before enter your Twitter account."), NITWPRESS_CACHEDIR));
     265    }
    270266
    271267    if (!function_exists('curl_init')) {
    272 ?>
    273 <p style="color:red">ERROR: Missing cURL module.</p>
    274 <?php
     268    nitwpress_display_error(__('Missing cURL module.'));
    275269    }
    276270}
     
    281275function nitwpress_init() {
    282276    require_once(ABSPATH . 'wp-includes/widgets.php');
     277    load_plugin_textdomain('nitwpress', 'wp-content/plugins/nitwpress/po',
     278               'nitwpress/po');
    283279    register_sidebar_widget('NiTwPress', 'nitwpress_sidebar_widget');
    284280    register_widget_control('NiTwPress', 'nitwpress_widget_control');
Note: See TracChangeset for help on using the changeset viewer.