pdict 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #!/bin/sh
  2. ##! /usr/sbin/gtkdialog3 -e
  3. #BK nov 2007 gui frontend for dict.
  4. #110126 improvements.
  5. #130517 robwoj44: internationalized.
  6. export TEXTDOMAIN=pdict
  7. export TEXTDOMAINDIR=/usr/share/locale
  8. export OUTPUT_CHARSET=UTF-8
  9. . gettext.sh
  10. echo -n "" > /tmp/pdict-results.txt
  11. /usr/lib/gtkdialog/box_splash -placement center -close never -timeout 60 -fontsize large -text "$(gettext 'Please wait, accessing online Dict server...')" &
  12. DICTLIST="`dict --dbs`"
  13. killall yaf-splash
  14. COMBOCONTENT="`echo "$DICTLIST" | tr "'" "_" | grep '^ ' | grep -v '^ \-' | sed -e 's/^ //' | sed -e 's/^/<item>/' | sed -e 's/$/<\/item>/'`" #'geany
  15. COMBOCONTENT="<item>all $(gettext 'Search all databases')</item>
  16. ${COMBOCONTENT}"
  17. echo '#/bin/sh' > /tmp/pdict-func1
  18. echo 'dict -d $2 $1 > /tmp/pdict-results.txt 2>&1' >> /tmp/pdict-func1 #110126
  19. chmod 755 /tmp/pdict-func1
  20. export MAIN_DIALOG="
  21. <window title=\"$(gettext 'Pdict dictionary and thesaurus')\" icon-name=\"gtk-info\">
  22. <vbox>
  23. <hbox>
  24. <text><label>$(gettext 'enter a word:')</label></text>
  25. <entry activates-default=\"true\">
  26. <variable>WORD</variable>
  27. </entry>
  28. <button has-default=\"true\">
  29. <input file stock=\"gtk-find\"></input>
  30. <label>$(gettext 'dict')</label>
  31. <action>/tmp/pdict-func1 \$WORD \$MYCHOICE</action>
  32. <action>refresh:INFO</action>
  33. </button>
  34. </hbox>
  35. <text><label>$(gettext 'Choose which online database (default is all):')</label></text>
  36. <combobox>
  37. <variable>MYCHOICE</variable>
  38. $COMBOCONTENT
  39. </combobox>
  40. <frame result:>
  41. <edit>
  42. <variable>INFO</variable>
  43. <input file>/tmp/pdict-results.txt</input>
  44. <width>450</width>
  45. <height>300</height>
  46. </edit>
  47. </frame>
  48. <hbox>
  49. <button>
  50. <label>$(gettext 'exit')</label>
  51. <input file stock=\"gtk-quit\"></input>
  52. <action type=\"exit\">EXIT</action>
  53. </button>
  54. </hbox>
  55. </vbox>
  56. </window>
  57. "
  58. RETSTRING="`gtkdialog3 --program=MAIN_DIALOG`"
  59. ###END###