Make WordPress Core

Changeset 2936


Ignore:
Timestamp:
10/06/2005 12:44:04 AM (18 years ago)
Author:
ryan
Message:

Start marking strings for translation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/image-uploading.php

    r2929 r2936  
    44
    55if (!current_user_can('edit_posts'))
    6     die('You do not have permission to edit posts.');
     6    die(__('You do not have permission to edit posts.'));
    77
    88$wpvarstoreset = array('action', 'post', 'all', 'last', 'link', 'sort', 'start', 'imgtitle', 'descr', 'object');
     
    5050// Define the error messages for bad uploads.
    5151$upload_err = array(false,
    52     "The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>.",
    53     "The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form.",
    54     "The uploaded file was only partially uploaded.",
    55     "No file was uploaded.",
    56     "Missing a temporary folder.",
    57     "Failed to write file to disk.");
     52    __("The uploaded file exceeds the <code>upload_max_filesize</code> directive in <code>php.ini</code>."),
     53    __("The uploaded file exceeds the <em>MAX_FILE_SIZE</em> directive that was specified in the HTML form."),
     54    __("The uploaded file was only partially uploaded."),
     55    __("No file was uploaded."),
     56    __("Missing a temporary folder."),
     57    __("Failed to write file to disk."));
    5858
    5959$iuerror = false;
     
    6363// A correct form post will pass this test.
    6464if ( !isset($_POST['action']) || $_POST['action'] != 'save' || count($_FILES) != 1 || ! isset($_FILES['image']) || is_array($_FILES['image']['name']) )
    65     $error = 'Invalid form submission. Only submit approved forms.';
     65    $error = __('Invalid form submission. Only submit approved forms.');
    6666
    6767// A successful upload will pass this test.
     
    7171// A non-empty file will pass this test.
    7272elseif ( 0 == $_FILES['image']['size'] )
    73     $error = 'File is empty. Please upload something more substantial.';
     73    $error = __('File is empty. Please upload something more substantial.');
    7474
    7575// A correct MIME category will pass this test. Full types are not consistent across browsers.
    7676elseif ( ! 'image/' == substr($_FILES['image']['type'], 0, 6) )
    77     $error = 'Bad MIME type submitted by your browser.';
     77    $error = __('Bad MIME type submitted by your browser.');
    7878
    7979// An acceptable file extension will pass this test.
    8080elseif ( ! ( ( 0 !== preg_match('#\.?([^\.]*)$#', $_FILES['image']['name'], $matches) ) && ( $ext = strtolower($matches[1]) ) && array_key_exists($ext, $exts) ) )
    81     $error = 'Bad file extension.';
     81    $error = __('Bad file extension.');
    8282
    8383// A valid uploaded file will pass this test.
    8484elseif ( ! is_uploaded_file($_FILES['image']['tmp_name']) )
    85     $error = 'Bad temp file. Try renaming the file and uploading again.';
     85    $error = __('Bad temp file. Try renaming the file and uploading again.');
    8686
    8787// A valid image file will pass this test.
    8888elseif ( function_exists('exif_imagetype') && $exts[$ext] != $imagetype = exif_imagetype($_FILES['image']['tmp_name']) )
    89     $error = 'Bad image file. Try again, or try recreating it.';
     89    $error = __('Bad image file. Try again, or try recreating it.');
    9090
    9191// An image with at least one pixel will pass this test.
    9292elseif ( ! ( ( $imagesize = getimagesize($_FILES['image']['tmp_name']) ) && $imagesize[0] > 1 && $imagesize[1] > 1 ) )
    93     $error = 'The image has no pixels. Isn\'t that odd?';
     93    $error = __('The image has no pixels. Isn\'t that odd?');
    9494
    9595// A writable uploads dir will pass this test.
Note: See TracChangeset for help on using the changeset viewer.