In fact, you have a great idea (why don't I think of this myself! ) Rather than playing with this trick (SUPPORTED is a file from glibc, it will change in 700; same with those locale/* stuff; so I would prefer not to mess with them unless we really have to), we can in fact cache the entire pipeline. Something like this, instead of:L18L wrote:Above GUI needed 15 sec
6 sec only if (I have done it) locales files are converted once ( 1.1 sec )
Code: Select all
# --treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
if selection=$(eval Xdialog --stdout --title "$APPTITLE" \
--backtitle "Current locale is \'$LANG\'" \
--treeview "Select your locale" 30 80 0 $(supported_locales) ); then
Code: Select all
# --treeview <text> <height> <width> <list height> <tag1> <item1> <status1> <item_depth1> {<help1>}...
! [ -e /var/cache/supported_locales ] && supported_locales > /var/cache/supported_locales
if selection=$(eval Xdialog --stdout --title "$APPTITLE" \
--backtitle "Current locale is \'$LANG\'" \
--treeview "Select your locale" 30 80 0 $(cat /var/cache/supported_locales) ); then