| 1 | #! /bin/sh
|
|---|
| 2 | # Wrapper around gettext for programs using the msgid convention.
|
|---|
| 3 |
|
|---|
| 4 | # Copyright (C) 1998, 2001 Free Software Foundation, Inc.
|
|---|
| 5 |
|
|---|
| 6 | # Written by Paul Eggert <[email protected]>.
|
|---|
| 7 |
|
|---|
| 8 | # This program is free software; you can redistribute it and/or modify
|
|---|
| 9 | # it under the terms of the GNU General Public License as published by
|
|---|
| 10 | # the Free Software Foundation; either version 2, or (at your option)
|
|---|
| 11 | # any later version.
|
|---|
| 12 |
|
|---|
| 13 | # This program is distributed in the hope that it will be useful,
|
|---|
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | # GNU General Public License for more details.
|
|---|
| 17 |
|
|---|
| 18 | # You should have received a copy of the GNU General Public License
|
|---|
| 19 | # along with GNU CC; see the file COPYING. If not, write to
|
|---|
| 20 | # the Free Software Foundation, 59 Temple Place - Suite 330,
|
|---|
| 21 | # Boston, MA 02111-1307, USA.
|
|---|
| 22 |
|
|---|
| 23 | # Always operate in the C locale.
|
|---|
| 24 | LANG=C
|
|---|
| 25 | LANGUAGE=C
|
|---|
| 26 | LC_ALL=C
|
|---|
| 27 | export LANG LANGUAGE LC_ALL
|
|---|
| 28 |
|
|---|
| 29 | # Set AWK if environment has not already set it.
|
|---|
| 30 | AWK=${AWK-awk}
|
|---|
| 31 |
|
|---|
| 32 | # The argument to this wrapper is the xgettext command to be executed.
|
|---|
| 33 | # Extract the xgettext program name from the rest of the command.
|
|---|
| 34 | xgettext=${1?}
|
|---|
| 35 | shift
|
|---|
| 36 |
|
|---|
| 37 | # Save work if we're just wrapping a no-op.
|
|---|
| 38 | case $xgettext in
|
|---|
| 39 | :) exit;;
|
|---|
| 40 | esac
|
|---|
| 41 |
|
|---|
| 42 | # Find the files to be scanned, and the directory to scan them from.
|
|---|
| 43 | directory=.
|
|---|
| 44 | files=
|
|---|
| 45 | for i
|
|---|
| 46 | do
|
|---|
| 47 | case $i in
|
|---|
| 48 | --directory=*)
|
|---|
| 49 | directory=`expr " $i" : ' --directory=\(.*\)'`;;
|
|---|
| 50 | --files-from=*)
|
|---|
| 51 | files_from=`expr " $i" : ' --files-from=\(.*\)'`
|
|---|
| 52 | files=`$AWK '/^[^#]/ { print }' $files_from`;;
|
|---|
| 53 | esac
|
|---|
| 54 | done
|
|---|
| 55 |
|
|---|
|
|---|