From b81424c18b3b63fe8eaefee0bee5147a954dd7b6 Mon Sep 17 00:00:00 2001
From: Roni <54395471+Roni-Neto@users.noreply.github.com>
Date: Mon, 3 May 2021 19:57:15 -0300
Subject: [PATCH] New translations
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 60dfad1..bd49c6b 100644
--- a/tinyfilemanager.php
+++ b/tinyfilemanager.php
@@ -260,7 +260,7 @@ if($ip_ruleset != 'OFF'){
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();
}
@@ -361,7 +361,7 @@ if ($use_auth && isset($_SESSION[FM_SESSION_ID]['logged'])) {
$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;
}
@@ -421,7 +421,7 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
$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');
@@ -619,14 +619,14 @@ if (isset($_GET['del']) && !FM_READONLY) {
}
$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));
}
@@ -646,22 +646,22 @@ if (isset($_GET['new']) && isset($_GET['type']) && !FM_READONLY) {
@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));
}
@@ -673,7 +673,7 @@ if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) {
$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
@@ -692,18 +692,17 @@ if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) {
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 {
@@ -731,7 +730,7 @@ if (isset($_GET['copy'], $_GET['finish']) && !FM_READONLY) {
}
}
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));
@@ -751,7 +750,7 @@ if (isset($_POST['file'], $_POST['copy_to'], $_POST['finish']) && !FM_READONLY)
$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)) {
@@ -793,7 +792,7 @@ if (isset($_POST['file'], $_POST['copy_to'], $_POST['finish']) && !FM_READONLY)
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));
}
@@ -816,12 +815,12 @@ if (isset($_GET['ren'], $_GET['to']) && !FM_READONLY) {
// 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));
}
@@ -839,7 +838,7 @@ if (isset($_GET['dl'])) {
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));
}
}
@@ -942,12 +941,12 @@ if (isset($_POST['group'], $_POST['delete']) && !FM_READONLY) {
}
}
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));
@@ -966,7 +965,7 @@ if (isset($_POST['group']) && (isset($_POST['zip']) || isset($_POST['tar'])) &&
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));
}
@@ -991,12 +990,12 @@ if (isset($_POST['group']) && (isset($_POST['zip']) || isset($_POST['tar'])) &&
}
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));
@@ -1019,12 +1018,12 @@ if (isset($_GET['unzip']) && !FM_READONLY) {
$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));
}
@@ -1056,13 +1055,13 @@ if (isset($_GET['unzip']) && !FM_READONLY) {
}
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));
}
@@ -1078,7 +1077,7 @@ if (isset($_POST['chmod']) && !FM_READONLY && !FM_IS_WIN) {
$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));
}
@@ -1112,9 +1111,9 @@ if (isset($_POST['chmod']) && !FM_READONLY && !FM_IS_WIN) {
}
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));
@@ -1252,7 +1251,7 @@ if (isset($_GET['upload']) && !FM_READONLY) {
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));
}
@@ -1297,7 +1296,7 @@ if (isset($_GET['copy']) && !isset($_GET['finish']) && !FM_READONLY) {
$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));
}
@@ -1315,7 +1314,7 @@ if (isset($_GET['copy']) && !isset($_GET['finish']) && !FM_READONLY) {
Move
Cancel
- Select folder
+
';
} else {
- echo 'Error while fetching archive info
';
+ echo ''.lng('Error while fetching archive info').'
';
}
} elseif ($is_image) {
// Image content
@@ -1708,7 +1707,7 @@ if (isset($_GET['edit'])) {
$file = fm_clean_path($file, false);
$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');
@@ -1732,7 +1731,7 @@ if (isset($_GET['edit'])) {
$fd = fopen($file_path, "w");
@fwrite($fd, $writedata);
fclose($fd);
- fm_set_msg('File Saved Successfully');
+ fm_set_msg(lng('File Saved Successfully'));
}
$ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
@@ -1788,7 +1787,7 @@ if (isset($_GET['edit'])) {
} elseif ($is_text) {
echo '' . htmlspecialchars($content) . '
';
} else {
- fm_set_msg('FILE EXTENSION HAS NOT SUPPORTED', 'error');
+ fm_set_msg(lng('FILE EXTENSION HAS NOT SUPPORTED'), 'error');
}
?>
@@ -1803,7 +1802,7 @@ if (isset($_GET['chmod']) && !FM_READONLY && !FM_IS_WIN) {
$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));
}
@@ -2079,11 +2078,11 @@ $tableTheme = (FM_THEME == "dark") ? "text-white bg-dark table-dark" : "bg-white
-
-
-
- -
+
-
- -
+
-
- -
+
-
-
@@ -3343,7 +3342,7 @@ function fm_show_nav_path($path)
@@ -3684,7 +3683,7 @@ $isStickyNavBar = $sticky_navbar ? 'navbar-fixed' : 'navbar-normal';
@@ -4015,6 +4014,35 @@ function lng($txt) {
$tr['en']['Check Latest Version'] = 'Check Latest Version';$tr['en']['Generate new password hash'] = 'Generate new password hash';
$tr['en']['Login failed. Invalid username or password'] = 'Login failed. Invalid username or password';
$tr['en']['password_hash not supported, Upgrade PHP version'] = 'password_hash not supported, Upgrade PHP version';
+
+ // new - novos
+
+ $tr['en']['Advanced Search'] = 'Advanced Search'; $tr['en']['Error while copying fro'] = 'Error while copying fro';
+ $tr['en']['Nothing selected'] = 'Nothing selected'; $tr['en']['Paths must be not equal'] = 'Paths must be not equal';
+ $tr['en']['Renamed from'] = 'Renamed from'; $tr['en']['Archive not unpacked'] = 'Archive not unpacked';
+ $tr['en']['Deleted'] = 'Deleted'; $tr['en']['Archive not created'] = 'Archive not created';
+ $tr['en']['Copied from'] = 'Copied from'; $tr['en']['Permissions changed'] = 'Permissions changed';
+ $tr['en']['to'] = 'to'; $tr['en']['Saved Successfully'] = 'Saved Successfully';
+ $tr['en']['not found!'] = 'not found!'; $tr['en']['File Saved Successfully'] = 'File Saved Successfully';
+ $tr['en']['Archive'] = 'Archive'; $tr['en']['Permissions not changed'] = 'Permissions not changed';
+ $tr['en']['Select folder'] = 'Select folder'; $tr['en']['Source path not defined'] = 'Source path not defined';
+ $tr['en']['already exists'] = 'already exists'; $tr['en']['Error while moving from'] = 'Error while moving from';
+ $tr['en']['Create archive?'] = 'Create archive?'; $tr['en']['Invalid file or folder name'] = 'Invalid file or folder name';
+ $tr['en']['Archive unpacked'] = 'Archive unpacked'; $tr['en']['File extension is not allowed'] = 'File extension is not allowed';
+ $tr['en']['Root path'] = 'Root path'; $tr['en']['Error while renaming from'] = 'Error while renaming from';
+ $tr['en']['File not found'] = 'File not found'; $tr['en']['Error while deleting items'] = 'Error while deleting items';
+ $tr['en']['Invalid characters in file name'] = 'Invalid characters in file name';
+ $tr['en']['FILE EXTENSION HAS NOT SUPPORTED'] = 'FILE EXTENSION HAS NOT SUPPORTED';
+ $tr['en']['Selected files and folder deleted'] = 'Selected files and folder deleted';
+ $tr['en']['Error while fetching archive info'] = 'Error while fetching archive info';
+ $tr['en']['Delete selected files and folders?'] = 'Delete selected files and folders?';
+ $tr['en']['Search file in folder and subfolders...'] = 'Search file in folder and subfolders...';
+ $tr['en']['Access denied. IP restriction applicable'] = 'Access denied. IP restriction applicable';
+ $tr['en']['Invalid characters in file or folder name'] = 'Invalid characters in file or folder name';
+ $tr['en']['Operations with archives are not available'] = 'Operations with archives are not available';
+ $tr['en']['File or folder with this path already exists'] = 'File or folder with this path already exists';
+
+ $tr['en']['Moved from'] = 'Moved from';
$i18n = fm_get_translations($tr);
$tr = $i18n ? $i18n : $tr;