* gettext-tools/src/x-scheme.c (read_object): Recognize _"abc".
+2014-04-30 Daiki Ueno <ueno@gnu.org>
+
+ * gettext.texi (Scheme): Document gettext shorthand form _"abc".
+
2014-04-22 Daiki Ueno <ueno@gnu.org>
build: Use git-version-gen intead of version.sh
@code{"abc"}
@item gettext shorthand
-@code{(_ "abc")}
+@code{(_ "abc")}, @code{_"abc"}
@item gettext/ngettext functions
@code{gettext}, @code{ngettext}
+2014-04-30 Daiki Ueno <ueno@gnu.org>
+
+ scheme: Recognize GIMP script-fu extension _"abc"
+ * x-scheme.c (read_object): Recognize _"abc".
+
2014-04-30 Daiki Ueno <ueno@gnu.org>
format-python-brace: Limit acceptable format specifiers
for (;;)
{
int c = do_getc ();
+ bool seen_underscore_prefix = false;
switch (c)
{
abort ();
}
+ case '_':
+ /* GIMP script-fu extension: '_' before a string literal is
+ considered a gettext call on the string. */
+ {
+ int c = do_getc ();
+ if (c == EOF)
+ /* Invalid input. Be tolerant, no error message. */
+ {
+ op->type = t_other;
+ return;
+ }
+ if (c != '"')
+ {
+ do_ungetc (c);
+
+ /* If '_' is not followed by a string literal,
+ consider it a part of symbol. */
+ op->token = XMALLOC (struct token);
+ read_token (op->token, '_');
+ op->type = t_symbol;
+ last_non_comment_line = line_number;
+ return;
+ }
+ seen_underscore_prefix = true;
+ }
+ /*FALLTHROUGH*/
+
case '"':
{
op->token = XMALLOC (struct token);
}
op->type = t_string;
- if (extract_all)
+ if (seen_underscore_prefix || extract_all)
{
lex_pos_ty pos;
+2014-04-30 Daiki Ueno <ueno@gnu.org>
+
+ * xgettext-scheme-4: New file.
+ * Makefile.am (TESTS): Add new test.
+
2014-04-30 Daiki Ueno <ueno@gnu.org>
format-python-brace: Limit acceptable format specifiers
xgettext-python-1 xgettext-python-2 xgettext-python-3 \
xgettext-python-4 \
xgettext-scheme-1 xgettext-scheme-2 xgettext-scheme-3 \
+ xgettext-scheme-4 \
xgettext-sh-1 xgettext-sh-2 xgettext-sh-3 xgettext-sh-4 xgettext-sh-5 \
xgettext-sh-6 \
xgettext-smalltalk-1 xgettext-smalltalk-2 \
--- /dev/null
+#!/bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Scheme support: GIMP script-fu extension _"..."
+
+cat <<EOF > xg-sc-4.scm
+(script-fu-register "script-fu-paste-as-brush"
+ _"New _Brush..."
+ _"Paste the clipboard contents into a new brush"
+ "Michael Natterer <mitch@gimp.org>"
+ "Michael Natterer"
+ "2005-09-25"
+ ""
+ SF-STRING _"Brush name" "My Brush"
+ SF-STRING _"File name" "mybrush"
+ SF-ADJUSTMENT _"Spacing" '(25 0 1000 1 1 1 0)
+)
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -k_ --omit-header --no-location --add-comments=TRANSLATORS: \
+ -d xg-sc-4.tmp xg-sc-4.scm || exit 1
+LC_ALL=C tr -d '\r' < xg-sc-4.tmp.po > xg-sc-4.po || exit 1
+
+cat <<EOF > xg-sc-4.ok
+msgid "New _Brush..."
+msgstr ""
+
+msgid "Paste the clipboard contents into a new brush"
+msgstr ""
+
+msgid "Brush name"
+msgstr ""
+
+msgid "File name"
+msgstr ""
+
+msgid "Spacing"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-sc-4.ok xg-sc-4.po
+result=$?
+
+exit $result