From 748b5e3d2d70e47ab72ed44a371bd0db9a3a0c20 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sat, 17 Feb 2018 18:17:08 +0000 Subject: add gettext-tiny tools For libintl stub users tiny gettext tools might be useful. Tested with x86_64 on Gentoo/uClibc-ng system. --- utils/xgettext | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 utils/xgettext (limited to 'utils/xgettext') diff --git a/utils/xgettext b/utils/xgettext new file mode 100755 index 000000000..ebed620f0 --- /dev/null +++ b/utils/xgettext @@ -0,0 +1,108 @@ +#!/bin/sh +outputfile= +outputdir= +domain=messages + +spliteq() { + arg=$1 + echo "${arg#*=}" + #alternatives echo "$arg" | cut -d= -f2- + # or echo "$arg" | sed 's/[^=]*=//' +} + +syntax() { + printf "%s\n" "Usage: xgettext [OPTION] [INPUTFILE]..." + exit 1 +} + +show_version() { + printf "%s\n", "these are not (GNU gettext-tools) 99.9999.9999\n" + exit 0 +} + +while true ; do + case $1 in + #--files-from=*) readfile `spliteq "$1"`;; + #-f) expectfilefrom=1;; + --version) show_version;; + -V) show_version;; + --default-domain=*) domain=`spliteq "$1"` ;; + -d) shift ; domain="$1" ;; + --files-from=*) : ;; + -f) shift ;; + --directory=*) : ;; + -D) shift ;; + -o) shift ; outputfile="$1" ;; + --output=*) outputfile=`spliteq "$1"` ;; + --output-dir=*) outputdir=`spliteq "$1"` ;; + -p) shift ; outputdir=`spliteq "$1"` ;; + --language=*) : ;; + -L) shift ;; + --C) : ;; + --c++) : ;; + --from-code=*) : ;; + --join-existing) : ;; + -j) : ;; + --exclude-file=*) : ;; + -x) shift;; + --add-comments=*) : ;; + -cTAG) shift;; + --add-comments) : ;; + -c) : ;; + --extract-all) : ;; + -a) : ;; + --keyword=*) : ;; + -k*) : ;; + --keyword) : ;; + -k) : ;; + --flag=*) : ;; + --trigraphs) : ;; + -T) : ;; + --qt) : ;; + --kde) : ;; + --boost) : ;; + --debug) : ;; + --color) : ;; + --color=*) : ;; + --style=*) : ;; + --no-escape) : ;; + -e) : ;; + --escape) : ;; + -E) : ;; + --force-po) force=1 ;; + --indent) : ;; + -i) : ;; + --no-location) : ;; + --add-location) : ;; + -n) : ;; + --strict) : ;; + --properties-output) : ;; + --stringtable-output) : ;; + --width=*) : ;; + -w) : ;; + --no-wrap) : ;; + --sort-output) : ;; + -s) : ;; + --sort-by-file) : ;; + -F) : ;; + --omit-header) : ;; + --copyright-holder=*) : ;; + --foreign-user) : ;; + --package-name=*) : ;; + --package-version=*) : ;; + --msgid-bugs-address=*) : ;; + --msgstr-prefix*) : ;; + -m*) : ;; + --msgstr-suffix*) : ;; + -M*) : ;; + --help) syntax ;; + -h) syntax ;; + *) break ;; + esac + shift +done + +[ "$outputfile" = "-" ] && exit 0 +#[ -z "$outputdir" ] && outputdir=. +[ -z "$outputfile" ] && outputfile=${domain}.po +touch $outputdir/$outputfile -- cgit v1.2.3