/usr/sbin/fatdog-package-manager.sh (mark was nor working in installed packages)
/usr/sbin/fatdog-package-manager.sh.xml (some translatable=yes added)
QuickApps internationalized using "puppy's official method" t12s
translated using very latest momanager.
BTW, these 2 are my favorite Fatdog apps
QuickApps internationalized using t12s method
Code: Select all
#!/bin/sh
# Quick Apps - create shortcut to often used applications
# Copyright (C) James Budiono 2012
# License: GNU GPL Version 3 or later
#
#131215 Internationalization
#131216 t12s version
export OUTPUT_CHARSET=UTF-8
[ "$LC_MESSAGES" ] && LANG=$LC_MESSAGES # for --calendar and --timebox
export TEXTDOMAIN=fd-control-panel
T=/usr/share/locales # TEXTDOMAINDIR
# a one-liner to find existing translation file LOCALES allowing 'dialects'
[ ! -f ${T}/${LANG%.*}/${TEXTDOMAIN} ] && LOCALES=${T}/${LANG%_*}/${TEXTDOMAIN} || LOCALES=${T}/${LANG%.*}/${TEXTDOMAIN}
[ -f $LOCALES ] && . $LOCALES # (re)load translation file (when using variables)
### configuration
APPTITLE="${_M_15:-QuickApps}"
APPICON=/usr/share/midi-icons/go48.png # temporary icon
QUICKAPPS_HOME=$HOME/QuickApps
DESKTOP_FILES_DIR=/usr/share/applications
REBUILD_LINK="0-${_M_17:-Finish-Configuration}"
INDEX_FILE=.apps
##################### helper #####################
create_quickapps() {
# if already exist, do nothing
[ -d "$QUICKAPPS_HOME" ] && return
# otherwise, create it
mkdir -p "$QUICKAPPS_HOME"
ln -sfT $(readlink -f "$0") "$QUICKAPPS_HOME/AppRun"
ln -sfT $(readlink -f "$0") "$QUICKAPPS_HOME/$REBUILD_LINK"
# create AppInfo.xml
cat > "$QUICKAPPS_HOME/AppInfo.xml" <<EOF
<?xml version="1.0"?>
<AppInfo>
<Summary>$APPTITLE</Summary>
<About>
<Purpose>${_M_19:-Application Launcher - create shortcuts for often-used applications}</Purpose>
<Version>1.0</Version>
<Authors>James Budiono</Authors>
<License>GNU General Public License Version 3 or Later</License>
</About>
<AppMenu>
<Item option="configure" icon="gtk-preferences">
<Label>${_M_20:-Add/remove application shortcuts}</Label>
</Item>
</AppMenu>
</AppInfo>
EOF
ln -sfT "$APPICON" "$QUICKAPPS_HOME/.DirIcon"
}
launch_app() {
fatdog-control-panel.sh "$APPTITLE" "$QUICKAPPS_HOME/$INDEX_FILE"
}
configure_app() {
rox -d "$QUICKAPPS_HOME"
rox -d "$DESKTOP_FILES_DIR"
Xdialog --title "$APPTITLE" --left --infobox "
${_M_13:-Two folders have been opened. One is the QuickApps folder, the other one is the "All applications folder".}
${_M_12:-You can identify them by looking at the window title. To add a shortcut, follow these three easy steps:}
1. ${_M_18:-Create a new folder in the QuickApps folder.}
`gettext "This new folder serves as 'Category' and will appear as a tab in the QuickApps."`
2. ${:M_:-From the 'All applications folder', select then drag and drop the applications you want
into the 'Category' folder you created in step 1. Choose 'Link' when asked.}
3. ${_M_21:-Repeat step 1 and 2 as necessary. When done, click $REBUILD_LINK on the QuickApps folder.}
${_M_11:-Your QuickApps is available from your HOME folder.}
" 0 0 90000
}
###_:-Repeat step 1 and 2 as necessary. When done, click ${REBUILD_LINK} on the QuickApps folder.}
### TODO avoid failure from ${} inside $ { _ M _ * }
rebuild_app() {
rox -D "$QUICKAPPS_HOME"
rox -D "$DESKTOP_FILES_DIR"
cd "$QUICKAPPS_HOME"
rm $INDEX_FILE 2> /dev/null
tab_count=0
find . -maxdepth 1 -type d | sed '1 d; s_\./__' | while read p; do
tab_count=$((tab_count + 1))
{
echo -n TAB$tab_count=\'$p\|
ls "$p" | sed 's/.desktop$//' | tr '\n' ' '
echo \'
} >> $INDEX_FILE
done
}
############# main ##############
# check how we're launched - directly or as rox app?
case $0 in
*AppRun) # as rox app
case $1 in
"") launch_app ;;
configure) configure_app ;;
esac ;;
*$REBUILD_LINK) # to finish configuration
rebuild_app ;; # as "
*) # as standalone app - do configure
create_quickapps; exec "$QUICKAPPS_HOME/AppRun" configure ;;
esac
Momanager has 2 "hello world" samples , one for gettext and one for t12s to play with....