summaryrefslogtreecommitdiff
path: root/src/lib/common.sh.head
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/common.sh.head')
-rw-r--r--src/lib/common.sh.head25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/common.sh.head b/src/lib/common.sh.head
new file mode 100644
index 0000000..23bfeb8
--- /dev/null
+++ b/src/lib/common.sh.head
@@ -0,0 +1,25 @@
+#!/hint/bash
+# This may be included with or without `set -euE`
+
+# This file is included by libremessages.
+# You should probably use libremessages instead of this.
+
+# License: Unspecified
+
+shopt -s extglob
+
+if [[ -z ${_INCLUDE_COMMON_SH:-} ]]; then
+_INCLUDE_COMMON_SH=true
+
+[[ -n ${TEXTDOMAIN:-} ]] || export TEXTDOMAIN='libretools'
+[[ -n ${TEXTDOMAINDIR:-} ]] || export TEXTDOMAINDIR='/usr/share/locale'
+
+if type gettext &>/dev/null; then
+ _() { gettext "$@"; }
+else
+ _() { echo "$@"; }
+fi
+
+_l() {
+ TEXTDOMAIN='librelib' TEXTDOMAINDIR='/usr/share/locale' "$@"
+}