2 # Create the messages header file from the master source file or a translation.
3 # Missing messages are filled in from the master message file and, if
4 # requested, character set conversion is performed.
7 echo "Error: missing parameters"
8 echo "Usage: $0 <messages file> <character set>"
12 MASTER
=help
/help_mp-en.h
21 while read -r line
; do
22 if echo "$line" |
grep -q '^#define' ; then
23 curr
=`printf "%s\n" "$line" | cut -d ' ' -f 2`
24 if grep -q "^#define $curr[ ]" "$TRANSLATION" ; then
28 if [ -z "$line" ]; then
33 if [ -n "$curr" ]; then
40 /* WARNING! This is a generated file, do NOT edit.
41 * See the help/ subdirectory for the editable files. */
43 #ifndef MPLAYER_HELP_MP_H
44 #define MPLAYER_HELP_MP_H
48 cat "$TRANSLATION" >> "$TARGET"
50 cat <<EOF >> "$TARGET"
52 /* untranslated messages from the English master file */
56 if test "$MASTER" != "$TRANSLATION" ; then
57 missing_messages
< "$MASTER" >> "$TARGET"
60 cat <<EOF >> "$TARGET"
62 #endif /* MPLAYER_HELP_MP_H */
65 if test $CHARSET != UTF-8
; then
66 iconv -f UTF-8
-t "$CHARSET" "$TARGET" > "${TARGET}.tmp"
67 mv "${TARGET}.tmp" "$TARGET"