diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/autolatex/dev |
Initial commit
Diffstat (limited to 'support/autolatex/dev')
-rwxr-xr-x | support/autolatex/dev/install_for_debug.sh | 58 | ||||
-rwxr-xr-x | support/autolatex/dev/update_po.sh | 62 |
2 files changed, 120 insertions, 0 deletions
diff --git a/support/autolatex/dev/install_for_debug.sh b/support/autolatex/dev/install_for_debug.sh new file mode 100755 index 0000000000..b9e9a83303 --- /dev/null +++ b/support/autolatex/dev/install_for_debug.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +if test '!' -f "`pwd`/autolatex.pl" +then + echo "You must launch this script from the AutoLaTeX root directory." >&2 + exit 255 +fi + +AUTOLATEX_DIR=`pwd` +AUTOLATEX_DIR=`readlink -f "$AUTOLATEX_DIR"` +# GEDIT +GTK3_SOURCE_DIR="$AUTOLATEX_DIR/libs/gtk3/autolatex" +# GEDIT +GEDIT_SOURCE_DIR="$AUTOLATEX_DIR/plugins/gedit3" +GEDIT_DEST_DIR="$HOME/.local/share/gedit/plugins" + +echo "AUTOLATEX_DIR=$AUTOLATEX_DIR" +echo "GEDIT_SOURCE=$GEDIT_SOURCE_DIR" +echo "GEDIT_DEST=$GEDIT_DEST_DIR" + +if [ "$1" = "install" ] +then + + # + # GEDIT + # + mkdir -p "$GEDIT_DEST_DIR" + + rm -rfv "$GEDIT_DEST_DIR/autolatexeditor" + rm -f "$GEDIT_DEST_DIR/autolatexeditor.plugin" + + cp -Rfs "$GEDIT_SOURCE_DIR/"* "$GEDIT_DEST_DIR/" + + cp -Rs "$GTK3_SOURCE_DIR/"* "$GEDIT_DEST_DIR/autolatex/" + + # + # CONFIG + # + mv -fv "$AUTOLATEX_DIR/default.cfg" "$AUTOLATEX_DIR/default.cfg.orig" + cp -fv "$AUTOLATEX_DIR/default_debug.cfg" "$AUTOLATEX_DIR/default.cfg" + +elif [ "$1" = "remove" ] +then + # + # GEDIT + # + rm -rfv "$GEDIT_DEST_DIR/autolatex" + rm -fv "$GEDIT_DEST_DIR/autolatex.plugin" + + # + # CONFIG + # + cd "$AUTOLATEX_DIR" + mv -fv default.cfg.orig default.cfg 2>/dev/null +else + echo "`basename $0` install|remove" >&2 + exit 255 +fi diff --git a/support/autolatex/dev/update_po.sh b/support/autolatex/dev/update_po.sh new file mode 100755 index 0000000000..f66a176d69 --- /dev/null +++ b/support/autolatex/dev/update_po.sh @@ -0,0 +1,62 @@ +#!/bin/sh + +############################################################# +echo "Generating the pot file..." + +echo " [cli]" +xgettext -L perl -k_T --from-code=UTF-8 --files-from=po/POTFILES_cli.in -o po/template_cli.pot || exit 1 + +echo " [gtk]" +xgettext -L perl -k_T --from-code=UTF-8 --files-from=po/POTFILES_gtk.in -o po/template_gtk.pot || exit 1 + +echo " [gedit]" +xgettext -L python -k_T --from-code=UTF-8 --files-from=po/POTFILES_gedit.in -o po/template_gedit.pot || exit 1 + +echo " [sublime_text2]" +xgettext -L python -k_T --from-code=UTF-8 --files-from=po/POTFILES_sublime_text_2.in -o po/template_sublime_text_2.pot || exit 1 + +echo " [gedit3]" +xgettext -L python -k_T --from-code=UTF-8 --files-from=po/POTFILES_gedit3.in -o po/template_gedit3.pot || exit 1 + +echo " [config]" +xgettext -L python -k_T --from-code=UTF-8 --files-from=po/POTFILES_config.in -o po/template_config.pot || exit 1 + +############################################################# +echo "Updating the existing translations..." + +echo " [cli]" +for PO_FILE in po/*/LC_MESSAGES/autolatex.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_cli.pot" || exit 1 +done + +echo " [gtk]" +for PO_FILE in po/*/LC_MESSAGES/autolatexgtk.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_gtk.pot" || exit 1 +done + +echo " [gedit]" +for PO_FILE in po/*/LC_MESSAGES/geditautolatex.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_gedit.pot" || exit 1 +done + +echo " [sublime_text_2]" +for PO_FILE in po/*/LC_MESSAGES/sublime-text-2-autolatex.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_sublime_text_2.pot" || exit 1 +done + +echo " [gedit3]" +for PO_FILE in po/*/LC_MESSAGES/autolatex-gedit3.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_gedit3.pot" || exit 1 +done + +echo " [config]" +for PO_FILE in po/*/LC_MESSAGES/autolatex-config.po +do + msgmerge --backup=none -U "$PO_FILE" "po/template_config.pot" || exit 1 +done + |