[DRE-commits] [ruby-gettext] 03/05: Add patch to wrap sentences without breaking words (Closes: #840878)
Hleb Valoshka
tsfgnu-guest at moszumanska.debian.org
Fri Aug 18 14:01:17 UTC 2017
This is an automated email from the git hooks/post-receive script.
tsfgnu-guest pushed a commit to branch master
in repository ruby-gettext.
commit 3f776f2314a7898f3ed0e6c9855015f5ef1c3e9d
Author: Hleb Valoshka <375gnu at gmail.com>
Date: Fri Aug 18 16:52:57 2017 +0300
Add patch to wrap sentences without breaking words (Closes: #840878)
---
.../patches/0005-Wrap-without-breaking-words.patch | 139 +++++++++++++++++++++
.../patches/0005-wrap-without-breaking-words.patch | 18 ---
debian/patches/series | 2 +-
3 files changed, 140 insertions(+), 19 deletions(-)
diff --git a/debian/patches/0005-Wrap-without-breaking-words.patch b/debian/patches/0005-Wrap-without-breaking-words.patch
new file mode 100644
index 0000000..52798e5
--- /dev/null
+++ b/debian/patches/0005-Wrap-without-breaking-words.patch
@@ -0,0 +1,139 @@
+From: Hleb Valoshka <375gnu at gmail.com>
+Date: Fri, 18 Aug 2017 16:51:12 +0300
+Subject: Wrap without breaking words
+
+New RegExp is provided by
+"Francesco Poli (wintermute)" <invernomuto at paranoici.org>
+
+in https://bugs.debian.org/cgi-bin/bugreport.cgi?att=2;bug=840878;filename=wrap-without-breaking-words.diff.gz;msg=5
+---
+ lib/gettext/po_entry.rb | 2 +-
+ test/test_po_entry.rb | 3 +--
+ test/tools/test_msgcat.rb | 8 ++++----
+ test/tools/test_msgmerge.rb | 16 ++++++++--------
+ test/tools/test_xgettext.rb | 8 ++++----
+ 5 files changed, 18 insertions(+), 19 deletions(-)
+
+diff --git a/lib/gettext/po_entry.rb b/lib/gettext/po_entry.rb
+index 1200933..fc6078d 100644
+--- a/lib/gettext/po_entry.rb
++++ b/lib/gettext/po_entry.rb
+@@ -491,7 +491,7 @@ module GetText
+ chunks << line
+ else
+ # TODO: use character width instead of the number of characters
+- line.scan(/.{1,#{max_line_width}}/m) do |chunk|
++ line.scan(/.{1,#{max_line_width}}\z|\S{#{max_line_width},}|.{1,#{max_line_width - 1}}\s/m) do |chunk|
+ chunks << chunk
+ end
+ end
+diff --git a/test/test_po_entry.rb b/test/test_po_entry.rb
+index 09302e0..7fac067 100644
+--- a/test/test_po_entry.rb
++++ b/test/test_po_entry.rb
+@@ -706,8 +706,7 @@ msgstr ""
+ assert_equal(<<-MESSAGE, format_message(message, :max_line_width => 4))
+ ""
+ "long"
+-" lin"
+-"e"
++"line"
+ MESSAGE
+ end
+
+diff --git a/test/tools/test_msgcat.rb b/test/tools/test_msgcat.rb
+index 9745588..24000c6 100644
+--- a/test/tools/test_msgcat.rb
++++ b/test/tools/test_msgcat.rb
+@@ -366,8 +366,8 @@ msgstr ""
+ def test_default
+ assert_equal(<<-PO, run_msgcat([@po]))
+ msgid ""
+-"long long long long long long long long long long long long long long long lin"
+-"e"
++"long long long long long long long long long long long long long long long "
++"line"
+ msgstr ""
+ PO
+ end
+@@ -385,8 +385,8 @@ msgstr ""
+ def test_wrap
+ assert_equal(<<-PO, run_msgcat([@po], "--wrap"))
+ msgid ""
+-"long long long long long long long long long long long long long long long lin"
+-"e"
++"long long long long long long long long long long long long long long long "
++"line"
+ msgstr ""
+ PO
+ end
+diff --git a/test/tools/test_msgmerge.rb b/test/tools/test_msgmerge.rb
+index b62941e..0492057 100644
+--- a/test/tools/test_msgmerge.rb
++++ b/test/tools/test_msgmerge.rb
+@@ -678,15 +678,15 @@ msgstr "Translated Good-bye. This translation is very long. Yes! Very long trans
+ assert_equal(<<-PO, File.read(@po_file_path))
+ #: hello.rb:1
+ msgid ""
+-"Hello very long line! This line is very long. Yes! This line is very long! Ver"
+-"y very long line!"
++"Hello very long line! This line is very long. Yes! This line is very long! "
++"Very very long line!"
+ msgstr ""
+
+ #: hello.rb:3
+ msgid "Good-bye"
+ msgstr ""
+-"Translated Good-bye. This translation is very long. Yes! Very long translation"
+-"!!!"
++"Translated Good-bye. This translation is very long. Yes! Very long "
++"translation!!!"
+ PO
+ end
+
+@@ -697,15 +697,15 @@ msgstr ""
+ assert_equal(<<-PO, File.read(@po_file_path))
+ #: hello.rb:1
+ msgid ""
+-"Hello very long line! This line is very long. Yes! This line is very l"
+-"ong! Very very long line!"
++"Hello very long line! This line is very long. Yes! This line is very "
++"long! Very very long line!"
+ msgstr ""
+
+ #: hello.rb:3
+ msgid "Good-bye"
+ msgstr ""
+-"Translated Good-bye. This translation is very long. Yes! Very long tra"
+-"nslation!!!"
++"Translated Good-bye. This translation is very long. Yes! Very long "
++"translation!!!"
+ PO
+ end
+
+diff --git a/test/tools/test_xgettext.rb b/test/tools/test_xgettext.rb
+index 471b8aa..679f6a8 100644
+--- a/test/tools/test_xgettext.rb
++++ b/test/tools/test_xgettext.rb
+@@ -527,8 +527,8 @@ Hello very long line! This line is very long. Yes! This line is very long! Very
+ #{header}
+ #: ../lib/xgettext.rb:1
+ msgid ""
+-"Hello very long line! This line is very long. Yes! This line is very long! Ver"
+-"y very long line!"
++"Hello very long line! This line is very long. Yes! This line is very long! "
++"Very very long line!"
+ msgstr ""
+ POT
+ end
+@@ -538,8 +538,8 @@ msgstr ""
+ #{header}
+ #: ../lib/xgettext.rb:1
+ msgid ""
+-"Hello very long line! This line is very long. Yes! This line is very l"
+-"ong! Very very long line!"
++"Hello very long line! This line is very long. Yes! This line is very "
++"long! Very very long line!"
+ msgstr ""
+ POT
+ end
diff --git a/debian/patches/0005-wrap-without-breaking-words.patch b/debian/patches/0005-wrap-without-breaking-words.patch
deleted file mode 100644
index 3fdc335..0000000
--- a/debian/patches/0005-wrap-without-breaking-words.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-From: "Francesco Poli \(wintermute\)" <invernomuto at paranoici.org>
-Date: Sat, 15 Oct 2016 19:50:34 +0200
-Subject: wrap without breaking words
-
----
-
-diff -ruN a/lib/gettext/po_entry.rb b/lib/gettext/po_entry.rb
---- a/lib/gettext/po_entry.rb 2016-08-08 17:56:05.000000000 +0200
-+++ b/lib/gettext/po_entry.rb 2016-10-15 18:56:49.824585840 +0200
-@@ -491,7 +491,7 @@
- chunks << line
- else
- # TODO: use character width instead of the number of characters
-- line.scan(/.{1,#{max_line_width}}/m) do |chunk|
-+ line.scan(/.{1,#{max_line_width}}\z|\S{#{max_line_width},}|.{1,#{max_line_width - 1}}\s/m) do |chunk|
- chunks << chunk
- end
- end
diff --git a/debian/patches/series b/debian/patches/series
index c92c0d5..ab30b14 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,4 +2,4 @@
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-wrap-without-breaking-words.patch
+0005-Wrap-without-breaking-words.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-gettext.git
More information about the Pkg-ruby-extras-commits
mailing list