From 9b5d2718ab0b7d9e0802e07d9773d7afa8675b41 Mon Sep 17 00:00:00 2001 From: Roni <54395471+Roni-Neto@users.noreply.github.com> Date: Mon, 17 May 2021 03:25:47 -0300 Subject: [PATCH] New translations (#537) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New translations Novas Traduções --- tinyfilemanager.php | 136 ++++++++++++++++++++++++++------------------ 1 file changed, 82 insertions(+), 54 deletions(-) diff --git a/tinyfilemanager.php b/tinyfilemanager.php index dbada7c2..811fda31 100644 --- a/tinyfilemanager.php +++ b/tinyfilemanager.php @@ -259,7 +259,7 @@ function session_error_handling_function($code, $msg, $file, $line) { trigger_error('User connection denied from: ' . $clientIp, E_USER_WARNING); if($ip_silent == false){ - fm_set_msg('Access denied. IP restriction applicable', 'error'); + fm_set_msg(lng('Access denied. IP restriction applicable'), 'error'); fm_show_header_login(); fm_show_message(); } @@ -360,7 +360,7 @@ function session_error_handling_function($code, $msg, $file, $line) { $root_path = rtrim($root_path, '\\/'); $root_path = str_replace('\\', '/', $root_path); if (!@is_dir($root_path)) { - echo "

Root path \"{$root_path}\" not found!

"; + echo "

".lang('Root path')." \"{$root_path}\" ".lang('not found!')."

"; exit; } @@ -420,7 +420,7 @@ function session_error_handling_function($code, $msg, $file, $line) { $file = fm_clean_path($file); $file = str_replace('/', '', $file); if ($file == '' || !is_file($path . '/' . $file)) { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } header('X-XSS-Protection:0'); @@ -623,14 +623,14 @@ function get_file_path () { } $is_dir = is_dir($path . '/' . $del); if (fm_rdelete($path . '/' . $del)) { - $msg = $is_dir ? 'Folder %s deleted' : 'File %s deleted'; + $msg = $is_dir ? lng('Folder').' %s '.lng('Deleted') : lng('File').' %s '.lng('Deleted'); fm_set_msg(sprintf($msg, fm_enc($del))); } else { - $msg = $is_dir ? 'Folder %s not deleted' : 'File %s not deleted'; + $msg = $is_dir ? lng('Folder').' %s '.lng('not deleted') : lng('File').' %s '.lng('not deleted'); fm_set_msg(sprintf($msg, fm_enc($del)), 'error'); } } else { - fm_set_msg('Invalid file or folder name', 'error'); + fm_set_msg(lng('Invalid file or folder name'), 'error'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -650,22 +650,22 @@ function get_file_path () { @fopen($path . '/' . $new, 'w') or die('Cannot open file: ' . $new); fm_set_msg(sprintf(lng('File').' %s '.lng('Created'), fm_enc($new))); } else { - fm_set_msg('File extension is not allowed', 'error'); + fm_set_msg(lng('File extension is not allowed'), 'error'); } } else { - fm_set_msg(sprintf('File %s already exists', fm_enc($new)), 'alert'); + fm_set_msg(sprintf(lng('File').' %s '.lng('already exists'), fm_enc($new)), 'alert'); } } else { if (fm_mkdir($path . '/' . $new, false) === true) { fm_set_msg(sprintf(lng('Folder').' %s '.lng('Created'), $new)); } elseif (fm_mkdir($path . '/' . $new, false) === $path . '/' . $new) { - fm_set_msg(sprintf('Folder %s already exists', fm_enc($new)), 'alert'); + fm_set_msg(sprintf(lng('Folder').' %s '.lng('already exists'), fm_enc($new)), 'alert'); } else { - fm_set_msg(sprintf('Folder %s not created', fm_enc($new)), 'error'); + fm_set_msg(sprintf(lng('Folder').' %s '.lng('not created'), fm_enc($new)), 'error'); } } } else { - fm_set_msg('Invalid characters in file or folder name', 'error'); + fm_set_msg(lng('Invalid characters in file or folder name'), 'error'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -677,7 +677,7 @@ function get_file_path () { $copy = fm_clean_path($copy); // empty path if ($copy == '') { - fm_set_msg('Source path not defined', 'error'); + fm_set_msg(lng('Source path not defined'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } // abs path from @@ -696,18 +696,17 @@ function get_file_path () { if ($move) { // Move and to != from so just perform move $rename = fm_rename($from, $dest); if ($rename) { - fm_set_msg(sprintf('Moved from %s to %s', fm_enc($copy), fm_enc($msg_from))); + fm_set_msg(sprintf(lng('Moved from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from))); } elseif ($rename === null) { - fm_set_msg('File or folder with this path already exists', 'alert'); - + fm_set_msg(lng('File or folder with this path already exists'), 'alert'); } else { - fm_set_msg(sprintf('Error while moving from %s to %s', fm_enc($copy), fm_enc($msg_from)), 'error'); + fm_set_msg(sprintf(lng('Error while moving from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from)), 'error'); } } else { // Not move and to != from so copy with original name if (fm_rcopy($from, $dest)) { - fm_set_msg(sprintf('Copied from %s to %s', fm_enc($copy), fm_enc($msg_from))); + fm_set_msg(sprintf(lng('Copied from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from))); } else { - fm_set_msg(sprintf('Error while copying from %s to %s', fm_enc($copy), fm_enc($msg_from)), 'error'); + fm_set_msg(sprintf(lng('Error while copying from').' %s '.lng('to').' %s', fm_enc($copy), fm_enc($msg_from)), 'error'); } } } else { @@ -735,7 +734,7 @@ function get_file_path () { } } else{ - fm_set_msg('Paths must be not equal', 'alert'); + fm_set_msg(lng('Paths must be not equal'), 'alert'); } } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); @@ -755,7 +754,7 @@ function get_file_path () { $copy_to_path .= '/' . $copy_to; } if ($path == $copy_to_path) { - fm_set_msg('Paths must be not equal', 'alert'); + fm_set_msg(lng('Paths must be not equal'), 'alert'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } if (!is_dir($copy_to_path)) { @@ -797,7 +796,7 @@ function get_file_path () { fm_set_msg($msg, 'error'); } } else { - fm_set_msg('Nothing selected', 'alert'); + fm_set_msg(lng('Nothing selected'), 'alert'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -820,12 +819,12 @@ function get_file_path () { // rename if (fm_isvalid_filename($new) && $old != '' && $new != '') { if (fm_rename($path . '/' . $old, $path . '/' . $new)) { - fm_set_msg(sprintf('Renamed from %s to %s', fm_enc($old), fm_enc($new))); + fm_set_msg(sprintf(lng('Renamed from').' %s '. lng('to').' %s', fm_enc($old), fm_enc($new))); } else { - fm_set_msg(sprintf('Error while renaming from %s to %s', fm_enc($old), fm_enc($new)), 'error'); + fm_set_msg(sprintf(lng('Error while renaming from').' %s '. lng('to').' %s', fm_enc($old), fm_enc($new)), 'error'); } } else { - fm_set_msg('Invalid characters in file name', 'error'); + fm_set_msg(lng('Invalid characters in file name'), 'error'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -843,7 +842,7 @@ function get_file_path () { fm_download_file($path . '/' . $dl, $dl, 1024); exit; } else { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } } @@ -946,12 +945,12 @@ function get_file_path () { } } if ($errors == 0) { - fm_set_msg('Selected files and folder deleted'); + fm_set_msg(lng('Selected files and folder deleted')); } else { - fm_set_msg('Error while deleting items', 'error'); + fm_set_msg(lng('Error while deleting items'), 'error'); } } else { - fm_set_msg('Nothing selected', 'alert'); + fm_set_msg(lng('Nothing selected'), 'alert'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); @@ -970,7 +969,7 @@ function get_file_path () { if (($ext == "zip" && !class_exists('ZipArchive')) || ($ext == "tar" && !class_exists('PharData'))) { - fm_set_msg('Operations with archives are not available', 'error'); + fm_set_msg(lng('Operations with archives are not available'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -995,12 +994,12 @@ function get_file_path () { } if ($res) { - fm_set_msg(sprintf('Archive %s created', fm_enc($zipname))); + fm_set_msg(sprintf(lng('Archive').' %s '.lng('Created'), fm_enc($zipname))); } else { - fm_set_msg('Archive not created', 'error'); + fm_set_msg(lng('Archive not created'), 'error'); } } else { - fm_set_msg('Nothing selected', 'alert'); + fm_set_msg(lng('Nothing selected'), 'alert'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); @@ -1023,12 +1022,12 @@ function get_file_path () { $ext = pathinfo($zip_path, PATHINFO_EXTENSION); $isValid = true; } else { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); } if (($ext == "zip" && !class_exists('ZipArchive')) || ($ext == "tar" && !class_exists('PharData'))) { - fm_set_msg('Operations with archives are not available', 'error'); + fm_set_msg(lng('Operations with archives are not available'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -1060,13 +1059,13 @@ function get_file_path () { } if ($res) { - fm_set_msg('Archive unpacked'); + fm_set_msg(lng('Archive unpacked')); } else { - fm_set_msg('Archive not unpacked', 'error'); + fm_set_msg(lng('Archive not unpacked'), 'error'); } } else { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -1082,7 +1081,7 @@ function get_file_path () { $file = fm_clean_path($file); $file = str_replace('/', '', $file); if ($file == '' || (!is_file($path . '/' . $file) && !is_dir($path . '/' . $file))) { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -1116,9 +1115,9 @@ function get_file_path () { } if (@chmod($path . '/' . $file, $mode)) { - fm_set_msg('Permissions changed'); + fm_set_msg(lng('Permissions changed')); } else { - fm_set_msg('Permissions not changed', 'error'); + fm_set_msg(lng('Permissions not changed'), 'error'); } fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); @@ -1256,7 +1255,7 @@ function getUploadExt() { if (isset($_POST['copy']) && !FM_READONLY) { $copy_files = isset($_POST['file']) ? $_POST['file'] : null; if (!is_array($copy_files) || empty($copy_files)) { - fm_set_msg('Nothing selected', 'alert'); + fm_set_msg(lng('Nothing selected'), 'alert'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -1301,7 +1300,7 @@ function getUploadExt() { $copy = $_GET['copy']; $copy = fm_clean_path($copy); if ($copy == '' || !file_exists(FM_ROOT_PATH . '/' . $copy)) { - fm_set_msg('File not found', 'error'); + fm_set_msg(lng('File not found'), 'error'); fm_redirect(FM_SELF_URL . '?p=' . urlencode(FM_PATH)); } @@ -1319,7 +1318,7 @@ function getUploadExt() { Move   Cancel

-

Select folder

+