Mark strings for translation.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1135 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rboren 2004-04-23 06:46:53 +00:00
parent 793a9be777
commit 9dfb6f67f8
3 changed files with 46 additions and 44 deletions

View File

@ -84,7 +84,7 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) {
echo "<tr style='background-color: $bgcolor'><td>$pad $category->cat_name</td> echo "<tr style='background-color: $bgcolor'><td>$pad $category->cat_name</td>
<td>$category->category_description</td> <td>$category->category_description</td>
<td>$count</td> <td>$count</td>
<td><a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>Edit</a></td><td><a href='categories.php?action=Delete&amp;cat_ID=$category->cat_ID' onclick=\"return confirm('You are about to delete the category \'". addslashes($category->cat_name) ."\' and all its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop.')\" class='delete'>Delete</a></td> <td><a href='categories.php?action=edit&amp;cat_ID=$category->cat_ID' class='edit'>" . __('Edit') . "</a></td><td><a href='categories.php?action=Delete&amp;cat_ID=$category->cat_ID' onclick=\"return confirm('". sprintf(__("You are about to delete the category \'%s\'. All of its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop."), addslashes($category->cat_name)) . "')\" class='delete'>" . __('Delete') . "</a></td>
</tr>"; </tr>";
cat_rows($category->cat_ID, $level + 1); cat_rows($category->cat_ID, $level + 1);
} }
@ -125,11 +125,11 @@ function wp_create_thumbnail($file, $max_side, $effect = '') {
// handle. duh. i hope. // handle. duh. i hope.
if(!function_exists('imagegif') && $type[2] == 1) { if(!function_exists('imagegif') && $type[2] == 1) {
$error = 'Filetype not supported. Thumbnail not created.'; $error = __('Filetype not supported. Thumbnail not created.');
}elseif(!function_exists('imagejpeg') && $type[2] == 2) { }elseif(!function_exists('imagejpeg') && $type[2] == 2) {
$error = 'Filetype not supported. Thumbnail not created.'; $error = __('Filetype not supported. Thumbnail not created.');
}elseif(!function_exists('imagepng') && $type[2] == 3) { }elseif(!function_exists('imagepng') && $type[2] == 3) {
$error = 'Filetype not supported. Thumbnail not created.'; $error = __('Filetype not supported. Thumbnail not created.');
} else { } else {
// create the initial copy from the original file // create the initial copy from the original file
@ -176,15 +176,15 @@ function wp_create_thumbnail($file, $max_side, $effect = '') {
if($type[2] == 1) { if($type[2] == 1) {
if(!imagegif($thumbnail, $thumbpath)) { if(!imagegif($thumbnail, $thumbpath)) {
$error = "Thumbnail path invalid"; $error = __("Thumbnail path invalid");
} }
} elseif($type[2] == 2) { } elseif($type[2] == 2) {
if(!imagejpeg($thumbnail, $thumbpath)) { if(!imagejpeg($thumbnail, $thumbpath)) {
$error = "Thumbnail path invalid"; $error = __("Thumbnail path invalid");
} }
} elseif($type[2] == 3) { } elseif($type[2] == 3) {
if(!imagepng($thumbnail, $thumbpath)) { if(!imagepng($thumbnail, $thumbpath)) {
$error = "Thumbnail path invalid"; $error = __("Thumbnail path invalid");
} }
} }
@ -256,9 +256,9 @@ function get_meta_keys() {
function meta_form() { function meta_form() {
$keys = get_meta_keys(); $keys = get_meta_keys();
?> ?>
<h4>Add new custom data to this post:</h4> <h4><?php _e('Add new custom data to this post:') ?></h4>
<div id="postcustomkeys"> <div id="postcustomkeys">
<p>Select existing key or enter new key</p> <p><?php _e('Select existing key or enter new key') ?></p>
<?php <?php
if ($keys) { if ($keys) {
?> ?>
@ -276,13 +276,13 @@ if ($keys) {
<input type="text" id="metakeyinput" name="metakeyinput" /> <input type="text" id="metakeyinput" name="metakeyinput" />
</div> </div>
<div id="postcustomvals"> <div id="postcustomvals">
<p>Custom Value</p> <p><?php _e('Custom Value') ?></p>
<textarea id="metavalue" name="metavalue" rows="3" cols="25"></textarea> <textarea id="metavalue" name="metavalue" rows="3" cols="25"></textarea>
</div> </div>
<br style="clear: both;" /> <br style="clear: both;" />
<div id="postcustomsubmit"> <div id="postcustomsubmit">
<input type="submit" id="save" name="save" value="Add Custom"> <input type="submit" id="save" name="save" value="<?php _e('Add Custom') ?>">
</div> </div>
<?php <?php
} }

View File

@ -38,7 +38,7 @@ if ( !veriflog() ) {
header('Cache-Control: no-cache, must-revalidate'); header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache'); header('Pragma: no-cache');
if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) { if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) {
$error="<strong>Error</strong>: wrong login or password."; $error= __("<strong>Error</strong>: wrong login or password.");
} }
$redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']); $redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']);
header($redir); header($redir);

View File

@ -1,13 +1,15 @@
<?php <?php
require_once('../wp-includes/wp-l10n.php');
$title = 'Upload Image or File'; $title = 'Upload Image or File';
require_once('admin-header.php'); require_once('admin-header.php');
if ($user_level == 0) //Checks to see if user has logged in if ($user_level == 0) //Checks to see if user has logged in
die ("Cheatin' uh ?"); die (__("Cheatin' uh ?"));
if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config
die ("The admin disabled this function"); die (__("The admin disabled this function"));
$allowed_types = explode(' ', trim(strtolower(get_settings('fileupload_allowedtypes')))); $allowed_types = explode(' ', trim(strtolower(get_settings('fileupload_allowedtypes'))));
@ -27,7 +29,7 @@ if (!is_writable(get_settings('fileupload_realpath')))
switch ($action) { switch ($action) {
case 'not-writable': case 'not-writable':
?> ?>
<p>It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code><?php echo get_settings('fileupload_realpath'); ?></code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos.</p> <p><?php printf(__("It doesn't look like you can use the file upload feature at this time because the directory you have specified (<code>%s</code>) doesn't appear to be writable by WordPress. Check the permissions on the directory and for typos."), get_settings('fileupload_realpath')) ?></p>
<?php <?php
break; break;
@ -37,39 +39,39 @@ case '':
} }
$i = implode(', ', $type_tags); $i = implode(', ', $type_tags);
?> ?>
<p>You can upload files with the extension <?php echo $i ?> as long as they are no larger than <?php echo get_settings('fileupload_maxk'); ?> <abbr title="Kilobytes">KB</abbr>. If you&#8217;re an admin you can configure these values under <a href="options-misc.php">options</a>.</p> <p><?php printf(__('You can upload files with the extension %s as long as they are no larger than %s <abbr title="Kilobytes">KB</abbr>. If you&#8217;re an admin you can configure these values under <a href="%s">options</a>.'), $i, get_settings('fileupload_maxk'), 'options-misc.php') ?></p>
<form action="upload.php" method="post" enctype="multipart/form-data"> <form action="upload.php" method="post" enctype="multipart/form-data">
<p> <p>
<label for="img1">File:</label> <label for="img1"><?php _e('File:') ?></label>
<br /> <br />
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') * 1024 ?>" /> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') * 1024 ?>" />
<input type="file" name="img1" id="img1" size="35" class="uploadform" /></p> <input type="file" name="img1" id="img1" size="35" class="uploadform" /></p>
<p> <p>
<label for="imgdesc">Description:</label><br /> <label for="imgdesc"><?php _e('Description:') ?></label><br />
<input type="text" name="imgdesc" id="imgdesc" size="30" class="uploadform" /> <input type="text" name="imgdesc" id="imgdesc" size="30" class="uploadform" />
</p> </p>
<p>Create a thumbnail?</p> <p><?php _e('Create a thumbnail?') ?></p>
<p> <p>
<label for="thumbsize_no"> <label for="thumbsize_no">
<input type="radio" name="thumbsize" value="none" checked="checked" id="thumbsize_no" /> <input type="radio" name="thumbsize" value="none" checked="checked" id="thumbsize_no" />
No thanks</label> <?php _e('No thanks') ?></label>
<br /> <br />
<label for="thumbsize_small"> <label for="thumbsize_small">
<input type="radio" name="thumbsize" value="small" id="thumbsize_small" /> <input type="radio" name="thumbsize" value="small" id="thumbsize_small" />
Small (200px largest side)</label> <?php _e('Small (200px largest side)') ?></label>
<br /> <br />
<label for="thumbsize_large"> <label for="thumbsize_large">
<input type="radio" name="thumbsize" value="large" id="thumbsize_large" /> <input type="radio" name="thumbsize" value="large" id="thumbsize_large" />
Large (400px largest side)</label> <?php _e('Large (400px largest side)') ?></label>
<br /> <br />
<label for="thumbsize_custom"> <label for="thumbsize_custom">
<input type="radio" name="thumbsize" value="custom" id="thumbsize_custom" /> <input type="radio" name="thumbsize" value="custom" id="thumbsize_custom" />
Custom size</label> <?php _e('Custom size') ?></label>
: :
<input type="text" name="imgthumbsizecustom" size="4" /> <input type="text" name="imgthumbsizecustom" size="4" />
px (largest side) </p> <?php _e('px (largest side)') ?> </p>
<p><input type="submit" name="submit" value="Upload File" /></p> <p><input type="submit" name="submit" value="<?php _e('Upload File') ?>" /></p>
</form> </form>
</div><?php </div><?php
break; break;
@ -92,7 +94,7 @@ case 'upload':
$imgtype = strtolower($imgtype[count($imgtype)-1]); $imgtype = strtolower($imgtype[count($imgtype)-1]);
if (in_array($imgtype, $allowed_types) == false) { if (in_array($imgtype, $allowed_types) == false) {
die("File $img1_name of type $imgtype is not allowed."); die(sprintf(__("File %s of type %s is not allowed.") , $img1_name, $imgtype));
} }
if (strlen($imgalt)) { if (strlen($imgalt)) {
@ -126,7 +128,7 @@ case 'upload':
$moved = copy($img1, $pathtofile2); $moved = copy($img1, $pathtofile2);
} }
if (!$moved) { if (!$moved) {
die("Couldn't Upload Your File to $pathtofile2."); die(sprintf(__("Couldn't upload your file to %s."), $pathtofile2));
} else { } else {
chmod($pathtofile2, 0666); chmod($pathtofile2, 0666);
@unlink($img1); @unlink($img1);
@ -136,10 +138,10 @@ case 'upload':
// duplicate-renaming function contributed by Gary Lawrence Murphy // duplicate-renaming function contributed by Gary Lawrence Murphy
?> ?>
<p><strong>Duplicate File?</strong></p> <p><strong><?php __('Duplicate File?') ?></strong></p>
<p><b><em>The filename '<?php echo $img1_name; ?>' already exists!</em></b></p> <p><b><em><?php printf(__("The filename '%s' already exists!"), $img1_name); ?></em></b></p>
<p> filename '<?php echo $img1; ?>' moved to '<?php echo "$pathtofile2 - $img2_name"; ?>'</p> <p> <?php printf(__("Filename '%s' moved to '%s'"), $img1, "$pathtofile2 - $img2_name") ?></p>
<p>Confirm or rename:</p> <p><?php _e('Confirm or rename:') ?></p>
<form action="upload.php" method="post" enctype="multipart/form-data"> <form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') *1024 ?>" /> <input type="hidden" name="MAX_FILE_SIZE" value="<?php echo get_settings('fileupload_maxk') *1024 ?>" />
<input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" /> <input type="hidden" name="img1_type" value="<?php echo $img1_type;?>" />
@ -148,11 +150,11 @@ case 'upload':
<input type="hidden" name="img1" value="<?php echo $pathtofile2;?>" /> <input type="hidden" name="img1" value="<?php echo $pathtofile2;?>" />
<input type="hidden" name="thumbsize" value="<?php echo $_REQUEST['thumbsize'];?>" /> <input type="hidden" name="thumbsize" value="<?php echo $_REQUEST['thumbsize'];?>" />
<input type="hidden" name="imgthumbsizecustom" value="<?php echo $_REQUEST['imgthumbsizecustom'];?>" /> <input type="hidden" name="imgthumbsizecustom" value="<?php echo $_REQUEST['imgthumbsizecustom'];?>" />
Alternate name:<br /><input type="text" name="imgalt" size="30" class="uploadform" value="<?php echo $img2_name;?>" /><br /> <?php _e('Alternate name:') ?><br /><input type="text" name="imgalt" size="30" class="uploadform" value="<?php echo $img2_name;?>" /><br />
<br /> <br />
Description:<br /><input type="text" name="imgdesc" size="30" class="uploadform" value="<?php echo $imgdesc;?>" /> <?php _e('Description:') ?><br /><input type="text" name="imgdesc" size="30" class="uploadform" value="<?php echo $imgdesc;?>" />
<br /> <br />
<input type="submit" name="submit" value="Rename" class="search" /> <input type="submit" name="submit" value="<?php _e('Rename') ?>" class="search" />
</form> </form>
</div> </div>
<?php <?php
@ -170,7 +172,7 @@ die();
} }
// Still couldn't get it. Give up. // Still couldn't get it. Give up.
if (!moved) { if (!moved) {
die("Couldn't Upload Your File to $pathtofile."); die(sprintf(__("Couldn't upload your file to %s."), $pathtofile));
} else { } else {
chmod($pathtofile, 0666); chmod($pathtofile, 0666);
@unlink($img1); @unlink($img1);
@ -178,7 +180,7 @@ die();
} else { } else {
rename($img1, $pathtofile) rename($img1, $pathtofile)
or die("Couldn't Upload Your File to $pathtofile."); or die(sprintf(__("Couldn't upload your file to %s."), $pathtofile));
} }
if($_POST['thumbsize'] != 'none' ) { if($_POST['thumbsize'] != 'none' ) {
@ -208,22 +210,22 @@ if ( ereg('image/',$img1_type)) {
?> ?>
<h3>File uploaded!</h3> <h3><?php _e('File uploaded!') ?></h3>
<p>Your file <code><?php echo $img1_name; ?></code> was uploaded successfully !</p> <p><?php printf(__("Your file <code>%s</code> was uploaded successfully!"), $img1_name); ?></p>
<p>Here&#8217;s the code to display it:</p> <p><?php _e('Here&#8217;s the code to display it:') ?></p>
<p><code><?php echo $piece_of_code; ?></code> <p><code><?php echo $piece_of_code; ?></code>
</p> </p>
<p><strong>Image Details</strong>: <br /> <p><strong><?php _e('Image Details') ?></strong>: <br />
Name: Name:
<?php echo $img1_name; ?> <?php echo $img1_name; ?>
<br /> <br />
Size: <?php _e('Size:') ?>
<?php echo round($img1_size / 1024, 2); ?> <abbr title="Kilobyte">KB</abbr><br /> <?php echo round($img1_size / 1024, 2); ?> <?php _e('<abbr title="Kilobyte">KB</abbr>') ?><br />
Type: <?php _e('Type:') ?>
<?php echo $img1_type; ?> <?php echo $img1_type; ?>
</p> </p>
</div> </div>
<p><a href="upload.php">Upload another</a>.</p> <p><a href="upload.php"><?php _e('Upload another') ?></a></p>
<?php <?php
break; break;
} }