1
0
mirror of https://gitlab.com/JKANetwork/jka-toolkit.git synced 2026-02-27 07:23:48 +01:00

jkazip finished, spanish translation too

This commit is contained in:
JoseluCross
2016-06-17 11:03:56 +02:00
parent a32130cff7
commit 792e2fa440
4 changed files with 119 additions and 175 deletions

Binary file not shown.

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-09 15:19+0200\n" "POT-Creation-Date: 2016-06-17 10:55+0200\n"
"PO-Revision-Date: 2016-06-09 15:22+0200\n" "PO-Revision-Date: 2016-06-17 11:02+0200\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -18,128 +18,94 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: es\n" "Language: es\n"
#: jkazip:23 jkazip:29 jkazip:35 jkazip:41 jkazip:47 jkazip:54 jkazip:60 #: jkazip:16
#: jkazip:66 jkazip:72 jkazip:78 jkazip:84 jkazip:90 jkazip:96 jkazip:102 msgid "File extension haven't been specified"
msgid "%s has been decompressed" msgstr "La extensión del archivo no ha sido especificada"
msgstr "%s se ha descomprimido"
#: jkazip:106 jkazip:269 #: jkazip:33
msgid "Format %s unknown" msgid "File/s %s has/have been compressed in %s"
msgstr "Formato %s desconocido" msgstr "El/Los archivo/s %s ha/n sido comprimidos en %s"
#: jkazip:112 #: jkazip:39
msgid "File %s has been decompressed"
msgstr "El archivo %s ha sido descomprimido"
#: jkazip:45
msgid "No option specified, use jkazip -h" msgid "No option specified, use jkazip -h"
msgstr "Ninguna opción especificada, use jkazip -h" msgstr "Ninguna opción especificada, use jkazip -h"
#: jkazip:114 #: jkazip:47
msgid "\tsynopsis:\tjkazip <options> <file or directory>" msgid "\tsynopsis:\tjkazip <options> <file or directory>"
msgstr "\tsinopsis:\tjkazip <opciones> <archivo o directorio>" msgstr "\tsinopsis:\tjkazip <opciones> <archivo o directorio>"
#: jkazip:116 #: jkazip:49
msgid "\t-d,\t\tdecompress file" msgid "\t-d,\t\tdecompress file"
msgstr "\t-d,\t\tdescomprimir archivo" msgstr "\t-d,\t\tdescomprimir archivo"
#: jkazip:117 #: jkazip:50
msgid "" msgid "\t-c <output file>,\tcompress file"
"\t-f <format>,\tspecified format whe decompress, necessary only when the " msgstr "\t-c <salida>,\tcomprimir archivo"
"name have more than one point before the file extension"
msgstr ""
"\t-f <formato>,\tespecifica el formato cuando descomprime, necesario solo "
"cuando el nombre tiene más de un punto antes de la extensión del archivo"
#: jkazip:118 #: jkazip:51
msgid "\t-c <format>,\tcompress file"
msgstr "\t-c <formato>,\tcomprimir archivo"
#: jkazip:119
msgid "\t-h,\t\tshow help box and exit" msgid "\t-h,\t\tshow help box and exit"
msgstr "\t-h,\t\tmuestra la ayuda y termina" msgstr "\t-h,\t\tmuestra la ayuda y termina"
#: jkazip:120 #: jkazip:52
msgid "\t-v,\t\tshow version" msgid "\t-v,\t\tshow version and exit"
msgstr "\t-v,\t\tmuestra la versión" msgstr "\t-v,\t\tmuestra la versión y termina"
#: jkazip:122 #: jkazip:54
msgid "" msgid ""
"\tThe order must be \"jkazip -d [-f format] <file or directory>\" or " "\tThe order must be \"jkazip -d <file>\" or \"jkazip -c <output> <files or "
"\"jkazip -c <format> <file or directory\"" "directories>\""
msgstr "" msgstr ""
"\tEl orden debe ser \"jkazip -d [-f formato] <archivo o directorio>\" o " "\tEl orden debe ser \"jkazip -d <archivo>\" o \"jkazip -c <salida> "
"\"jkazip -c <formato> <archivo o directorio>\"" "<archivos o directorios>\""
#: jkazip:124 #: jkazip:56
msgid "\tExamples" msgid "\tExamples"
msgstr "\tEjemplos" msgstr "\tEjemplos"
#: jkazip:125 #: jkazip:57
msgid "\tjkazip -d -f \"tar.gz\" file.txt.tar.gz"
msgstr "\tjkazip -d -f \"tar.gz\" archivo.txt.tar.gz"
#: jkazip:126
msgid "\tjkazip -d file.7z" msgid "\tjkazip -d file.7z"
msgstr "\tjkazip -d archivo.7z" msgstr "\tjkazip -d archivo.7z"
#: jkazip:127 #: jkazip:58
msgid "\tjkazip -c \"tar.xz\" directory" msgid "\tjkazip -c ouputfile.tar.gz directory"
msgstr "\tjkazip -c \"tar.xz\" directorio" msgstr "\tjkazip -c salida.tar.gz directorio"
#: jkazip:129 #: jkazip:60
msgid "\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, zip and rar"
msgstr "\tFormatos soportados: tar, gzip, bzip2, xzip, lzip, 7z, zip y rar"
#: jkazip:130
msgid "" msgid ""
"\tOnly one file or directory (some formats don't support directories), for " "\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and "
"more options use the each program individualy" "zip"
msgstr "" msgstr ""
"\tSolo un fichero o directorio (algunos formatos no soportan directorios), " "\tFormatos soportados: tar, gzip, bzip2, xzip, lzip, 7z, rar (solo "
"para mas opciones usar cada programa individualmente" "descomprimir) y zip"
#: jkazip:133 #: jkazip:63
msgid "jkazip by JKA Network; version %s" msgid "jkazip by JKA Network; version %s"
msgstr "jkazip por JKA Network; versión %s" msgstr "jkazip por JKA Network; versión %s"
#: jkazip:137 jkazip:167 #: jkazip:67 jkazip:118
msgid "No file or directory specified" msgid "No file or directory specified"
msgstr "Ningún archivo o directorio especificado" msgstr "Ningún archivo o directorio especificado"
#: jkazip:143 jkazip:156 #: jkazip:70
msgid "File %s will be decompressed" msgid "File %s will be decompressed"
msgstr "El archivo %s será descomprimido" msgstr "El archivo %s será descomprimido"
#: jkazip:145 jkazip:176 #: jkazip:73 jkazip:125
msgid "%s no such file or directory" msgid "%s no such file or directory"
msgstr "%s no existe el archivo o el directorio" msgstr "%s no existe el archivo o el directorio"
#: jkazip:153 #: jkazip:110 jkazip:168
msgid "Directory %s will be decompressed" msgid "File extension %s are not supported"
msgstr "El directorio %s será descomprimido" msgstr "La extensión de archivo %s no está soportada"
#: jkazip:159 #: jkazip:165
msgid "%s no sush a file or directory" msgid "rar compression are not supported"
msgstr "%s no existe el archivo o el directorio"
#: jkazip:170
msgid "The directory %s will be compressed"
msgstr "El directorio %s será comprimido"
#: jkazip:173
msgid "The file %s will be compressed"
msgstr "El archivo %s será comprimido"
#: jkazip:181
msgid "No format specified"
msgstr "Ningún formato especificado"
#: jkazip:185 jkazip:191 jkazip:197 jkazip:203 jkazip:209 jkazip:215 jkazip:221
#: jkazip:227 jkazip:233 jkazip:239 jkazip:245 jkazip:251 jkazip:257 jkazip:263
msgid "%s has been compressed"
msgstr "%s ha sido comprimido"
#: jkazip:267
msgid "Format rar are not supported for compression"
msgstr "El formato rar no está soportado para la compresión" msgstr "El formato rar no está soportado para la compresión"
#: jkazip:273 #: jkazip:173
msgid "Unknown option" msgid "Unknown option"
msgstr "Opción desconocida" msgstr "Opción desconocida"

View File

@@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-09 15:19+0200\n" "POT-Creation-Date: 2016-06-17 11:01+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,122 +17,90 @@ msgstr ""
"Content-Type: text/plain; charset=CHARSET\n" "Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: jkazip:23 jkazip:29 jkazip:35 jkazip:41 jkazip:47 jkazip:54 jkazip:60 #: jkazip:16
#: jkazip:66 jkazip:72 jkazip:78 jkazip:84 jkazip:90 jkazip:96 jkazip:102 msgid "File extension haven't been specified"
msgid "%s has been decompressed"
msgstr "" msgstr ""
#: jkazip:106 jkazip:269 #: jkazip:33
msgid "Format %s unknown" msgid "File/s %s has/have been compressed in %s"
msgstr "" msgstr ""
#: jkazip:112 #: jkazip:39
msgid "File %s has been decompressed"
msgstr ""
#: jkazip:45
msgid "No option specified, use jkazip -h" msgid "No option specified, use jkazip -h"
msgstr "" msgstr ""
#: jkazip:114 #: jkazip:47
msgid "\tsynopsis:\tjkazip <options> <file or directory>" msgid "\tsynopsis:\tjkazip <options> <file or directory>"
msgstr "" msgstr ""
#: jkazip:116 #: jkazip:49
msgid "\t-d,\t\tdecompress file" msgid "\t-d,\t\tdecompress file"
msgstr "" msgstr ""
#: jkazip:117 #: jkazip:50
msgid "" msgid "\t-c <output file>,\tcompress file"
"\t-f <format>,\tspecified format whe decompress, necessary only when the "
"name have more than one point before the file extension"
msgstr "" msgstr ""
#: jkazip:118 #: jkazip:51
msgid "\t-c <format>,\tcompress file"
msgstr ""
#: jkazip:119
msgid "\t-h,\t\tshow help box and exit" msgid "\t-h,\t\tshow help box and exit"
msgstr "" msgstr ""
#: jkazip:120 #: jkazip:52
msgid "\t-v,\t\tshow version" msgid "\t-v,\t\tshow version and exit"
msgstr "" msgstr ""
#: jkazip:122 #: jkazip:54
msgid "" msgid ""
"\tThe order must be \"jkazip -d [-f format] <file or directory>\" or " "\tThe order must be \"jkazip -d <file>\" or \"jkazip -c <output> <files or "
"\"jkazip -c <format> <file or directory\"" "directories>\""
msgstr "" msgstr ""
#: jkazip:124 #: jkazip:56
msgid "\tExamples" msgid "\tExamples"
msgstr "" msgstr ""
#: jkazip:125 #: jkazip:57
msgid "\tjkazip -d -f \"tar.gz\" file.txt.tar.gz"
msgstr ""
#: jkazip:126
msgid "\tjkazip -d file.7z" msgid "\tjkazip -d file.7z"
msgstr "" msgstr ""
#: jkazip:127 #: jkazip:58
msgid "\tjkazip -c \"tar.xz\" directory" msgid "\tjkazip -c ouputfile.tar.gz directory"
msgstr "" msgstr ""
#: jkazip:129 #: jkazip:60
msgid "\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, zip and rar"
msgstr ""
#: jkazip:130
msgid "" msgid ""
"\tOnly one file or directory (some formats don't support directories), for " "\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and "
"more options use the each program individualy" "zip"
msgstr "" msgstr ""
#: jkazip:133 #: jkazip:63
msgid "jkazip by JKA Network; version %s" msgid "jkazip by JKA Network; version %s"
msgstr "" msgstr ""
#: jkazip:137 jkazip:167 #: jkazip:67 jkazip:118
msgid "No file or directory specified" msgid "No file or directory specified"
msgstr "" msgstr ""
#: jkazip:143 jkazip:156 #: jkazip:70
msgid "File %s will be decompressed" msgid "File %s will be decompressed"
msgstr "" msgstr ""
#: jkazip:145 jkazip:176 #: jkazip:73 jkazip:125
msgid "%s no such file or directory" msgid "%s no such file or directory"
msgstr "" msgstr ""
#: jkazip:153 #: jkazip:110 jkazip:168
msgid "Directory %s will be decompressed" msgid "File extension %s are not supported"
msgstr "" msgstr ""
#: jkazip:159 #: jkazip:165
msgid "%s no sush a file or directory" msgid "rar compression are not supported"
msgstr ""
#: jkazip:170
msgid "The directory %s will be compressed"
msgstr "" msgstr ""
#: jkazip:173 #: jkazip:173
msgid "The file %s will be compressed"
msgstr ""
#: jkazip:181
msgid "No format specified"
msgstr ""
#: jkazip:185 jkazip:191 jkazip:197 jkazip:203 jkazip:209 jkazip:215 jkazip:221
#: jkazip:227 jkazip:233 jkazip:239 jkazip:245 jkazip:251 jkazip:257 jkazip:263
msgid "%s has been compressed"
msgstr ""
#: jkazip:267
msgid "Format rar are not supported for compression"
msgstr ""
#: jkazip:273
msgid "Unknown option" msgid "Unknown option"
msgstr "" msgstr ""

View File

@@ -5,13 +5,18 @@
#Function decompress(); decompress the file whith the format especified #Function decompress(); decompress the file whith the format especified
# gettext initialization # gettext initialization
#export TEXTDOMAIN='jkazip' export TEXTDOMAIN='jkazip'
#peroexport TEXTDOMAINDIR='/usr/share/locale' export TEXTDOMAINDIR='/usr/share/locale'
#function sacaFormato, get the file extension to zip or unzip #function sacaFormato, get the file extension to zip or unzip
function sacaFormato() { function sacaFormato() {
local var=$1 local var=$1
cant=$(echo $var | grep -o "\." | wc -l) cant=$(echo $var | grep -o "\." | wc -l)
if [ $cant -eq 0 ];then
echo "$(gettext "File extension haven't been specified")" > /dev/stderr
echo > /dev/stderr
exit
fi
fieldPost=$(expr $cant + 1) fieldPost=$(expr $cant + 1)
postform=$(echo $var | cut -f$fieldPost -d".") postform=$(echo $var | cut -f$fieldPost -d".")
preform=$(echo $var | cut -f$cant -d".") preform=$(echo $var | cut -f$cant -d".")
@@ -24,46 +29,48 @@ function sacaFormato() {
#Function msg, print in stdout a final message #Function msg, print in stdout a final message
function msg() { function msg() {
local var=$1 local var=$1
printf -- "$(gettext "File/s %s has/have been compressed")" $var local var2=$2
printf -- "$(gettext "File/s %s has/have been compressed in %s")" $var $var2
echo
} }
#Function msg2, print in stdout a final message #Function msg2, print in stdout a final message
function msg() { function msg2() {
local var=$1 local var=$1
printf -- "$(gettext "File has been decompressed")" $var printf -- "$(gettext "File %s has been decompressed")" $var
echo
} }
version="1.1.0" version="2.0.2"
if [ -z $1 ];then if [ -z $1 ];then
error "$(gettext "No option specified, use jkazip -h")" echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr
elif [ $1 = "-h" ];then elif [ $1 = "-h" ];then
echo "$(gettext " synopsis: jkazip <options> <file or directory>")" echo "$(gettext " synopsis: jkazip <options> <file or directory>")"
echo "" echo ""
echo "$(gettext " -d, decompress file")" echo "$(gettext " -d, decompress file")"
echo "$(gettext " -c <output file> <input file>, compress file")" echo "$(gettext " -c <output file>, compress file")"
echo "$(gettext " -h, show help box and exit")" echo "$(gettext " -h, show help box and exit")"
echo "$(gettext " -v, show version and exit")" echo "$(gettext " -v, show version and exit")"
echo "" echo ""
echo "$(gettext " The order must be \"jkazip -d <file or directory>\" or \"jkazip -c <format> <file or directory\"")" echo "$(gettext " The order must be \"jkazip -d <file>\" or \"jkazip -c <output> <files or directories>\"")"
echo "" echo ""
echo "$(gettext " Examples")" echo "$(gettext " Examples")"
echo "$(gettext " jkazip -d file.7z")" echo "$(gettext " jkazip -d file.7z")"
echo "$(gettext " jkazip -c ouputfile.tar.gz directory")" echo "$(gettext " jkazip -c ouputfile.tar.gz directory")"
echo "" echo ""
echo "$(gettext " Supported formats: tar, gzip, bzip2, xzip, lzip, 7z, zip and rar")" echo "$(gettext " Supported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and zip")"
echo "$(gettext " Only one file or directory (some formats don't support directories), for more options use the each program individualy")"
echo "" echo ""
elif [ $1 = "-v" ];then elif [ $1 = "-v" ];then
printf -- "$(gettext "jkazip by JKA Network; version %s")" "$version" printf -- "$(gettext "jkazip by JKA Network; version %s")" "$version"
echo echo
elif [ $1 = "-d" ];then elif [ $1 = "-d" ];then
if [ -z $2 ];then if [ -z $2 ];then
error "$(gettext "No file or directory specified")" echo "$(gettext "No file or directory specified")" > /dev/stderr
exit exit
elif [ -f $2 ];then elif [ -f $2 ];then
printf -- "$(gettext "File %s will be decompressed")" "$2" printf -- "$(gettext "File %s will be decompressed")" "$2"
echo echo
else else
error "$(gettext "%s no such file or directory")" "$2" echo "$(gettext "%s no such file or directory")" "$2" > /dev/stderr
echo echo
exit exit
fi fi
@@ -89,17 +96,19 @@ elif [ $1 = "-d" ];then
;; ;;
"xz") "xz")
$formato -dk $entrada $formato -dk $entrada
msg $entrada msg2 $entrada
;; ;;
"bz2") "bz2")
bzip2 -dk $entrada bzip2 -dk $entrada
msg $entrada msg2 $entrada
;; ;;
"rar") "rar")
unrar x $entrada unrar x $entrada
msg2 $entrada
;; ;;
*) *)
error "$(gettext "File extension %s are not supported")" $formato printf -- "$(gettext "File extension %s are not supported")" $formato > /dev/stderr
echo > /dev/stderr
;; ;;
esac esac
@@ -113,7 +122,7 @@ elif [ $1 = "-c" ];then
do do
if [[ $i != $1 && $i != $2 ]];then if [[ $i != $1 && $i != $2 ]];then
if [ ! -d $i -a ! -f $i ];then if [ ! -d $i -a ! -f $i ];then
printf -- "$(gettext "%s no such file or directory")" "$3" printf -- "$(gettext "%s no such file or directory")" "$i"
echo echo
exit exit
fi fi
@@ -129,36 +138,37 @@ elif [ $1 = "-c" ];then
case $formato in case $formato in
"tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz") "tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz")
tar cvfa $salida $files tar cvfa $salida $files
msg $files msg $files $salida
;; ;;
"7z") "7z")
7z a $salida $files 7z a $salida $files
msg $files msg $files $salida
;; ;;
"zip") "zip")
zip $salida $files zip $salida $files
msg $files msg $files $salida
;; ;;
"gz" | "lz") "gz" | "lz")
formato="${formato}ip" formato="${formato}ip"
$formato -9kc $3 > $salida $formato -9kc $3 > $salida
msg $3 msg $3 $salida
;; ;;
"xz") "xz")
$formato -9kc $3 > $salida $formato -9kc $3 > $salida
msg $3 msg $3 $salida
;; ;;
"bz2") "bz2")
$formato -9kc $3 > $salida $formato -9kc $3 > $salida
msg $3 msg $3 $salida
;; ;;
"rar") "rar")
error "$(gettext "rar compression are not supported")" echo "$(gettext "rar compression are not supported")" > /dev/stderr
;; ;;
*) *)
error "$(gettext "File extension %s are not supported")" $formato printf -- "$(gettext "File extension %s are not supported")" $formato > /dev/stderr
echo > /dev/stderr
;; ;;
esac esac
else else
echo "$(gettext "Unknown option")" echo "$(gettext "Unknown option")" > /dev/stderr
fi fi