From 792e2fa440e7df455e3f151cd3d5ea8055313647 Mon Sep 17 00:00:00 2001 From: JoseluCross Date: Fri, 17 Jun 2016 11:03:56 +0200 Subject: [PATCH] jkazip finished, spanish translation too --- jka-toolkit/i18n/jkazip/es.mo | Bin 3364 -> 0 bytes jka-toolkit/i18n/jkazip/es.po | 128 +++++++++++------------------ jka-toolkit/i18n/jkazip/jkazip.pot | 102 ++++++++--------------- jka-toolkit/jkazip | 64 +++++++++------ 4 files changed, 119 insertions(+), 175 deletions(-) delete mode 100644 jka-toolkit/i18n/jkazip/es.mo diff --git a/jka-toolkit/i18n/jkazip/es.mo b/jka-toolkit/i18n/jkazip/es.mo deleted file mode 100644 index 9381783268e8ceab63ad22e50a6b683716b12e27..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3364 zcma)7OKcoP5bZ$ttoesO1XMAf*vihvHcITQV?#a;N{ACHaUc>xs6Er(ZD+Q7n4Yn{ zRs?4x4uHa)NZcY$kvQbQ#U~D&xB}vm6S={GBd?}sKepFWTD$wUyQ-_Js;gfAxo_`x z0^>D&_v5>Fj}W84dq5svKOn@bz;A%h1Ahd54%`H?{>cZ0*a!R+SOKQMHQ;sN3E;m# z4LrKnpYc8LZOnfL^1i#k!@&Q5F91g#65=J`yFj*o75F+Z2Oa?4DA#`iK7;vhz$)-A zkoERGEX1?Gao{j;4)_MJ31sF=Xn@}WzXbC7egyY2 za0bY6euN*+g9M%c{ssIDI6UOfxd9x-{5FvD_6P7C;6LU3;A1}C8Q?*zFP3;6_$KB* z01p6v0dijc1|9)E@VK`-1?2oJ0S^Jc0J8oqAjkPDkn?a4$nlFOgxJG~fh#FuC?@z} z|KL_J_)d_DB1gCq-X>t8IE($@obz}DU(OQ`q+YyO{1f6SAYAPZzRTyz8T-R^#)ET- z)E2e%G!W(FMRScysyRV$T9ZC_pP+u;%w>Se7W@8KkeimW-9k;{|Brdd}@D>qtY9q+MCGWg>tcivAW!zLxEZKSeA+C+L)N4bpKqH@_A z>gLGRDU)fH8XG#P(h`0rs>O!zu5E1Mw5xY)953@XJHU@w@s>kvI0TAn>6D*}wk-FG%nOXgjo}J*WPo=S zLf0fYKzzDe1yEemam@MMV*Ly!bys20JS@)5HDlL|IOA7vb0ks3#&&DTmq0fnuICGO zr%TlBszU6|ZCUfl>*-aCGVEMWQ*gobs=LqizGSjak*vYuD?S?XM~Tw*Qk%|waDpzV zY|Wubfu|s1MV`ESZE~!<`tvpa~V#4d4m!^@+h6)yyY~g_Uv-5L3 zH^ysYL#M0(hh)KGJHcrg80ByhOKqkpY|7NBZ05@1nP94?mrCQ7RT|8h&_>!c>NK^a zv!ScO`^u&CTrtE=cU5|yfOCjbJnRiKb2Z=>hYDhA=6Yx_Socm zjh57L4Yx5nv=Ha1j03J3FoQ{oshgRYCjWP4#L$5m8Xuj8eII3=lp6xub-USi$XmBG zS6$fDs}>5Lz+G|c+eBR!=e??|u27PSOE$3-=3rKfUg#K5C7;VwquXrURlz1>TT4vY z8rh-N=1tJ3LQ7DRo6LgBGF7a^IKh+o=4}I&xX)W=_ExT3mP&%2Z0C`rHts5IX(LN^ z?^7s>4`xJVZbgCQElB<{dxc|{b=Xv?CAeSqH(VZ(aU(Yt?_1GR_`}3txkT~&^c0!s z6A3R`AR(KCs6Kd~;~Aq+!l#nvWgpMCP+NF1eec6?X*II<&Gv07xPC4!sGf5J9&+IP zE_wHJy#?8q_q-)W=KJ1`z5>}zy+_vrIA5cPI;^sl^vkn%;r))ZpnkoR`h7;h{R2Z_ z#%@Y-Xcf " msgstr "\tsinopsis:\tjkazip " -#: jkazip:116 +#: jkazip:49 msgid "\t-d,\t\tdecompress file" msgstr "\t-d,\t\tdescomprimir archivo" -#: jkazip:117 -msgid "" -"\t-f ,\tspecified format whe decompress, necessary only when the " -"name have more than one point before the file extension" -msgstr "" -"\t-f ,\tespecifica el formato cuando descomprime, necesario solo " -"cuando el nombre tiene más de un punto antes de la extensión del archivo" +#: jkazip:50 +msgid "\t-c ,\tcompress file" +msgstr "\t-c ,\tcomprimir archivo" -#: jkazip:118 -msgid "\t-c ,\tcompress file" -msgstr "\t-c ,\tcomprimir archivo" - -#: jkazip:119 +#: jkazip:51 msgid "\t-h,\t\tshow help box and exit" msgstr "\t-h,\t\tmuestra la ayuda y termina" -#: jkazip:120 -msgid "\t-v,\t\tshow version" -msgstr "\t-v,\t\tmuestra la versión" +#: jkazip:52 +msgid "\t-v,\t\tshow version and exit" +msgstr "\t-v,\t\tmuestra la versión y termina" -#: jkazip:122 +#: jkazip:54 msgid "" -"\tThe order must be \"jkazip -d [-f format] \" or " -"\"jkazip -c \" or \"jkazip -c \"" msgstr "" -"\tEl orden debe ser \"jkazip -d [-f formato] \" o " -"\"jkazip -c \"" +"\tEl orden debe ser \"jkazip -d \" o \"jkazip -c " +"\"" -#: jkazip:124 +#: jkazip:56 msgid "\tExamples" msgstr "\tEjemplos" -#: jkazip:125 -msgid "\tjkazip -d -f \"tar.gz\" file.txt.tar.gz" -msgstr "\tjkazip -d -f \"tar.gz\" archivo.txt.tar.gz" - -#: jkazip:126 +#: jkazip:57 msgid "\tjkazip -d file.7z" msgstr "\tjkazip -d archivo.7z" -#: jkazip:127 -msgid "\tjkazip -c \"tar.xz\" directory" -msgstr "\tjkazip -c \"tar.xz\" directorio" +#: jkazip:58 +msgid "\tjkazip -c ouputfile.tar.gz directory" +msgstr "\tjkazip -c salida.tar.gz directorio" -#: jkazip:129 -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 +#: jkazip:60 msgid "" -"\tOnly one file or directory (some formats don't support directories), for " -"more options use the each program individualy" +"\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and " +"zip" msgstr "" -"\tSolo un fichero o directorio (algunos formatos no soportan directorios), " -"para mas opciones usar cada programa individualmente" +"\tFormatos soportados: tar, gzip, bzip2, xzip, lzip, 7z, rar (solo " +"descomprimir) y zip" -#: jkazip:133 +#: jkazip:63 msgid "jkazip by JKA Network; version %s" msgstr "jkazip por JKA Network; versión %s" -#: jkazip:137 jkazip:167 +#: jkazip:67 jkazip:118 msgid "No file or directory specified" msgstr "Ningún archivo o directorio especificado" -#: jkazip:143 jkazip:156 +#: jkazip:70 msgid "File %s will be decompressed" msgstr "El archivo %s será descomprimido" -#: jkazip:145 jkazip:176 +#: jkazip:73 jkazip:125 msgid "%s no such file or directory" msgstr "%s no existe el archivo o el directorio" -#: jkazip:153 -msgid "Directory %s will be decompressed" -msgstr "El directorio %s será descomprimido" +#: jkazip:110 jkazip:168 +msgid "File extension %s are not supported" +msgstr "La extensión de archivo %s no está soportada" -#: jkazip:159 -msgid "%s no sush a file or directory" -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" +#: jkazip:165 +msgid "rar compression are not supported" msgstr "El formato rar no está soportado para la compresión" -#: jkazip:273 +#: jkazip:173 msgid "Unknown option" msgstr "Opción desconocida" diff --git a/jka-toolkit/i18n/jkazip/jkazip.pot b/jka-toolkit/i18n/jkazip/jkazip.pot index 3f6b6e8..49a13ea 100644 --- a/jka-toolkit/i18n/jkazip/jkazip.pot +++ b/jka-toolkit/i18n/jkazip/jkazip.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\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" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,122 +17,90 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: jkazip:23 jkazip:29 jkazip:35 jkazip:41 jkazip:47 jkazip:54 jkazip:60 -#: jkazip:66 jkazip:72 jkazip:78 jkazip:84 jkazip:90 jkazip:96 jkazip:102 -msgid "%s has been decompressed" +#: jkazip:16 +msgid "File extension haven't been specified" msgstr "" -#: jkazip:106 jkazip:269 -msgid "Format %s unknown" +#: jkazip:33 +msgid "File/s %s has/have been compressed in %s" msgstr "" -#: jkazip:112 +#: jkazip:39 +msgid "File %s has been decompressed" +msgstr "" + +#: jkazip:45 msgid "No option specified, use jkazip -h" msgstr "" -#: jkazip:114 +#: jkazip:47 msgid "\tsynopsis:\tjkazip " msgstr "" -#: jkazip:116 +#: jkazip:49 msgid "\t-d,\t\tdecompress file" msgstr "" -#: jkazip:117 -msgid "" -"\t-f ,\tspecified format whe decompress, necessary only when the " -"name have more than one point before the file extension" +#: jkazip:50 +msgid "\t-c ,\tcompress file" msgstr "" -#: jkazip:118 -msgid "\t-c ,\tcompress file" -msgstr "" - -#: jkazip:119 +#: jkazip:51 msgid "\t-h,\t\tshow help box and exit" msgstr "" -#: jkazip:120 -msgid "\t-v,\t\tshow version" +#: jkazip:52 +msgid "\t-v,\t\tshow version and exit" msgstr "" -#: jkazip:122 +#: jkazip:54 msgid "" -"\tThe order must be \"jkazip -d [-f format] \" or " -"\"jkazip -c \" or \"jkazip -c \"" msgstr "" -#: jkazip:124 +#: jkazip:56 msgid "\tExamples" msgstr "" -#: jkazip:125 -msgid "\tjkazip -d -f \"tar.gz\" file.txt.tar.gz" -msgstr "" - -#: jkazip:126 +#: jkazip:57 msgid "\tjkazip -d file.7z" msgstr "" -#: jkazip:127 -msgid "\tjkazip -c \"tar.xz\" directory" +#: jkazip:58 +msgid "\tjkazip -c ouputfile.tar.gz directory" msgstr "" -#: jkazip:129 -msgid "\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, zip and rar" -msgstr "" - -#: jkazip:130 +#: jkazip:60 msgid "" -"\tOnly one file or directory (some formats don't support directories), for " -"more options use the each program individualy" +"\tSupported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and " +"zip" msgstr "" -#: jkazip:133 +#: jkazip:63 msgid "jkazip by JKA Network; version %s" msgstr "" -#: jkazip:137 jkazip:167 +#: jkazip:67 jkazip:118 msgid "No file or directory specified" msgstr "" -#: jkazip:143 jkazip:156 +#: jkazip:70 msgid "File %s will be decompressed" msgstr "" -#: jkazip:145 jkazip:176 +#: jkazip:73 jkazip:125 msgid "%s no such file or directory" msgstr "" -#: jkazip:153 -msgid "Directory %s will be decompressed" +#: jkazip:110 jkazip:168 +msgid "File extension %s are not supported" msgstr "" -#: jkazip:159 -msgid "%s no sush a file or directory" -msgstr "" - -#: jkazip:170 -msgid "The directory %s will be compressed" +#: jkazip:165 +msgid "rar compression are not supported" msgstr "" #: 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" msgstr "" diff --git a/jka-toolkit/jkazip b/jka-toolkit/jkazip index 8b53c00..10f3dbe 100755 --- a/jka-toolkit/jkazip +++ b/jka-toolkit/jkazip @@ -5,13 +5,18 @@ #Function decompress(); decompress the file whith the format especified # gettext initialization -#export TEXTDOMAIN='jkazip' -#peroexport TEXTDOMAINDIR='/usr/share/locale' +export TEXTDOMAIN='jkazip' +export TEXTDOMAINDIR='/usr/share/locale' #function sacaFormato, get the file extension to zip or unzip function sacaFormato() { local var=$1 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) postform=$(echo $var | cut -f$fieldPost -d".") preform=$(echo $var | cut -f$cant -d".") @@ -24,46 +29,48 @@ function sacaFormato() { #Function msg, print in stdout a final message function msg() { 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 msg() { +function msg2() { 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 - error "$(gettext "No option specified, use jkazip -h")" + echo "$(gettext "No option specified, use jkazip -h")" > /dev/stderr elif [ $1 = "-h" ];then echo "$(gettext " synopsis: jkazip ")" echo "" echo "$(gettext " -d, decompress file")" - echo "$(gettext " -c , compress file")" + echo "$(gettext " -c , compress file")" echo "$(gettext " -h, show help box and exit")" echo "$(gettext " -v, show version and exit")" echo "" - echo "$(gettext " The order must be \"jkazip -d \" or \"jkazip -c \" or \"jkazip -c \"")" echo "" echo "$(gettext " Examples")" echo "$(gettext " jkazip -d file.7z")" echo "$(gettext " jkazip -c ouputfile.tar.gz directory")" echo "" - echo "$(gettext " Supported formats: tar, gzip, bzip2, xzip, lzip, 7z, zip and rar")" - echo "$(gettext " Only one file or directory (some formats don't support directories), for more options use the each program individualy")" + echo "$(gettext " Supported formats: tar, gzip, bzip2, xzip, lzip, 7z, rar (only unzip) and zip")" echo "" elif [ $1 = "-v" ];then printf -- "$(gettext "jkazip by JKA Network; version %s")" "$version" echo elif [ $1 = "-d" ];then if [ -z $2 ];then - error "$(gettext "No file or directory specified")" + echo "$(gettext "No file or directory specified")" > /dev/stderr exit elif [ -f $2 ];then printf -- "$(gettext "File %s will be decompressed")" "$2" echo else - error "$(gettext "%s no such file or directory")" "$2" + echo "$(gettext "%s no such file or directory")" "$2" > /dev/stderr echo exit fi @@ -89,17 +96,19 @@ elif [ $1 = "-d" ];then ;; "xz") $formato -dk $entrada - msg $entrada + msg2 $entrada ;; "bz2") bzip2 -dk $entrada - msg $entrada + msg2 $entrada ;; "rar") 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 @@ -113,7 +122,7 @@ elif [ $1 = "-c" ];then do if [[ $i != $1 && $i != $2 ]];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 exit fi @@ -129,36 +138,37 @@ elif [ $1 = "-c" ];then case $formato in "tar" | "tar.xz" | "tar.lz" | "tar.gz" | "tar.bz2" | "tgz" | "tbz" | "txz" | "tlz") tar cvfa $salida $files - msg $files + msg $files $salida ;; "7z") 7z a $salida $files - msg $files + msg $files $salida ;; "zip") zip $salida $files - msg $files + msg $files $salida ;; "gz" | "lz") formato="${formato}ip" $formato -9kc $3 > $salida - msg $3 + msg $3 $salida ;; "xz") $formato -9kc $3 > $salida - msg $3 + msg $3 $salida ;; "bz2") $formato -9kc $3 > $salida - msg $3 + msg $3 $salida ;; "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 else - echo "$(gettext "Unknown option")" -fi \ No newline at end of file + echo "$(gettext "Unknown option")" > /dev/stderr +fi