From 83dacd6a1ee408b949b023a60562d9494b18a12e Mon Sep 17 00:00:00 2001 From: Joseph Graham Date: Sat, 10 Jun 2017 21:12:20 +0100 Subject: Started adding translations. --- pacman2pacman-get | 69 +++++++++++++++++---------------- translations/eo/pacman2pacman-get.po | 51 ++++++++++++++++++++++++ translations/pt-BR/pacman2pacman-get.po | 51 ++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 34 deletions(-) create mode 100644 translations/eo/pacman2pacman-get.po create mode 100644 translations/pt-BR/pacman2pacman-get.po diff --git a/pacman2pacman-get b/pacman2pacman-get index 1a82b4c..d3066b9 100644 --- a/pacman2pacman-get +++ b/pacman2pacman-get @@ -35,8 +35,8 @@ pkg_cache_location='/var/cache/pacman/pkg' # XferCommand = /usr/bin/pacman2pacman-get %u %o # Check that the args are not empty. -[[ -z ${1} ]] && { echoerr "The first argument should be the download url." ; exit 1 ; } -[[ -z ${2} ]] && { echoerr "The second argument should be the local filename, plus a “.part” extension." ; exit 1 ; } +[[ -z ${1} ]] && { echoerr $"The first argument should be the download url." ; exit 1 ; } +[[ -z ${2} ]] && { echoerr $"The second argument should be the local filename, plus a “.part” extension." ; exit 1 ; } url="${1}" # The download url. filename="${2}" # This is where the downloaded file needs to be saved @@ -45,7 +45,7 @@ filename="${2}" # This is where the downloaded file needs to be saved # Check if transmission daemon is running. if ! systemctl show --property='ActiveState' transmission | grep -q 'ActiveState=active' then - echoerr 'Error: The transmission daemon is not running.' + echoerr $"Error: The transmission daemon is not running." exit 1 fi @@ -121,7 +121,7 @@ else fi # We were looking for a torrent, but we didn't find one :o -[[ "${response}" == 'torrenttime' ]] && echo "Can't find a torrent file for this package :S" +[[ "${response}" == 'torrenttime' ]] && echo $"Can't find a torrent file for this package :S" gotourbaby=0 # to record if we've got the torrent yet. @@ -138,7 +138,7 @@ then # The filename of the torrent torntname="${torrent_folder}/${url##*/}.torrent" - + # Move the torrent to the correct location mv "${response#found_torrent:}" "${torntname}" @@ -162,9 +162,9 @@ then (( debugmode )) && transmission-remote -a "${torntname}" -w "${pkg_cache_location}" 2>&1 | tee "${transmission_output}" (( debugmode )) || transmission-remote -a "${torntname}" -w "${pkg_cache_location}" 2>&1 > "${transmission_output}" - if grep "Error: invalid or corrupt torrent file" "${transmission_output}" + if [[ $? != 0 ]] then - echo "Invalid or corrupt torrent file - falling back to HTTP" + echo $"Transmission didn't accept our torrent file - falling back to HTTP" gotourbaby=0 else # The torrent is now downloading. To get info about the torrent in @@ -200,7 +200,7 @@ then # the right place. progress='0.0%' - echo -n "Pacman2pacman p2p download: ${pname}: ${progress}" + echo -n $"Pacman2pacman p2p download: ${pname}: ${progress}" count=0 @@ -210,7 +210,8 @@ then until [[ "${progress}" == '100%' ]] do - progress=$(transmission-remote -t "${id}" -i | grep 'Percent Done:') + # This finds the line with the percent done. + progress=$(transmission-remote -t "113" -i | grep '[[:digit:]]%$' | head -1) progress="${progress##* }" # Remove stuff we don't want # If we're still at 0.0% after ${webseed_check_after} attempts @@ -223,7 +224,7 @@ then if [[ last_webseed_check[1] == 'broken' ]] then # Just set the message without checking. - progress='0.0% Warning: Webseed dead...' + progress=$"0.0% Warning: Webseed dead..." else # We don't need to do anything true @@ -234,27 +235,27 @@ then # The webseed seems to be invalid so we print an error # message. - progress='0.0% Warning: Webseed dead...' # This - # most - # likely - # means - # the - # user - # needs - # to run - # pacman - # -Sy, or - # that - # their - # internet - # is - # down. + progress=$"0.0% Warning: Webseed dead..." # This + # most + # likely + # means + # the + # user + # needs + # to run + # pacman + # -Sy, or + # that + # their + # internet + # is + # down. # If there are no peers we remove the torrent from # transmission, print an error message and exit. if (( $(transmission-remote -t "${id}" -pi | wc -l) < 2 )) then - echo "Webseed dead and no peers, removing torrent from transmission and try by HTTP." + echo $"Webseed dead and no peers, removing torrent from transmission and trying by HTTP." transmission-remote -t "${id}" -r > /dev/null gotourbaby=0 break @@ -270,7 +271,7 @@ then fi fi - printf "\rPacman2pacman p2p download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman p2p download: %s: %s " "${pname}" "${progress}" sleep 0.7 @@ -286,7 +287,7 @@ then do if (( err_count > 50 )) then - echo "error moving \"${pkg_cache_location}/${url##*/}\". removing torrent from transmission" + echo $"error moving \"${pkg_cache_location}/${url##*/}\". removing torrent from transmission" transmission-remote -t "${id}" -r > /dev/null exittidy ; exit 1 fi @@ -316,7 +317,7 @@ then progress='0.0%' - echo -n "Pacman2pacman http download: ${pname}: ${progress}" + echo -n $"Pacman2pacman http download: ${pname}: ${progress}" # The first loop gets rid of all the backspace and '#'es and # stuff. The second loop isolates the percent done number. @@ -347,14 +348,14 @@ then # start of the download. This should fix it. [[ "${progress}" == '100.0%' ]] && continue - printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" done # It's the end of the download so we can now display 100% if [[ "${progress}" == '100.0%' ]] then progress='100%' - printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" fi } @@ -366,20 +367,20 @@ then if ! new_mod_time=$(stat -c %Y "/srv/pacman2pacman/dbcache/${filename##*/}" 2>/dev/null) then progress='failed' - printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" # If the file was not modified we display such elif [[ "${new_mod_time}" == "${mod_time}" ]] then progress='file not modified' - printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" fi else # It's not a dbfile. Just check the output file exists. if ! [[ -f "${filename}" ]] then progress='failed' - printf "\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" + printf $"\rPacman2pacman http download: %s: %s " "${pname}" "${progress}" fi fi diff --git a/translations/eo/pacman2pacman-get.po b/translations/eo/pacman2pacman-get.po new file mode 100644 index 0000000..de330be --- /dev/null +++ b/translations/eo/pacman2pacman-get.po @@ -0,0 +1,51 @@ +#: pacman2pacman-get:38 +msgid "The first argument should be the download url." +msgstr "La unua argumento devas esti la URL de la elŝuto." +#: pacman2pacman-get:39 +msgid "The second argument should be the local filename, plus a “.part” extension." +msgstr "La dua argumento devas esti la nomo de la loka dosiero, kun la afikso “.part”." +#: pacman2pacman-get:48 +msgid "Error: The transmission daemon is not running." +msgstr "Eraro: La demono de transmission ne rulas." +#: pacman2pacman-get:124 +msgid "Can't find a torrent file for this package :S" +msgstr "" +#: pacman2pacman-get:167 +msgid "Transmission didn't accept our torrent file - falling back to HTTP" +msgstr "" +#: pacman2pacman-get:203 +msgid "Pacman2pacman p2p download: ${pname}: ${progress}" +msgstr "Pacman2pacman elŝutas samtavole: ${pname}: ${progress}" +#: pacman2pacman-get:227 +msgid "0.0% Warning: Webseed dead..." +msgstr "0.0% Averto: la retfontsendo mortas..." +#: pacman2pacman-get:238 +msgid "0.0% Warning: Webseed dead..." +msgstr "0.0% Averto: la retfontsendo mortas..." +#: pacman2pacman-get:258 +msgid "Webseed dead and no peers, removing torrent from transmission and trying by HTTP." +msgstr "" +#: pacman2pacman-get:274 +msgid "\\rPacman2pacman p2p download: %s: %s " +msgstr "\\rPacman2pacman elŝutas samtavole: %s: %s " +#: pacman2pacman-get:290 +msgid "error moving \\\"${pkg_cache_location}/${url##*/}\\\". removing torrent from transmission" +msgstr "" +#: pacman2pacman-get:320 +msgid "Pacman2pacman http download: ${pname}: ${progress}" +msgstr "Pacman2pacman elŝutas per HTTP: ${pname}: ${progress}" +#: pacman2pacman-get:351 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman elŝutas per HTTP: %s: %s " +#: pacman2pacman-get:358 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman elŝutas per HTTP: %s: %s " +#: pacman2pacman-get:370 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman elŝutas per HTTP: %s: %s " +#: pacman2pacman-get:376 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman elŝutas per HTTP: %s: %s " +#: pacman2pacman-get:383 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman elŝutas per HTTP: %s: %s " diff --git a/translations/pt-BR/pacman2pacman-get.po b/translations/pt-BR/pacman2pacman-get.po new file mode 100644 index 0000000..87b983f --- /dev/null +++ b/translations/pt-BR/pacman2pacman-get.po @@ -0,0 +1,51 @@ +#: pacman2pacman-get:38 +msgid "The first argument should be the download url." +msgstr "O primeiro argumento deve ser o URL de download." +#: pacman2pacman-get:39 +msgid "The second argument should be the local filename, plus a “.part” extension." +msgstr "O segundo argumento deve ser o nome do arquivo local, com uma extensão “.part”." +#: pacman2pacman-get:48 +msgid "Error: The transmission daemon is not running." +msgstr "Erro: O daemon do transmission não está rodando." +#: pacman2pacman-get:124 +msgid "Can't find a torrent file for this package :S" +msgstr "" +#: pacman2pacman-get:167 +msgid "Transmission didn't accept our torrent file - falling back to HTTP" +msgstr "" +#: pacman2pacman-get:203 +msgid "Pacman2pacman p2p download: ${pname}: ${progress}" +msgstr "Pacman2pacman está baixando por p2p: ${pname}: ${progress}" +#: pacman2pacman-get:227 +msgid "0.0% Warning: Webseed dead..." +msgstr "0.0% Aviso: a webseed está morta..." +#: pacman2pacman-get:238 +msgid "0.0% Warning: Webseed dead..." +msgstr "0.0% Aviso: a webseed está morta..." +#: pacman2pacman-get:258 +msgid "Webseed dead and no peers, removing torrent from transmission and trying by HTTP." +msgstr "" +#: pacman2pacman-get:274 +msgid "\\rPacman2pacman p2p download: %s: %s " +msgstr "\\rPacman2pacman está baixando por p2p: %s: %s " +#: pacman2pacman-get:290 +msgid "error moving \\\"${pkg_cache_location}/${url##*/}\\\". removing torrent from transmission" +msgstr "" +#: pacman2pacman-get:320 +msgid "Pacman2pacman http download: ${pname}: ${progress}" +msgstr "Pacman2pacman está baixando por http: ${pname}: ${progress}" +#: pacman2pacman-get:351 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman está baixando por http: %s: %s " +#: pacman2pacman-get:358 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman está baixando por http: %s: %s " +#: pacman2pacman-get:370 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman está baixando por http: %s: %s " +#: pacman2pacman-get:376 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman está baixando por http: %s: %s " +#: pacman2pacman-get:383 +msgid "\\rPacman2pacman http download: %s: %s " +msgstr "\\rPacman2pacman está baixando por http: %s: %s " -- cgit v1.2.3