This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gettext markup of library sources


On Mon, Apr 21, 2003 at 02:54:59PM -0400, Phil Edwards wrote:
> 
> I'll do up a real patch and an example libstdc++.pot file.

Here's the output .pot after the patch below.  I'm not proposing to check
in the new .pot until I get some decent way of automating the following
command, and possibly merging in comments.

  fenric 89% xgettext --default-domain=libstdc++ --add-comments --keyword=_
  --keyword=gettext_noop po/string_literals.cc  `rgrep -l '_(".*")' .` --c++
  --debug -o po/TEST.pot
  fenric 90% cat po/TEST.pot
  # SOME DESCRIPTIVE TITLE.
  # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
  # This file is distributed under the same license as the PACKAGE package.
  # FIRST AUTHOR <EMAIL at ADDRESS>, YEAR.
  #
  #, fuzzy
  msgid ""
  msgstr ""
  "Project-Id-Version: PACKAGE VERSION\n"
  "POT-Creation-Date: 2003-04-21 15:07-0400\n"
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  "Last-Translator: FULL NAME <EMAIL at ADDRESS>\n"
  "Language-Team: LANGUAGE <LL at li dot org>\n"
  "MIME-Version: 1.0\n"
  "Content-Type: text/plain; charset=CHARSET\n"
  "Content-Transfer-Encoding: 8bit\n"
  
  #. For messages testsuite files.
  #: po/string_literals.cc:23
  msgid "please"
  msgstr ""
  
  #: po/string_literals.cc:24
  msgid "thank you"
  msgstr ""
  
  #. For numpunct implementation.
  #: po/string_literals.cc:27
  msgid "true"
  msgstr ""
  
  #: po/string_literals.cc:28
  msgid "false"
  msgstr ""
  
  #: include/std/std_bitset.h:267
  msgid "bitset value is too large to fit in unsigned long"
  msgstr ""
  
  #: include/std/std_bitset.h:469
  msgid "bitset is zero-length"
  msgstr ""
  
  #: include/std/std_bitset.h:865
  msgid "bitset::set() argument too large"
  msgstr ""
  
  #: include/std/std_bitset.h:890
  msgid "bitset::reset() argument too large"
  msgstr ""
  
  #: include/std/std_bitset.h:914
  msgid "bitset::flip() argument too large"
  msgstr ""
  
  #: include/std/std_bitset.h:1017
  msgid "bitset::test() argument too large"
  msgstr ""
  fenric 91%




error: ChangeLog entry not found
Index: bits/c++config
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/bits/c++config,v
retrieving revision 1.705
diff -u -3 -r1.705 c++config
--- bits/c++config	21 Apr 2003 00:17:04 -0000	1.705
+++ bits/c++config	21 Apr 2003 19:01:07 -0000
@@ -97,4 +97,11 @@
 # define _GLIBCPP_FAST_MATH 0
 #endif
 
+// XXX These are only placeholders.  They let people mark up the library
+// sources without breaking things, and will be probably be somewhere else
+// once localization of the library itself is functioning.
+#define _(__msgid)                 (__msgid)
+#define __N(__msgid)               (__msgid)
+#define __gettext_noop(__msgid)    (__msgid)
+
 // End of prewritten config; the discovered settings follow.
Index: std/std_bitset.h
===================================================================
RCS file: /home/pme/Repositories/GCC/gcc/libstdc++-v3/include/std/std_bitset.h,v
retrieving revision 1.13
diff -u -3 -r1.13 std_bitset.h
--- std/std_bitset.h	15 Apr 2003 06:11:10 -0000	1.13
+++ std/std_bitset.h	21 Apr 2003 19:00:22 -0000
@@ -264,7 +264,7 @@
     {
       for (size_t __i = 1; __i < _Nw; ++__i)
 	if (_M_w[__i])
-	  __throw_overflow_error("bitset -- too large to fit in unsigned long");
+	  __throw_overflow_error(_("bitset value is too large to fit in unsigned long"));
       return _M_w[0];
     }
 
@@ -466,7 +466,7 @@
       // localized to this single should-never-get-this-far function.
       _WordT&
       _M_getword(size_t) const
-      { __throw_out_of_range("bitset -- zero-length"); return *new _WordT; }
+      { __throw_out_of_range(_("bitset is zero-length")); return *new _WordT; }
 
       _WordT
       _M_hiword() const { return 0; }
@@ -862,7 +862,7 @@
     set(size_t __pos, bool __val = true)
     {
       if (__pos >= _Nb)
-	__throw_out_of_range("bitset -- set() argument too large");
+	__throw_out_of_range(_("bitset::set() argument too large"));
       return _Unchecked_set(__pos, __val);
     }
 
@@ -887,7 +887,7 @@
     reset(size_t __pos)
     {
       if (__pos >= _Nb)
-	__throw_out_of_range("bitset -- reset() argument too large");
+	__throw_out_of_range(_("bitset::reset() argument too large"));
       return _Unchecked_reset(__pos);
     }
 
@@ -911,7 +911,7 @@
     flip(size_t __pos)
     {
       if (__pos >= _Nb)
-	__throw_out_of_range("bitset -- flip() argument too large");
+	__throw_out_of_range(_("bitset::flip() argument too large"));
       return _Unchecked_flip(__pos);
     }
 
@@ -1014,7 +1014,7 @@
     test(size_t __pos) const
     {
       if (__pos >= _Nb)
-	__throw_out_of_range("bitset -- test() argument too large");
+	__throw_out_of_range(_("bitset::test() argument too large"));
       return _Unchecked_test(__pos);
     }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]