Skip to content

Commit 81dccdb

Browse files
committed
Add small gettext plugin
1 parent 33a300d commit 81dccdb

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

gettext/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# linuxdeploy-plugin-gettext
2+
3+
This plugin installs an AppRun hook to make sure applications which use [gettext](https://en.wikipedia.org/wiki/Gettext) load localization data from within the AppImage.

gettext/linuxdeploy-plugin-gettext.sh

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#! /bin/bash
2+
3+
# exit whenever a command called in this script fails
4+
set -e
5+
6+
appdir=""
7+
8+
show_usage() {
9+
echo "Usage: bash $0 --appdir <AppDir>"
10+
}
11+
12+
while [ "$1" != "" ]; do
13+
case "$1" in
14+
--plugin-api-version)
15+
echo "0"
16+
exit 0
17+
;;
18+
--appdir)
19+
appdir="$2"
20+
shift
21+
shift
22+
;;
23+
*)
24+
echo "Invalid argument: $1"
25+
echo
26+
show_usage
27+
exit 2
28+
esac
29+
done
30+
31+
if [[ "$appdir" == "" ]]; then
32+
show_usage
33+
exit 2
34+
fi
35+
36+
echo "Installing AppRun hook"
37+
set -x
38+
mkdir -p "$appdir"/apprun-hooks
39+
cat > "$appdir"/apprun-hooks/linuxdeploy-plugin-gettext.sh <<\EOF
40+
export TEXTDOMAINDIR="$this_dir"/usr/share/locale:"$TEXTDOMAINDIR"
41+
EOF

0 commit comments

Comments
 (0)