debian/0000775000000000000000000000000012266324421007172 5ustar debian/ruby-tests.rb0000664000000000000000000000015712142270543011641 0ustar ENV['LC_ALL'] = 'C.UTF-8' require 'rake' app = Rake.application app.init app.load_rakefile app['test'].invoke debian/rxgettext.10000664000000000000000000000217112230331156011305 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH rxgettext 1 "2003-07-17" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rxgettext \- tool to extract translatable messages from Ruby scripts. .SH SYNOPSIS .B rxgettext input.rb \-o output.pot .br .SH DESCRIPTION Extract translatable string from given input Ruby script files. .SH SEE ALSO .BR gettext (1), /usr/share/doc/ruby-gettext/README.doc, http://www.yotabanana.com/hiki/ruby-gettext-translate.html .SH AUTHOR This manual page was converted by Tatsuki Sugiura , from README for the Debian project. debian/ruby-gettext.examples0000664000000000000000000000001212230331156013360 0ustar samples/* debian/copyright0000664000000000000000000003027512230331156011126 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: gettext Source: http://ruby-gettext.github.com/ Files: * Copyright: 2012 The ruby-gettext project 2001-2006 Masao Mutoh 2001,2002 Masahiro Sakai 2001,2002 Yasushi Shoji License: Ruby or GPL-2 or LGPL-3+ Files: Rakefile Copyright: 2012-2013 Kouhei Sutou 2012 Haruka Yoshihara 2005-2009 Masao Mutoh License: Ruby or GPL-2 Files: bin/rmsgfmt Copyright: 2012 Kouhei Sutou 2012 Haruka Yoshihara 2005-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: bin/rmsginit lib/gettext/tools/msginit.rb test/test_po_parser.rb test/tools/test_msginit.rb test/tools/test_po.rb Copyright: 2012 Kouhei Sutou 2012 Haruka Yoshihara License: Ruby or GPL-2 or LGPL-3+ Files: bin/rmsgmerge bin/rxgettext Copyright: 2012 Kouhei Sutou 2005-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext.rb Copyright: 2001-2010 Masao Mutoh 2001-2003 Masahiro Sakai License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/cgi.rb lib/gettext/tools/parser/erb.rb Copyright: 2005-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/locale_path.rb Copyright: 2001-2010 Masao Mutoh License: Ruby or LGPL-3+ Files: lib/gettext/mo.rb Copyright: 2012 Kouhei Sutou 2002-2009 Masao Mutoh 2001-2002 Masahiro Sakai License: Ruby or GPL-2 Files: lib/gettext/po.rb Copyright: 2012 Haruka Yoshihara License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/text_domain.rb Copyright: 2001-2009 Masao Mutoh 2001-2003 Masahiro Sakai License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/text_domain_group.rb Copyright: 2009 Masao Mutoh License: Ruby or LGPL-3+ Files: lib/gettext/text_domain_manager.rb Copyright: 2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/fixtures/_/one_line.rb test/fixtures/backslash.rb test/fixtures/ns_/custom.rb test/fixtures/s_/custom.rb test/run-test.rb Copyright: 2012 Kouhei Sutou License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools.rb Copyright: 2012 Kouhei Sutou 2005-2008 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/msgfmt.rb Copyright: 2012 Kouhei Sutou 2012 Haruka Yoshihara 2003-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/msgmerge.rb Copyright: 2012-2013 Haruka Yoshihara 2012 Kouhei Sutou 2005-2009 Masao Mutoh 2005,2006 speakillof License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/parser/glade.rb Copyright: 2013 Kouhei Sutou 2004,2005 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/parser/ruby.rb Copyright: 2013 Kouhei Sutou 2001-2009 Masao Mutoh 2005 speakillof 2001,2002 Yasushi Shoji License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/task.rb test/fixtures/_/one_new_line.rb Copyright: 2012-2013 Kouhei Sutou License: Ruby or LGPL-3+ Files: lib/gettext/po_entry.rb Copyright: 2012 Kouhei Sutou 2010 masone (Christian Felder) 2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/po_parser.rb Copyright: 2012 Kouhei Sutou 2003-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/tools/xgettext.rb Copyright: 2012 Haruka Yoshihara 2012 Kouhei Sutou 2001-2010 Masao Mutoh 2001,2002 Yasushi Shoji License: Ruby or GPL-2 or LGPL-3+ Files: lib/gettext/version.rb Copyright: 2012-2013 Kouhei Sutou 2005-2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: src/po_parser.ry Copyright: 2012-2013 Haruka Yoshihara 2012-2013 Kouhei Sutou 2002-2008 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/fixtures/_.rb Copyright: 2012 Haruka Yoshihara 2010 masone (Christian Felder) 2009 Vladimir Dobriakov 2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/test_po_entry.rb Copyright: 2012 Haruka Yoshihara 2012-2013 Kouhei Sutou 2010 masone (Christian Felder) 2009 Masao Mutoh License: Ruby or LGPL-3+ Files: test/fixtures/_/double_quote_in_double_quote.rb test/fixtures/_/double_quote_in_single_quote.rb test/fixtures/_/literal_concatenation_with_continuation_line.rb test/fixtures/_/middle_new_line.rb test/fixtures/_/multiple_lines_literal.rb test/fixtures/_/multiple_messages_in_same_line.rb test/fixtures/_/multiple_same_messages.rb test/fixtures/_/one_new_line.rb Copyright: 2013 Kouhei Sutou License: Ruby or LGPL-3+ Files: test/fixtures/n_.rb test/fixtures/p_.rb Copyright: 2010 masone (Christian Felder) 2009 Vladimir Dobriakov 2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/fixtures/np_.rb test/fixtures/ns_.rb test/fixtures/s_.rb Copyright: 2010 masone (Christian Felder) 2009 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/tools/parser/test_ruby.rb Copyright: 2012 Haruka Yoshihara 2012-2013 Kouhei Sutou 2010 masone (Christian Felder) 2009 Vladimir Dobriakov 2009-2010 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/test_parser.rb Copyright: 2012 Haruka Yoshihara 2012-2013 Kouhei Sutou 2010 masone (Christian Felder) 2009 Vladimir Dobriakov 2009-2010 Masao Mutoh License: Ruby or GPL-2 or LGPL-3+ Files: test/test_gettext.rb Copyright: 2012-2013 Kouhei Sutou 2009-2010 Masao Mutoh 2009 OZAWA Sakuro 2009 grosser License: Ruby or GPL-2 or LGPL-3+ Files: test/tools/test_msgmerge.rb Copyright: 2012 Kouhei Sutou 2010 Eddie Lau License: Ruby or GPL-2 or LGPL-3+ Files: test/tools/test_xgettext.rb Copyright: 2012-2013 Kouhei Sutou 2012 Haruka Yoshihara License: Ruby or GPL-2 or LGPL-3+ License: GPL-2 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: LGPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. . You should have received a copy of the GNU Lesser General Public License along with this program. If not, see . . On Debian systems the full text of the GNU Lesser General Public License version 3 can be found in the file `/usr/share/common-licenses/LGPL-3'. License: Ruby 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or executable form, provided that you do at least ONE of the following: . a) distribute the executables and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard executables non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under this terms. . They are gc.c(partly), utils.c(partly), regex.[ch], st.[ch] and some files under the ./missing directory. See each file for the copying condition. . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. Files: debian/*.1 Copyright: 2003 Tatsuki Sugiura 2013 Jérémy Bobbio License: GPL-2 Files: debian/* Copyright: These files ain't copyrighted License: public-domain These files are in Public Domain. debian/source/0000775000000000000000000000000012230331152010460 5ustar debian/source/format0000664000000000000000000000001411732135117011677 0ustar 3.0 (quilt) debian/ruby-gettext.manpages0000664000000000000000000000011112124702167013343 0ustar debian/rxgettext.1 debian/rmsgfmt.1 debian/rmsgmerge.1 debian/rmsginit.1 debian/changelog0000664000000000000000000003467012266324402011055 0ustar ruby-gettext (3.0.3-2ubuntu2) trusty; urgency=medium * Unset LANG, LANGUAGE, and LC_ALL before running the testsuite. -- Adam Conrad Fri, 17 Jan 2014 15:04:27 -0700 ruby-gettext (3.0.3-2ubuntu1) trusty; urgency=medium * Run tests with LC_ALL=C.UTF-8. -- Colin Watson Fri, 17 Jan 2014 17:49:50 +0000 ruby-gettext (3.0.3-2) unstable; urgency=medium * Team upload. * Stop build-depending in rubygems, since rubygems in now included in the supported versions of the Ruby interpreter * Refresh patches -- Cédric Boutillier Thu, 16 Jan 2014 17:38:30 +0100 ruby-gettext (3.0.3-1) unstable; urgency=medium * New upstream release (Closes: #726941, #726949). * Drop upstreamed patch 0006-Add-missing-require-in-lib-gettext-tools-xgettext.rb.patch. * Bump Standards-Version to 3.9.5 (no changes). * Build against gem2deb >= 0.5.0~ to add ruby2.0 and drop ruby1.8 support. -- Hleb Valoshka <375gnu@gmail.com> Thu, 26 Dec 2013 20:40:26 +0300 ruby-gettext (3.0.2-2) unstable; urgency=low [ Jérémy Bobbio ] * Team upload. * Add a patch to fix rxgettext. (Closes: #726797) [ Hleb Valoshka ] * Remove no more required lintian-overrides. * Fix manpage. -- Jérémy Bobbio Sat, 19 Oct 2013 14:58:05 +0200 ruby-gettext (3.0.2-1) unstable; urgency=low * Team upload. * New upstream release. + contains fix for crash when LANG or LC_ALL is set to xx_YY.utf8 instead of xx_YY.UTF-8 (mainly gdm3 users with old user accounts). Closes: #725496 + debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch: refreshed against new upstream version * force rebuilding lib/gettext/po_parser.rb from source (src/po_parser.ry) during build. Build-Depend on racc. -- Antonio Terceiro Sun, 06 Oct 2013 20:15:21 -0300 ruby-gettext (3.0.0-2) unstable; urgency=low * Team upload. * Restore compatibility with Ruby 1.8. (Closes: #721574) -- Jérémy Bobbio Mon, 02 Sep 2013 10:02:41 +0200 ruby-gettext (3.0.0-1) unstable; urgency=low [ Jérémy Bobbio ] * Team upload. * Imported Upstream version 3.0.0: - Fix double escapes of '\n' in rgettext. (Closes: #716916) * Refresh patches. * Update Homepage. * Drop support for Ruby 1.8, now unsupported upstream. * Adjust Depends and Build-Depends to match new upstream requierements. * Ship upstream examples. * Update debian/copyright. * Add a patch to fix test failures when there's no stdin. [ Hleb Valoshka ] * Update Vcs-* fields to use anonscm.debian.org. -- Jérémy Bobbio Sun, 01 Sep 2013 19:09:40 +0200 ruby-gettext (2.3.9-1) unstable; urgency=low * Team upload. * New upstream release: - Depends and Build-Depends on ruby-text instead of ruby-levenshtein. * Update debian/copyright after upstream clarifications. * Remove transitional packages. * Rework debian/patches to properly support upstream Rakefile. * Update Build-Depends to properly support upstream Rakefile. * Use rake to call upstream test suite. -- Jérémy Bobbio Tue, 07 May 2013 09:27:09 +0000 ruby-gettext (2.3.8-1) experimental; urgency=low * Team upload. * New upstream release. * Update debian/copyright. * Refresh patches: - 0001-Stop-propagating-comments-between-two-strings-in-Rub.patch: applied upstream. -- Jérémy Bobbio Fri, 05 Apr 2013 09:05:48 +0000 ruby-gettext (2.3.7-1) experimental; urgency=low * Team upload. * New upstream release. - Refresh patches against new upstream version. - Add ruby-levenshtein to Depends and Build-Depends. - Implement command-line options for rxgettext to fill in some fields. (Closes: #684187) - Add a patch to avoid adding test-unit-notify and test-unit-rr as Build-Depends. - Add ruby-rr directly to Build-Depends as we avoid test-unit-rr. - Run tests with UTF-8 as the default external encoding. - Update debian/copyright. - Add stub manpage for the new rmsginit(1). - No need to ship a data/ directory anymore. * Add git-buildpackage configuration. * Remove obsolete DM-Upload-Allowed field in debian/control. * Adjust manpage and description to reflect that rgettext has been renamed to rxgettext. * Update links in manpages. * Install doc/text/news.md as upstream changelog rather than as documentation. * Remove cruft in debian/rules. * Bump Standards-Version to 3.9.4, no changes required. * Add a patch to stop comment propagation in Ruby parser. (Closes: #684184) * Conflict with the current version of ruby-gettext-activerecord as it needs to be updated to cope with the API changes introduced in ruby-gettext 2.3. * Mention rmsginit in extended description. -- Jérémy Bobbio Fri, 29 Mar 2013 11:48:29 +0100 ruby-gettext (2.2.1-3) unstable; urgency=low [ Cédric Boutillier ] * Improve description. Thanks to Justin B. Rye (Closes: #682543) [ Hleb Valoshka ] * debian/patches - 0004-reset-last_comment-when-pomessage-is-stored.patch: rgettext won't skip translatable strings containing the hash symbol (Closes: #684182) - 0005-process-RubyToken-TkDSTRING-too.patch: rgettext won't copy comments for translators to all subsequent messages (Closes: #684184) * Fix lintian complaints. * Ensure tests are run. -- Hleb Valoshka <375gnu@gmail.com> Wed, 08 Aug 2012 21:42:52 +0300 ruby-gettext (2.2.1-2) unstable; urgency=low * Team upload. * Bump build dependency on gem2deb to >= 0.3.0~. -- Antonio Terceiro Sat, 30 Jun 2012 14:39:47 -0300 ruby-gettext (2.2.1-1) unstable; urgency=low * New upstream release (Closes: #572250) * Switch to gem2deb-based packaging. - source and binary packages renamed to ruby-gettext - transitional packages added - source format changed to 3.0 (quilt) - bump Standards-Version to 3.9.3 * debian/patches - (fix_loadpath_mangle): drop, included by upstream - (debian-changes-2.1.0-2.1): drop, unneded - (0001-proper-require-in-rgettext.patch): proper path to gettext/tools/rgettext in bin/rgettext (Closes: #591211) - (0002-do-not-require-rubygems-in-tests.patch): don't require rubygems in tests -- Hleb Valoshka <375gnu@gmail.com> Sun, 17 Jun 2012 14:24:18 +0300 libgettext-ruby (2.1.0-2.1) unstable; urgency=low * Non-maintainer upload. * debian/*.1 - Fix hyphens. * debian/compat - Update to 7. * debian/control - (Build-Depends): Update to debhelper 7.1. - (Homepage): New field. * debian/libgettext-ruby1.8.docs, debian/libgettext-ruby1.9.1.docs - Remove obsolete ChangeLog-1, the ChangeLog mentioned in Gunnar Wolf 'S patch in BTS is already installed by dh_installchangelog(1) program. (Closes: #580585). * debian/patches - (fix_loadpath_mangle): Add description. -- Jari Aalto Thu, 13 May 2010 16:51:50 +0300 libgettext-ruby (2.1.0-2) unstable; urgency=low * Fix unexpected $LOAD_PATH mangle (Closes: #577801) * Switch to dpkg-source 3.0 (quilt) format * One-shot uploader by ISHIKAWA Mutsumi (because main uploader Tach is on the VAC) request by Sugi. -- Tatsuki Sugiura Thu, 15 Apr 2010 07:59:49 +0900 libgettext-ruby (2.1.0-1.1) unstable; urgency=low * Adjust dependencies to allow use of ruby1.8 to provide irb1.8. (Closes: #576496) -- Jonathan Nieder Mon, 05 Apr 2010 01:44:07 -0500 libgettext-ruby (2.1.0-1) unstable; urgency=medium * New upstream release (Closes: #569869, #480692, #542925) * ruby-pkg-tools transition (Closes: #503163) -- Tatsuki Sugiura Thu, 18 Feb 2010 20:36:58 +0900 libgettext-ruby (1.93.0-1) unstable; urgency=low * New upstream release includes fix for locale issue (Closes: #490571, #506392, #492907) * Fix small typo in Depends field (Closes: #487885, #508490); Thanks for Salvatore Bonaccorso * Add Depends to locales package (Closes: #502576) -- Tatsuki Sugiura Wed, 18 Feb 2009 14:05:10 +0900 libgettext-ruby (1.91.0-2.1) unstable; urgency=low * Non-maintainer upload. * Fixed Rails 2.1 compatibility problem (Closes: #503955) -- Gunnar Wolf Thu, 30 Oct 2008 10:06:16 -0600 libgettext-ruby (1.91.0-2) unstable; urgency=low * support locale aliases (Closes: #492907) -- Tatsuki Sugiura Sat, 16 Aug 2008 12:19:37 +0900 libgettext-ruby (1.91.0-1.1) unstable; urgency=high * Non-maintainer upload. * Install ruby1.9 libs in /usr/lib/ruby/1.9.0, not /usr/lib/ruby/1.9. Closes: #484619. * chmod a-x instead of chmod -x to fix build failure. -- Lucas Nussbaum Sun, 13 Jul 2008 20:55:13 +0200 libgettext-ruby (1.91.0-1) unstable; urgency=low * New upstream release (Closes: #481136) -- Tatsuki Sugiura Thu, 22 May 2008 18:55:00 +0900 libgettext-ruby (1.90.0-2) unstable; urgency=low * apply patch to duplicate object return string (Closes: #473193) * add conflicts with apt-listbugs (<= 0.0.86) (Closes: #472580) * build under UTF-8 encoding for ruby1.9 (Closes: #470268) Thanks: Antonio Terceiro -- Tatsuki Sugiura Mon, 31 Mar 2008 03:38:38 +0900 libgettext-ruby (1.90.0-1) unstable; urgency=low * New upstream release * Change architecture to all * fix *.po file encoding in patch (Closes: #328962) -- Tatsuki Sugiura Wed, 27 Feb 2008 17:41:01 +0900 libgettext-ruby (1.10.0-2) unstable; urgency=low * add conflict with libgettext-ruby1.8 on libgettext-ruby-data to avoid install problem. -- Tatsuki Sugiura Tue, 13 Nov 2007 19:15:36 +0900 libgettext-ruby (1.10.0-1) unstable; urgency=medium * New upstream release * Added irb to depends (Closes: #449574) -- Tatsuki Sugiura Thu, 25 Oct 2007 04:14:30 +0900 libgettext-ruby (1.9.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Mon, 14 May 2007 03:51:58 +0900 libgettext-ruby (1.7.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Sun, 23 Jul 2006 00:08:33 +0900 libgettext-ruby (1.6.0-1) unstable; urgency=low * New upstream release * apply rails gettext patch -- Tatsuki Sugiura Sun, 18 Jun 2006 03:43:27 +0900 libgettext-ruby (1.5.0-1) unstable; urgency=low * New upstream release * Remove requires rubygem from activerecord support (Closes: #354016) -- Tatsuki Sugiura Wed, 7 Jun 2006 09:42:36 +0900 libgettext-ruby (1.1.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Wed, 4 Jan 2006 23:19:30 +0900 libgettext-ruby (1.0.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Fri, 28 Oct 2005 15:34:00 +0900 libgettext-ruby (0.9.0-1) unstable; urgency=high * New upstream release -- Tatsuki Sugiura Sun, 15 May 2005 19:05:10 +0900 libgettext-ruby (0.8.1-2) unstable; urgency=low * fix broken dependency of libgettext-ruby1.6 (Closes: #309002) -- Tatsuki Sugiura Thu, 7 Apr 2005 19:59:52 +0900 libgettext-ruby (0.8.1-1) unstable; urgency=low * New upstream release (Closes: #302582) -- Tatsuki Sugiura Wed, 30 Mar 2005 17:35:28 +0900 libgettext-ruby (0.8.0-1) unstable; urgency=high * New upstream release * fix; install directory (Closes: #279966) -- Tatsuki Sugiura Sun, 7 Nov 2004 02:18:45 +0900 libgettext-ruby (0.7.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Sat, 30 Oct 2004 15:12:13 +0900 libgettext-ruby (0.6.1-2) unstable; urgency=high * fix interpreter dependency for libgettext-ruby-util (Closes: #275716) -- Tatsuki Sugiura Tue, 19 Oct 2004 13:30:54 +0900 libgettext-ruby (0.6.1-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Fri, 23 Jul 2004 00:50:28 +0900 libgettext-ruby (0.6.0-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Mon, 5 Jul 2004 14:07:34 +0900 libgettext-ruby (0.5.5-2) unstable; urgency=low * debian/rules has been fiexed for libgettext-ruby-util has no *.mo files (Closes: #253710) -- Tatsuki Sugiura Fri, 11 Jun 2004 23:59:01 +0900 libgettext-ruby (0.5.5-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Tue, 25 May 2004 11:06:22 +0900 libgettext-ruby (0.5.4-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Mon, 23 Feb 2004 22:50:26 +0900 libgettext-ruby (0.5.3-1) unstable; urgency=low * New upstream release -- Tatsuki Sugiura Thu, 25 Dec 2003 06:31:05 +0900 libgettext-ruby (0.5.1-9) unstable; urgency=low * fixed in build-depends; racc has been added; (Closes: #218764) -- Tatsuki Sugiura Tue, 4 Nov 2003 14:55:05 +0900 libgettext-ruby (0.5.1-8) unstable; urgency=low * fixed in debian/rules; build libgettext-ruby-util in binary-indep target. (Closes: #216491) -- Tatsuki Sugiura Mon, 20 Oct 2003 16:04:59 +0900 libgettext-ruby (0.5.1-7) unstable; urgency=low * Dependency of libgettext-ruby-util has been fixed. -- Tatsuki Sugiura Sat, 27 Sep 2003 00:56:18 +0900 libgettext-ruby (0.5.1-6) unstable; urgency=low *.mo files has been moved to util package. -- Tatsuki Sugiura Sat, 27 Sep 2003 00:54:52 +0900 libgettext-ruby (0.5.1-5) unstable; urgency=low * fix in build script; "ruby: command not found" (Closes: #211277) -- Tatsuki Sugiura Sun, 21 Sep 2003 00:24:30 +0900 libgettext-ruby (0.5.1-4) unstable; urgency=low * install documents and examples in both version. -- Tatsuki Sugiura Fri, 12 Sep 2003 10:56:30 +0900 libgettext-ruby (0.5.1-3) unstable; urgency=low * upload official debian archive (Closes: #203592) * package has been splitted for ruby 1.6 & 1.8 -- Tatsuki Sugiura Mon, 8 Sep 2003 16:58:32 +0900 libgettext-ruby (0.5.1-2) unstable; urgency=low * fix URL in debian/watch * add racc to build-depends -- Tatsuki Sugiura Wed, 23 Jul 2003 20:19:28 +0900 libgettext-ruby (0.5.1-1) unstable; urgency=low * Initial Release. -- Tatsuki Sugiura Thu, 17 Jul 2003 03:58:25 +0900 debian/compat0000664000000000000000000000000211732135117010367 0ustar 7 debian/rules0000775000000000000000000000064012266324276010262 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=ruby --with ruby override_dh_auto_install: # force rebuilding lib/gettext/po_parser.rb from source touch src/po_parser.ry # avoid rebuilding samples/**/*.mo though find samples/ -name '*.mo' -exec touch '{}' ';' # do the usual thing LANG= LANGUAGE= LC_ALL= dh_auto_install override_dh_installchangelogs: dh_installchangelogs doc/text/news.md -O--buildsystem=ruby debian/control0000664000000000000000000000270712266260304010602 0ustar Source: ruby-gettext Section: ruby Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Ruby Extras Maintainers Uploaders: Hleb Valoshka <375gnu@gmail.com> Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.5.0~), racc, rake, ruby-locale (>= 2.0.5), ruby-rr, ruby-test-unit (>= 2.5.4), ruby-text, yard Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-ruby-extras/ruby-gettext.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-ruby-extras/ruby-gettext.git;a=summary Homepage: http://ruby-gettext.github.io/ XS-Ruby-Versions: all Package: ruby-gettext Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ruby | ruby-interpreter, ruby-locale (>= 2.0.5), ruby-text, ${misc:Depends}, ${shlibs:Depends} Conflicts: ruby-gettext-activerecord (<= 2.1.0-5~) Description: gettext for Ruby This Ruby package is a localization library and toolset modeled after GNU gettext, and with a similar simple API. . It provides: * rxgettext - creates gettext-compatible PO files from Ruby scripts; * rmsginit - create a new PO file with user's environment and input; * rmsgfmt - creates a MO file from a PO file; * rmsgmerge - extracts translatable strings from Ruby scripts. debian/rmsgmerge.10000664000000000000000000000245512124702167011252 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH rmsgmerge 1 "2006-01-04" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rmsgmerge \- Extract translatable string from given input ruby script files. .SH SYNOPSIS .B rmsgmerge def.po ref.pot [\-o output.pot] .br .SH DESCRIPTION Merges two Uniforum style .po files together. The def.po file is an existing PO file with translations. The ref.pot file is the last created PO file with up-to-date source references. ref.pot is generally created by rxgettext. .SH SEE ALSO .BR msgmerge (1), /usr/share/doc/ruby-gettext/README.rdoc, http://www.yotabanana.com/hiki/ruby-gettext-translate.html .SH AUTHOR This manual page was converted by Tatsuki Sugiura , from README for the Debian project. debian/rmsgfmt.10000664000000000000000000000215412124702167010735 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH rmsgfmt 1 "2003-07-17" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rmsgfmt \- compile message catalog to binary format .SH SYNOPSIS .B rmsgfmt input.po [ \-o output.mo ] .br .SH DESCRIPTION Generate binary message catalog from textual translation description. .SH SEE ALSO .BR msgfmt (1), /usr/share/doc/ruby-gettext/README.rdoc, http://www.yotabanana.com/hiki/ruby-gettext-translate.html .SH AUTHOR This manual page was converted by Tatsuki Sugiura , from README for the Debian project. debian/watch0000664000000000000000000000014311732135117010220 0ustar version=3 http://pkg-ruby-extras.alioth.debian.org/cgi-bin/gemwatch/gettext .*/gettext-(.*).tar.gz debian/ruby-gettext.docs0000664000000000000000000000001412124702167012502 0ustar README.rdoc debian/gbp.conf0000664000000000000000000000003612124702167010610 0ustar [DEFAULT] pristine-tar = True debian/patches/0000775000000000000000000000000012266005231010614 5ustar debian/patches/0002-Make-test-unit-notify-and-test-unit-rr-optional-to-r.patch0000664000000000000000000000152212124702167024153 0ustar From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= Date: Sat, 16 Mar 2013 16:21:28 +0000 Subject: Make test-unit-notify and test-unit-rr optional to run the tests --- test/run-test.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/run-test.rb b/test/run-test.rb index 48d7242..24bfee6 100755 --- a/test/run-test.rb +++ b/test/run-test.rb @@ -29,8 +29,20 @@ $LOAD_PATH.unshift(lib_dir) $LOAD_PATH.unshift(test_dir) require "test-unit" -require "test/unit/notify" -require "test/unit/rr" +begin + require "test/unit/notify" +rescue LoadError + # Let's do without notifications +end +begin + require "test/unit/rr" +rescue LoadError + # Include RR manually + require "rr" + class Test::Unit::TestCase + include RR::Adapters::TestUnit + end +end require "gettext-test-utils" debian/patches/0004-Use-system-racc-in-Rakefile.patch0000664000000000000000000000111712230331156017325 0ustar From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= Date: Tue, 7 May 2013 09:43:01 +0000 Subject: Use system racc in Rakefile --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 7b5a53c..de6705e 100644 --- a/Rakefile +++ b/Rakefile @@ -39,7 +39,7 @@ end po_parser_ry_path = "src/po_parser.ry" file po_parser_rb_path => po_parser_ry_path do - racc = File.join(Gem.bindir, "racc") + racc = "/usr/bin/racc" tempfile = Tempfile.new("gettext-po-parser") ruby(racc, "-g", po_parser_ry_path, "-o", tempfile.path) debian/patches/0003-Do-not-use-Bundler-in-Rakefile.patch0000664000000000000000000000127412230331156017667 0ustar From: Hleb Valoshka <375GNU@Gmail.COM> Date: Sun, 17 Jun 2012 16:12:33 +0300 Subject: Do not use Bundler in Rakefile --- Rakefile | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Rakefile b/Rakefile index 77ef00e..7b5a53c 100644 --- a/Rakefile +++ b/Rakefile @@ -21,18 +21,8 @@ require "rubygems" require "yard" require "gettext/version" require "gettext/tools/task" -require "bundler/gem_helper" -class Bundler::GemHelper - undef_method :version_tag - def version_tag - version - end -end - -helper = Bundler::GemHelper.new(base_dir) -helper.install -spec = helper.gemspec +spec = Gem::Specification.load('gettext.gemspec') task :default => :test debian/patches/0005-Restore-compatibility-with-Ruby-1.8.patch0000664000000000000000000003656112266005231020720 0ustar From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= Date: Mon, 2 Sep 2013 09:48:15 +0200 Subject: Restore compatibility with Ruby 1.8 --- lib/gettext/core_ext/iconv.rb | 110 ++++++++++++++++++++++++++++++++++++++ lib/gettext/core_ext/string.rb | 91 +++++++++++++++++++++++++++++++ lib/gettext/locale_path.rb | 1 + lib/gettext/mo.rb | 54 +++++++++++++------ lib/gettext/tools/parser/erb.rb | 16 +++--- lib/gettext/tools/parser/ruby.rb | 7 ++- lib/gettext/tools/xgettext.rb | 6 ++- test/gettext-test-utils.rb | 23 ++++++++ test/test_parser.rb | 2 + test/test_po_parser.rb | 4 ++ test/tools/parser/test_ruby.rb | 2 + test/tools/test_xgettext.rb | 24 +++++---- 12 files changed, 304 insertions(+), 36 deletions(-) create mode 100644 lib/gettext/core_ext/iconv.rb create mode 100644 lib/gettext/core_ext/string.rb --- /dev/null +++ b/lib/gettext/core_ext/iconv.rb @@ -0,0 +1,110 @@ +# encoding: utf-8 +=begin + iconv.rb - Pseudo Iconv class. Supports Iconv.iconv, Iconv.conv. + + For Matz Ruby: + If you don't have iconv but glib2, this library uses glib2 iconv functions. + + For JRuby: + Use Java String class to convert strings. + + Copyright (C) 2004-2009 Masao Mutoh + + You may redistribute it and/or modify it under the same + license terms as Ruby or LGPL. +=end + +begin + require 'iconv.so' +rescue LoadError + # Pseudo Iconv class + # + # ==== For Matz Ruby: + # If you don't have iconv but Ruby/GLib2, this library uses Ruby/GLib2's + # iconv functions. + # + # Ruby/GLib is a module which is provided from Ruby-GNOME2 Project. + # You can get binaries for Win32(One-Click Ruby Installer). + # + # ==== For JRuby: + # Use Java String class to convert strings. + class Iconv + module Failure; end + class InvalidEncoding < ArgumentError; include Failure; end + class IllegalSequence < ArgumentError; include Failure; end + class InvalidCharacter < ArgumentError; include Failure; end + + if RUBY_PLATFORM =~ /java/ + def self.conv(to, from, str) + raise InvalidCharacter, "the 3rd argument is nil" unless str + begin + str = java.lang.String.new(str.unpack("C*").to_java(:byte), from) + str.getBytes(to).to_ary.pack("C*") + rescue java.io.UnsupportedEncodingException + raise InvalidEncoding + end + end + else + begin + require 'glib2' + + def self.check_glib_version?(major, minor, micro) # :nodoc: + (GLib::BINDING_VERSION[0] > major || + (GLib::BINDING_VERSION[0] == major && + GLib::BINDING_VERSION[1] > minor) || + (GLib::BINDING_VERSION[0] == major && + GLib::BINDING_VERSION[1] == minor && + GLib::BINDING_VERSION[2] >= micro)) + end + + if check_glib_version?(0, 11, 0) + # This is a function equivalent of Iconv.iconv. + # * to: encoding name for destination + # * from: encoding name for source + # * str: strings to be converted + # * Returns: Returns an Array of converted strings. + def self.conv(to, from, str) + begin + GLib.convert(str, to, from) + rescue GLib::ConvertError => e + case e.code + when GLib::ConvertError::NO_CONVERSION + raise InvalidEncoding.new(str) + when GLib::ConvertError::ILLEGAL_SEQUENCE + raise IllegalSequence.new(str) + else + raise InvalidCharacter.new(str) + end + end + end + else + def self.conv(to, from, str) # :nodoc: + begin + GLib.convert(str, to, from) + rescue + raise IllegalSequence.new(str) + end + end + end + rescue LoadError + def self.conv(to, from, str) # :nodoc: + warn "Iconv was not found." if $DEBUG + str + end + end + end + def self.iconv(to, from, str) + conv(to, from, str).split(//) + end + end +end + +if __FILE__ == $0 + puts Iconv.iconv("EUC-JP", "UTF-8", "ほげ").join + begin + puts Iconv.iconv("EUC-JP", "EUC-JP", "ほげ").join + rescue Iconv::Failure + puts $! + puts $!.class + end +end --- /dev/null +++ b/lib/gettext/core_ext/string.rb @@ -0,0 +1,91 @@ +# encoding: utf-8 + +=begin + string.rb - Extension for String. + + Copyright (C) 2005-2009 Masao Mutoh + + You may redistribute it and/or modify it under the same + license terms as Ruby or LGPL. +=end + +# Extension for String class. This feature is included in Ruby 1.9 or later but not occur TypeError. +# +# String#% method which accept "named argument". The translator can know +# the meaning of the msgids using "named argument" instead of %s/%d style. +class String + + unless instance_methods.find {|m| m.to_s == 'bytesize'} + # For older ruby (such as ruby-1.8.5) + alias :bytesize :size + end + + begin + formatted = "%{key}" % {:key => "value"} + raise ArgumentError if formatted != "value" + rescue ArgumentError + alias :_old_format_m :% # :nodoc: + + PERCENT_MATCH_RE = Regexp.union( + /%%/, + /%\{(.+?)\}/, + /%<(.+?)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ + ) + + # call-seq: + # %(arg) + # %(hash) + # + # Format - Uses str as a format specification, and returns the result of applying it to arg. + # If the format specification contains more than one substitution, then arg must be + # an Array containing the values to be substituted. See Kernel::sprintf for details of the + # format string. This is the default behavior of the String class. + # * arg: an Array or other class except Hash. + # * Returns: formatted String + # + # (e.g.) "%s, %s" % ["Masao", "Mutoh"] + # + # Also you can use a Hash as the "named argument". This is recommanded way for Ruby-GetText + # because the translators can understand the meanings of the msgids easily. + # * hash: {:key1 => value1, :key2 => value2, ... } + # * Returns: formatted String + # + # (e.g.) + # For strings. + # "%{firstname}, %{familyname}" % {:firstname => "Masao", :familyname => "Mutoh"} + # + # With field type to specify format such as d(decimal), f(float),... + # "%d, %.1f" % {:age => 10, :weight => 43.4} + def %(args) + if args.kind_of?(Hash) + ret = dup + ret.gsub!(PERCENT_MATCH_RE) {|match| + if match == '%%' + '%' + elsif $1 + key = $1.to_sym + args.has_key?(key) ? args[key] : match + elsif $2 + key = $2.to_sym + args.has_key?(key) ? sprintf("%#{$3}", args[key]) : match + end + } + ret + else + ret = gsub(/%([{<])/, '%%\1') + begin + ret._old_format_m(args) + rescue ArgumentError => e + if $DEBUG + $stderr.puts " The string:#{ret}" + $stderr.puts " args:#{args.inspect}" + puts e.backtrace + else + raise ArgumentError, e.message + end + end + end + end + end +end + --- a/lib/gettext/locale_path.rb +++ b/lib/gettext/locale_path.rb @@ -11,6 +11,7 @@ =end require 'rbconfig' +require 'gettext/core_ext/string' module GetText # Treats locale-path for mo-files. --- a/lib/gettext/mo.rb +++ b/lib/gettext/mo.rb @@ -43,8 +43,12 @@ :trans_sysdep_tab_offset end - MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde".force_encoding("ASCII-8BIT") - MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95".force_encoding("ASCII-8BIT") + MAGIC_BIG_ENDIAN = "\x95\x04\x12\xde" + MAGIC_LITTLE_ENDIAN = "\xde\x12\x04\x95" + if "".respond_to?(:force_encoding) + MAGIC_BIG_ENDIAN.force_encoding("ASCII-8BIT") + MAGIC_LITTLE_ENDIAN.force_encoding("ASCII-8BIT") + end def self.open(arg = nil, output_charset = nil) result = self.new(output_charset) @@ -308,24 +312,40 @@ attr_reader :charset, :nplurals, :plural private - def convert_encoding(string, original_string) - return string if @output_charset.nil? or @charset.nil? + if "".respond_to?(:encode) + def convert_encoding(string, original_string) + return string if @output_charset.nil? or @charset.nil? + + if Encoding.find(@output_charset) == Encoding.find(@charset) + string.force_encoding(@output_charset) + return string + end - if Encoding.find(@output_charset) == Encoding.find(@charset) - string.force_encoding(@output_charset) - return string + begin + string.encode(@output_charset, @charset) + rescue EncodingError + if $DEBUG + warn "@charset = ", @charset + warn "@output_charset = ", @output_charset + warn "msgid = ", original_string + warn "msgstr = ", string + end + string + end end - - begin - string.encode(@output_charset, @charset) - rescue EncodingError - if $DEBUG - warn "@charset = ", @charset - warn "@output_charset = ", @output_charset - warn "msgid = ", original_string - warn "msgstr = ", string + else + require 'gettext/core_ext/iconv' + def convert_encoding(string, original_string) + begin + Iconv.conv(@output_charset, @charset, string) + rescue Iconv::Failure + if $DEBUG + warn "@charset = ", @charset + warn "@output_charset = ", @output_charset + warn "msgid = ", original_string + warn "msgstr = ", str + end end - string end end --- a/lib/gettext/tools/parser/erb.rb +++ b/lib/gettext/tools/parser/erb.rb @@ -64,13 +64,15 @@ content = IO.read(@path) src = ERB.new(content).src - # Force the src encoding back to the encoding in magic comment - # or original content. - encoding = detect_encoding(src) || content.encoding - src.force_encoding(encoding) + if src.respond_to?(:encode) + # Force the src encoding back to the encoding in magic comment + # or original content. + encoding = detect_encoding(src) || content.encoding + src.force_encoding(encoding) - # Remove magic comment prepended by erb in Ruby 1.9. - src = src.gsub(MAGIC_COMMENT, "") + # Remove magic comment prepended by erb in Ruby 1.9. + src = src.gsub(MAGIC_COMMENT, "") + end RubyParser.new(@path, @options).parse_source(src) end --- a/lib/gettext/tools/parser/ruby.rb +++ b/lib/gettext/tools/parser/ruby.rb @@ -211,13 +211,16 @@ def parse source = IO.read(@path) - encoding = detect_encoding(source) || source.encoding - source.force_encoding(encoding) + if source.respond_to?(:encode) + encoding = detect_encoding(source) || source.encoding + source.force_encoding(encoding) + end parse_source(source) end def detect_encoding(source) + return nil unless source.respond_to?(:force_encoding) binary_source = source.dup.force_encoding("ASCII-8BIT") if /\A.*coding\s*[=:]\s*([[:alnum:]\-_]+)/ =~ binary_source $1.gsub(/-(?:unix|mac|dos)\z/, "") --- a/test/gettext-test-utils.rb +++ b/test/gettext-test-utils.rb @@ -22,6 +22,10 @@ require "tempfile" require "time" +unless String.method_defined?(:encode) + require "iconv" +end + require "gettext" module GetTextTestUtils @@ -41,4 +45,23 @@ def teardown_tmpdir FileUtils.rm_rf(@tmpdir, :secure => true) if @tmpdir end + + def need_encoding + unless defined?(Encoding) + omit("This test needs encoding.") + end + end + + def set_encoding(string, encoding) + return unless string.respond_to?(:force_encoding) + string.force_encoding(encoding) + end + + def encode(string, encoding) + if string.respond_to?(:encode) + string.encode(encoding) + else + Iconv.iconv(encoding, "UTF-8", string).join("") + end + end end --- a/test/test_parser.rb +++ b/test/test_parser.rb @@ -133,6 +133,8 @@ include GetTextTestUtils def test_detect_encoding + need_encoding + euc_file = Tempfile.new("euc-jp.rhtml") euc_file.open euc_file.puts("<%#-*- coding: euc-jp -*-%>") --- a/test/test_po_parser.rb +++ b/test/test_po_parser.rb @@ -306,6 +306,8 @@ end end + if defined?(Encoding) + class TestHeader < self class TestEncoding < self def test_known @@ -337,4 +339,6 @@ end end end + + end end --- a/test/tools/parser/test_ruby.rb +++ b/test/tools/parser/test_ruby.rb @@ -68,6 +68,8 @@ end class TestDetectEncoding < self + setup :need_encoding + def test_ascii_and_hyphen assert_equal("euc-jp", detect_encoding("# coding: euc-jp")) end --- a/test/tools/test_xgettext.rb +++ b/test/tools/test_xgettext.rb @@ -120,6 +120,8 @@ class TestEncoding < self def test_different_encoding_from_current_locale + need_encoding + rhtml = <<-EOR <%#-*- coding: sjis -*-%> @@ -132,34 +134,36 @@ EOR File.open(@rhtml_file_path, "w") do |rhtml_file| - rhtml_file.puts(rhtml.encode("sjis")) + rhtml_file.puts(encode(rhtml, "sjis")) end @xgettext.run("--output", @pot_file_path, @rhtml_file_path) encoding = "UTF-8" pot_content = File.read(@pot_file_path) - pot_content.force_encoding(encoding) + set_encoding(pot_content, encoding) expected_content = <<-EOP #{header} #: ../templates/xgettext.rhtml:7 msgid "わたし" msgstr "" EOP - expected_content = expected_content.encode(encoding) + expected_content = encode(expected_content, encoding) assert_equal(expected_content, pot_content) end def test_multiple_encodings + need_encoding + File.open(@rb_file_path, "w") do |rb_file| - rb_file.puts(<<-EOR.encode("euc-jp")) + rb_file.puts(encode(<<-EOR, "euc-jp")) # -*- coding: euc-jp -*- _("こんにちは") EOR end File.open(@rhtml_file_path, "w") do |rhtml_file| - rhtml_file.puts(<<-EOR.encode("cp932")) + rhtml_file.puts(encode(<<-EOR, "cp932")) <%# -*- coding: cp932 -*-%>

<%= _("わたし") %>

EOR @@ -169,7 +173,7 @@ encoding = "UTF-8" pot_content = File.read(@pot_file_path) - pot_content.force_encoding(encoding) + set_encoding(pot_content, encoding) expected_content = <<-EOP #{header} #: ../lib/xgettext.rb:2 @@ -180,7 +184,7 @@ msgid "わたし" msgstr "" EOP - expected_content = expected_content.encode(encoding) + expected_content = encode(expected_content, encoding) assert_equal(expected_content, pot_content) end end @@ -351,13 +355,15 @@ end def test_to_code + need_encoding + output_encoding = "EUC-JP" pot_content = generate(<<-EOR, "--output-encoding", output_encoding) # -*- coding: utf-8 -*- _("わたし") EOR - pot_content.force_encoding(output_encoding) + set_encoding(pot_content, output_encoding) options = {:to_code => output_encoding} expected_pot = <<-EOP @@ -366,7 +372,7 @@ msgid "わたし" msgstr "" EOP - expected_pot = expected_pot.encode(output_encoding) + expected_pot = encode(expected_pot, output_encoding) assert_equal(expected_pot, pot_content) end debian/patches/0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch0000664000000000000000000000100112266005220024216 0ustar From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Bobbio?= Date: Sun, 1 Sep 2013 19:15:42 +0200 Subject: Properly handle a closed stdin when prompting in msginit --- lib/gettext/tools/msginit.rb | 2 ++ 1 file changed, 2 insertions(+) --- a/lib/gettext/tools/msginit.rb +++ b/lib/gettext/tools/msginit.rb @@ -234,6 +234,8 @@ end def prompt(message, default) + return default if $stdin.eof? + print(message) print(" [#{default}]") if default print(": ") debian/patches/series0000664000000000000000000000040012257104746012036 0ustar 0001-Properly-handle-a-closed-stdin-when-prompting-in-msg.patch 0002-Make-test-unit-notify-and-test-unit-rr-optional-to-r.patch 0003-Do-not-use-Bundler-in-Rakefile.patch 0004-Use-system-racc-in-Rakefile.patch 0005-Restore-compatibility-with-Ruby-1.8.patch debian/rmsginit.10000664000000000000000000000224312124702167011111 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH rmsginit 1 "2013-01-11" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME rmsginit \- create a new .po file with user's environment and input .SH SYNOPSIS .B rmsginit [ \-i input.mo ] [ \-o output.mo ] [ \-l cc ] .br .SH DESCRIPTION Create a new .po file from initializing .pot file with user's environment and input. .SH SEE ALSO .BR msginit (1), /usr/share/doc/ruby-gettext/README.rdoc, http://www.yotabanana.com/hiki/ruby-gettext-translate.html .SH AUTHOR This manual page was converted by Jérémy Bobbio , from README for the Debian project.