aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorShujing Zhao <pearly.zhao@oracle.com>2010-01-14 06:28:27 +0000
committerShujing Zhao <pzhao@gcc.gnu.org>2010-01-14 06:28:27 +0000
commit5bc69b925dfb46c3cc511a4a03c1c70da48d08de (patch)
treeb0c2231fe93a06487f7d39316a589e11af3b681b /gcc
parent40c3294835c9e8e416c0eae4688c1160ffc8ad3f (diff)
downloadgcc-5bc69b925dfb46c3cc511a4a03c1c70da48d08de.zip
gcc-5bc69b925dfb46c3cc511a4a03c1c70da48d08de.tar.gz
gcc-5bc69b925dfb46c3cc511a4a03c1c70da48d08de.tar.bz2
re PR translation/39521 (specs diagnostics translation problems)
po/ 2010-01-14 Shujing Zhao <pearly.zhao@oracle.com> PR translation/39521 * exgettext: Extracted all specs %n strings and the %e strings that %e is at the start of a line. 2010-01-14 Shujing Zhao <pearly.zhao@oracle.com> PR translation/39521 * gcc.c (do_spec_1): Wrapped the error and notice messages of specs strings with _(). From-SVN: r155878
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gcc.c4
-rw-r--r--gcc/po/ChangeLog6
-rw-r--r--gcc/po/exgettext32
4 files changed, 35 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a73cb95..80ab5e6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-14 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR translation/39521
+ * gcc.c (do_spec_1): Wrapped the error and notice messages of specs
+ strings with _().
+
2010-01-13 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42730
diff --git a/gcc/gcc.c b/gcc/gcc.c
index d7d2b3b..8efb570 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -5248,7 +5248,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
buf = (char *) alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
- error ("%s", buf);
+ error ("%s", _(buf));
return -1;
}
break;
@@ -5262,7 +5262,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
buf = (char *) alloca (p - q + 1);
strncpy (buf, q, p - q);
buf[p - q] = 0;
- notice ("%s\n", buf);
+ notice ("%s\n", _(buf));
if (*p)
p++;
}
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 82bd289..5b09d0d 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,9 @@
+2010-01-14 Shujing Zhao <pearly.zhao@oracle.com>
+
+ PR translation/39521
+ * exgettext: Extracted all specs %n strings and the %e strings that %e
+ is at the start of a line.
+
2010-01-11 Joseph Myers <joseph@codesourcery.com>
* fi.po: Update.
diff --git a/gcc/po/exgettext b/gcc/po/exgettext
index 9c22482..7ff3799 100644
--- a/gcc/po/exgettext
+++ b/gcc/po/exgettext
@@ -75,12 +75,12 @@ pottmp=$pwd/$T/tmp.pot
# Then generate keyword options for xgettext, by scanning for declarations
# of functions whose parameter names end in "msgid".
#
-# Finally, generate a source file containing all %e strings from
+# Finally, generate a source file containing all %e and %n strings from
# driver specs, so those can be translated too.
#
# All in one huge awk script.
-echo "scanning for keywords and %e strings..." >&2
+echo "scanning for keywords, %e and %n strings..." >&2
( cd $srcdir
lang_subdirs=`echo */config-lang.in */*/config-lang.in | sed -e 's|config-lang\.in||g'`
@@ -132,24 +132,34 @@ function keyword_option(line) {
}
function spec_error_string (line) {
- while ((percent_index = index(line, "%e")) != 0) {
- escape = substr(line, percent_index - 1, 1)
+ if (index(line, "%e") != 0 && index(line, "%n") != 0) return
+ while ((percent_index = index(line, "%e")) != 0 ||
+ (percent_index = index(line, "%n")) != 0) {
line = substr(line, percent_index + 2)
- if (escape == "%") continue
bracket_index = index(line, "}")
+ newline_index = index(line, "\\n")
+
quote_index = index(line, "\"")
- if (bracket_index == 0) return
- if (quote_index != 0 && bracket_index > quote_index) return
+ if (bracket_index == 0 && newline_index == 0) return
- msgid = substr(line, 1, bracket_index - 1)
- line = substr(line, bracket_index + 1)
+ if (bracket_index != 0) {
+ if (quote_index != 0 && bracket_index > quote_index) return
+ msgid = substr(line, 1, bracket_index - 1)
+ line = substr(line, bracket_index + 1)
+ }
+ else if (newline_index != 0) {
+ if (quote_index != 0 && quote_index > newline_index) return
+ msgid = substr(line, 1, newline_index - 1)
+ line = substr(line, newline_index + 1)
+ }
if (index(msgid, "%") != 0) continue
+ if ((newline_index = index(msgid, "\\n")) != 0)
+ msgid = substr(msgid, 1, newline_index - 1)
printf("#line %d \"%s\"\n", lineno, file) > emsg
printf("_(\"%s\")\n", msgid) > emsg
-
}
}
@@ -174,7 +184,7 @@ END {
while (getline < file) {
if (/^(#[ ]*define[ ]*)?[A-Za-z_].*\(.*msgid[,\)]/) {
keyword_option($0)
- } else if (/%e/) {
+ } else if (/%e/ || /%n/) {
spec_error_string($0)
}
lineno++