Changeset View
Changeset View
Standalone View
Standalone View
kundo2_aware_xgettext.sh
Context not available. | |||||
26 | # Then check that all messages in sample.pot have "(qtundo-format)" in msgctxt. | 26 | # Then check that all messages in sample.pot have "(qtundo-format)" in msgctxt. | ||
---|---|---|---|---|---|
27 | function add_ctxt_qtundo() { | 27 | function add_ctxt_qtundo() { | ||
28 | POT_PART_QUNDOFORMAT="$1" | 28 | POT_PART_QUNDOFORMAT="$1" | ||
29 | POT_PART_QUNDOFORMAT2="$(mktemp $podir/_qundoformat2_XXXXXXXX.pot)" | 29 | POT_PART_QUNDOFORMAT2="`mktemp $podir/_qundoformat2_XXXXXXXX.pot`" | ||
30 | 30 | | |||
31 | # Prepend "(qtundo-format)" to existing msgctxt properties of messages | 31 | # Prepend "(qtundo-format)" to existing msgctxt properties of messages | ||
32 | sed -i -e 's/^msgctxt "/msgctxt "(qtundo-format) /' "${POT_PART_QUNDOFORMAT}" | 32 | sed -i -e 's/^msgctxt "/msgctxt "(qtundo-format) /' "${POT_PART_QUNDOFORMAT}" | ||
Context not available. | |||||
49 | 49 | | |||
50 | function kundo2_aware_xgettext_internal() { | 50 | function kundo2_aware_xgettext_internal() { | ||
51 | SRC_FILES="$*" | 51 | SRC_FILES="$*" | ||
52 | POT_PART_NORMAL="$(mktemp $podir/_normal_XXXXXXXX.pot)" | 52 | POT_PART_NORMAL="`mktemp $podir/_normal_XXXXXXXX.pot`" | ||
53 | POT_PART_QUNDOFORMAT="$(mktemp $podir/_qundoformat_XXXXXXXX.pot)" | 53 | POT_PART_QUNDOFORMAT="`mktemp $podir/_qundoformat_XXXXXXXX.pot`" | ||
54 | POT_MERGED="$(mktemp $podir/_merged_XXXXXXXX.pot)" | 54 | POT_MERGED="`mktemp $podir/_merged_XXXXXXXX.pot`" | ||
55 | 55 | | |||
56 | $XGETTEXT ${CXG_EXTRA_ARGS} ${SRC_FILES} -o "${POT_PART_NORMAL}" --force-po | 56 | $XGETTEXT ${CXG_EXTRA_ARGS} ${SRC_FILES} -o "${POT_PART_NORMAL}" --force-po | ||
57 | 57 | | |||
Context not available. | |||||
74 | add_ctxt_qtundo "${POT_PART_QUNDOFORMAT}" | 74 | add_ctxt_qtundo "${POT_PART_QUNDOFORMAT}" | ||
75 | fi | 75 | fi | ||
76 | 76 | | |||
77 | if [ -s "${POT_PART_NORMAL}" ] && [ -s "${POT_PART_QUNDOFORMAT}" ]; then | 77 | if [ -s "${POT_PART_NORMAL}" -a -s "${POT_PART_QUNDOFORMAT}" ]; then | ||
78 | # ensure an empty line or else KDE_HEADER search will fail | 78 | # ensure an empty line or else KDE_HEADER search will fail | ||
79 | # in case POT_PART_NORMAL only contains header | 79 | # in case POT_PART_NORMAL only contains header | ||
80 | echo "" >>${POT_PART_NORMAL} | 80 | echo "" >>${POT_PART_NORMAL} | ||
Context not available. | |||||
103 | # To disable excluding for given file, e.g. foo.pot, add "foo.pot" line to the .i18n file. | 103 | # To disable excluding for given file, e.g. foo.pot, add "foo.pot" line to the .i18n file. | ||
104 | function find_exclude() { | 104 | function find_exclude() { | ||
105 | EXCLUDE="" | 105 | EXCLUDE="" | ||
106 | for f in $(find . -name .i18n | sed 's/\/\.i18n$//g' | sort); do | 106 | for f in `find . -name .i18n | sed 's/\/\.i18n$//g' | sort`; do | ||
107 | if ! grep -q "^${1}$" "$f/.i18n" ; then | 107 | if ! grep -q "^${1}$" "$f/.i18n" ; then | ||
108 | if [ -n "$EXCLUDE" ] ; then EXCLUDE="$EXCLUDE -o " ; fi | 108 | if [ -n "$EXCLUDE" ] ; then EXCLUDE="$EXCLUDE -o " ; fi | ||
109 | EXCLUDE="$EXCLUDE -path $f" | 109 | EXCLUDE="$EXCLUDE -path $f" | ||
Context not available. |