Skip to content

Commit

Permalink
gettext localization
Browse files Browse the repository at this point in the history
  • Loading branch information
Pro-pra committed Apr 19, 2016
1 parent 23e13d8 commit 237e9e2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions usr/sbin/unloader_pfs
@@ -1,6 +1,9 @@
#!/bin/bash
# Отключение пакетов PFS (PuppyRus), by Zay, GPL v3.
# Версия 0.7. Последнее изменение: 07.04.2016
# Версия 0.8. Последнее изменение: 19.04.2016

export LOCALDOMAIN="unloader_pfs"
. gettext.sh

if [ "$1" != "--all" ];then
if [ -f /tmp/permanent_pfs_load.log ]; then
Expand Down Expand Up @@ -30,17 +33,17 @@ listgen="`find "${ckeckprefmp}" -mindepth 1 -maxdepth 1 -type d -name '*.pfs' |
echo -n "<text>${IFS}<label>\" ${package} \"</label>${IFS}</text>"
done)"
else
PACKLST="${IFS}<text>${IFS}<label> (Пакеты отсутствуют) </label>${IFS}</text>${IFS}"
PACKLST="${IFS}<text>${IFS}<label>$(gettext ' (Пакеты отсутствуют) ')</label>${IFS}</text>${IFS}"
fi
echo -n "<vbox>${IFS}<text>${IFS}<label>"' '"${pfsname:1}"' '"</label>${IFS}</text>${IFS}<hbox "'homogeneous=\"true\"'">${IFS}<vbox>${IFS} ${PACKLST} ${IFS}</vbox>${IFS}<vbox "'homogeneous=\"true\"'">${IFS}<button>${IFS}<label>"'\" Отключить \"'"</label>${IFS}<action "'type=\"exit\"'">""${pfsname}""</action>${IFS}</button>${IFS}</vbox>${IFS}</hbox>${IFS}</vbox>${IFS}<hseparator></hseparator>${IFS}"
echo -n "<vbox>${IFS}<text>${IFS}<label>"' '"${pfsname:1}"' '"</label>${IFS}</text>${IFS}<hbox "'homogeneous=\"true\"'">${IFS}<vbox>${IFS} ${PACKLST} ${IFS}</vbox>${IFS}<vbox "'homogeneous=\"true\"'">${IFS}<button>${IFS}<label>"'\"$(gettext ' Отключить ')\"'"</label>${IFS}<action "'type=\"exit\"'">""${pfsname}""</action>${IFS}</button>${IFS}</vbox>${IFS}</hbox>${IFS}</vbox>${IFS}<hseparator></hseparator>${IFS}"
fi
done`"
[ "${listgen}" = "" ] && listgen="<hbox homogeneous=\"true\"><text>${IFS}<label>\"${IFS}( Нет подключенных пакетов )\"</label>${IFS}</text></hbox>"
[ "${listgen}" = "" ] && listgen="<hbox homogeneous=\"true\"><text>${IFS}<label>\"${IFS}$(gettext '( Нет подключенных пакетов )')\"</label>${IFS}</text></hbox>"
[ "${permanents}" != "" ] && SHOWALL="<hbox homogeneous=\"true\">${IFS}<button>${IFS}<label>\" Показать постоянно подключенные PFS \"</label>${IFS}<action type=\"exit\">showall</action>${IFS}</button>${IFS}</hbox>"
[ "${permanents}" != "" ] && SHOWALL="<hbox homogeneous=\"true\">${IFS}<button>${IFS}<label>\"$(gettext ' Показать постоянно подключенные PFS ')\"</label>${IFS}<action type=\"exit\">showall</action>${IFS}</button>${IFS}</hbox>"
export MAIN_DIALOG="<window title=\" Отключение пакетов \">
export MAIN_DIALOG="<window title=\"$(gettext ' Отключение пакетов ')\">
<vbox>
<vbox scrollable=\"true\" height=\"470\" width=\"420\">
${listgen}
Expand All @@ -57,8 +60,8 @@ if [ "${EXIT}" = "showall" ]; then
else
if [ "${EXIT:0:1}" = "." ]; then
# Отключение PFS:
export WAIT_DIALOG="<window title=\" Отключение... \" resizable=\"false\"><vbox border-width=\"16\">
<text><label>\"Отключение пакета...\"</label></text>
export WAIT_DIALOG="<window title=\"$(gettext ' Отключение... ')\" resizable=\"false\"><vbox border-width=\"16\">
<text><label>\"$(gettext 'Отключение пакета...')\"</label></text>
</vbox></window>"
gtkdialog3 --program=UMNT_DIALOG --center &
dlgwait=$!
Expand Down Expand Up @@ -88,9 +91,9 @@ else
if [ $status -eq 0 ]; then
sfsevent="$(which sfs_event_rem)"
[ "${sfsevent}" != "" ] && "${sfsevent}" "${EXIT:1}" &
Xdialog --title " Отключение PFS " --msgbox " Пакет \"${EXIT:1}\" отключен. \n" 6 0
Xdialog --title "$(gettext ' Отключение PFS ')" --msgbox "`eval_gettext " Пакет \"${EXIT:1}\" отключен. \n"`" 6 0
else
Xdialog --title " Ошибка! " --msgbox " ОШИБКА! Пакет \"${EXIT:1}\" не удалось отключить! " 6 0
Xdialog --title "$(gettext ' Ошибка! ')" --msgbox "`eval_gettext " ОШИБКА! Пакет \"${EXIT:1}\" не удалось отключить! "`" 6 0
fi
[ "${SHOWALL}" != "" ] && "$0" || "$0" --all
fi
Expand Down

0 comments on commit 237e9e2

Please sign in to comment.