gettext 2.3.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardopts +1 -0
- data/README.rdoc +28 -23
- data/Rakefile +29 -21
- data/doc/text/news.md +57 -0
- data/gettext.gemspec +1 -1
- data/lib/gettext.rb +13 -29
- data/lib/gettext/cgi.rb +1 -1
- data/lib/gettext/{runtime/class_info.rb → class_info.rb} +1 -1
- data/lib/gettext/{runtime/locale_path.rb → locale_path.rb} +1 -2
- data/lib/gettext/{runtime/mo.rb → mo.rb} +18 -33
- data/lib/gettext/{tools/po.rb → po.rb} +1 -1
- data/lib/gettext/{tools/po_entry.rb → po_entry.rb} +8 -4
- data/lib/gettext/{tools/poparser.rb → po_parser.rb} +41 -44
- data/lib/gettext/{runtime/textdomain.rb → text_domain.rb} +6 -16
- data/lib/gettext/text_domain_group.rb +26 -0
- data/lib/gettext/{runtime/textdomain_manager.rb → text_domain_manager.rb} +40 -40
- data/lib/gettext/tools.rb +1 -182
- data/lib/gettext/tools/msgfmt.rb +1 -1
- data/lib/gettext/tools/msginit.rb +1 -1
- data/lib/gettext/tools/msgmerge.rb +2 -221
- data/lib/gettext/tools/parser/erb.rb +49 -30
- data/lib/gettext/tools/parser/glade.rb +44 -36
- data/lib/gettext/tools/parser/ruby.rb +126 -37
- data/lib/gettext/tools/task.rb +225 -0
- data/lib/gettext/tools/xgettext.rb +25 -28
- data/lib/gettext/version.rb +1 -1
- data/locale/bg/LC_MESSAGES/gettext.mo +0 -0
- data/locale/bs/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ca/LC_MESSAGES/gettext.mo +0 -0
- data/locale/cs/LC_MESSAGES/gettext.mo +0 -0
- data/locale/de/LC_MESSAGES/gettext.mo +0 -0
- data/locale/el/LC_MESSAGES/gettext.mo +0 -0
- data/locale/eo/LC_MESSAGES/gettext.mo +0 -0
- data/locale/es/LC_MESSAGES/gettext.mo +0 -0
- data/locale/et/LC_MESSAGES/gettext.mo +0 -0
- data/locale/fr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/hr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/hu/LC_MESSAGES/gettext.mo +0 -0
- data/locale/it/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ja/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ko/LC_MESSAGES/gettext.mo +0 -0
- data/locale/lv/LC_MESSAGES/gettext.mo +0 -0
- data/locale/nb/LC_MESSAGES/gettext.mo +0 -0
- data/locale/nl/LC_MESSAGES/gettext.mo +0 -0
- data/locale/pt_BR/LC_MESSAGES/gettext.mo +0 -0
- data/locale/ru/LC_MESSAGES/gettext.mo +0 -0
- data/locale/sr/LC_MESSAGES/gettext.mo +0 -0
- data/locale/sv/LC_MESSAGES/gettext.mo +0 -0
- data/locale/uk/LC_MESSAGES/gettext.mo +0 -0
- data/locale/vi/LC_MESSAGES/gettext.mo +0 -0
- data/locale/zh/LC_MESSAGES/gettext.mo +0 -0
- data/locale/zh_TW/LC_MESSAGES/gettext.mo +0 -0
- data/po/gettext.pot +171 -97
- data/samples/hello.rb +3 -2
- data/samples/hello2.rb +2 -1
- data/samples/hello_gtk2.rb +4 -1
- data/samples/hello_gtk_builder.rb +32 -0
- data/samples/hello_gtk_builder.ui +46 -0
- data/samples/hello_noop.rb +2 -1
- data/samples/hello_plural.rb +2 -1
- data/samples/hello_tk.rb +2 -1
- data/src/{poparser.ry → po_parser.ry} +31 -35
- data/test/fixtures/N_.rb +1 -1
- data/test/fixtures/_/double_quote_in_double_quote.rb +32 -0
- data/test/fixtures/_/double_quote_in_single_quote.rb +32 -0
- data/test/fixtures/_/literal_concatenation_with_continuation_line.rb +36 -0
- data/test/fixtures/_/middle_new_line.rb +32 -0
- data/test/fixtures/_/multiple_lines_literal.rb +35 -0
- data/test/fixtures/_/multiple_messages_in_same_line.rb +32 -0
- data/test/fixtures/_/multiple_same_messages.rb +36 -0
- data/{lib/gettext/runtime/mofile.rb → test/fixtures/_/one_new_line.rb} +12 -6
- data/test/fixtures/{multi_textdomain.rb → multi_text_domain.rb} +1 -1
- data/test/fixtures/non_ascii.rb +1 -1
- data/test/fixtures/simple.rb +1 -1
- data/test/fixtures/untranslated.rb +1 -1
- data/test/gettext-test-utils.rb +1 -24
- data/test/po/ja/_.po +63 -13
- data/test/po/ja/non_ascii.po +2 -3
- data/test/po/ja/untranslated.po +1 -1
- data/test/test_class_info.rb +2 -2
- data/test/test_gettext.rb +11 -11
- data/test/test_mo.rb +2 -2
- data/test/test_parser.rb +93 -96
- data/test/test_po_entry.rb +237 -146
- data/test/test_po_parser.rb +107 -98
- data/test/test_string.rb +1 -1
- data/test/{test_textdomain_bind.rb → test_text_domain_bind.rb} +6 -6
- data/test/{test_textdomain_multi.rb → test_text_domain_multi.rb} +5 -5
- data/test/{test_textdomain_toplevel.rb → test_text_domain_toplevel.rb} +1 -1
- data/test/test_thread.rb +1 -1
- data/test/tools/files/simple_translation.rb +1 -1
- data/test/{parser → tools/parser}/test_ruby.rb +110 -14
- data/test/tools/test_msgmerge.rb +17 -276
- data/test/tools/test_po.rb +1 -1
- data/test/tools/test_xgettext.rb +175 -144
- metadata +59 -33
- data/lib/gettext/core_ext/iconv.rb +0 -110
- data/lib/gettext/core_ext/string.rb +0 -91
- data/lib/gettext/parser/erb.rb +0 -5
- data/lib/gettext/parser/glade.rb +0 -5
- data/lib/gettext/parser/ruby.rb +0 -172
- data/lib/gettext/runtime/textdomain_group.rb +0 -26
- data/lib/gettext/task.rb +0 -203
- data/lib/gettext/utils.rb +0 -39
- data/test/test_po_generation.rb +0 -45
- data/test/tools/test_tools.rb +0 -61
data/samples/hello.rb
CHANGED
|
@@ -10,7 +10,8 @@ require 'gettext'
|
|
|
10
10
|
class HelloWorld
|
|
11
11
|
include GetText
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
base_dir = File.dirname(__FILE__)
|
|
14
|
+
bindtextdomain("hello", :path => File.join(base_dir, "locale"))
|
|
14
15
|
|
|
15
16
|
def hello
|
|
16
17
|
print _("Hello World\n")
|
|
@@ -26,7 +27,7 @@ if __FILE__ == $0
|
|
|
26
27
|
p old.to_s # Show current locale
|
|
27
28
|
|
|
28
29
|
# Change the locale to "en".
|
|
29
|
-
GetText.
|
|
30
|
+
GetText.set_locale("en")
|
|
30
31
|
p GetText.locale.to_s
|
|
31
32
|
a.hello # Show in English
|
|
32
33
|
|
data/samples/hello2.rb
CHANGED
data/samples/hello_gtk2.rb
CHANGED
|
@@ -11,7 +11,10 @@ require 'gtk2'
|
|
|
11
11
|
class LocalizedWindow < Gtk::Window
|
|
12
12
|
include GetText
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
base_dir = File.dirname(__FILE__)
|
|
15
|
+
bindtextdomain("hello_gtk2",
|
|
16
|
+
:path => File.join(base_dir, "locale"),
|
|
17
|
+
:output_charset => "utf-8")
|
|
15
18
|
|
|
16
19
|
def initialize
|
|
17
20
|
super
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# hello_gtk_builder.rb - sample for Gtk::Builder in Ruby/GTK3
|
|
3
|
+
#
|
|
4
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
5
|
+
# This file is distributed under the same license as gettext.
|
|
6
|
+
|
|
7
|
+
require "gtk3"
|
|
8
|
+
|
|
9
|
+
class HelloGtkBuilder
|
|
10
|
+
def initialize
|
|
11
|
+
domain = "hello_gtk_builder"
|
|
12
|
+
base_dir = File.dirname(__FILE__)
|
|
13
|
+
GLib::GetText.bindtextdomain(domain, File.join(base_dir, "locale"))
|
|
14
|
+
|
|
15
|
+
@builder = Gtk::Builder.new
|
|
16
|
+
@builder.translation_domain = domain
|
|
17
|
+
@builder << File.join(base_dir, "hello_gtk_builder.ui")
|
|
18
|
+
@builder.connect_signals do |name|
|
|
19
|
+
method(name)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
@window = @builder["window1"]
|
|
23
|
+
@window.show_all
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def on_quit
|
|
27
|
+
Gtk.main_quit
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
HelloGtkBuilder.new
|
|
32
|
+
Gtk.main
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<interface>
|
|
3
|
+
<!-- interface-requires gtk+ 3.0 -->
|
|
4
|
+
<object class="GtkWindow" id="window1">
|
|
5
|
+
<property name="visible">True</property>
|
|
6
|
+
<property name="can_focus">False</property>
|
|
7
|
+
<property name="title" translatable="yes">window1</property>
|
|
8
|
+
<child>
|
|
9
|
+
<object class="GtkVBox" id="vbox1">
|
|
10
|
+
<property name="visible">True</property>
|
|
11
|
+
<property name="can_focus">False</property>
|
|
12
|
+
<child>
|
|
13
|
+
<object class="GtkLabel" id="label1">
|
|
14
|
+
<property name="visible">True</property>
|
|
15
|
+
<property name="can_focus">False</property>
|
|
16
|
+
<property name="label" translatable="yes">first line
|
|
17
|
+
second line
|
|
18
|
+
third line</property>
|
|
19
|
+
</object>
|
|
20
|
+
<packing>
|
|
21
|
+
<property name="expand">True</property>
|
|
22
|
+
<property name="fill">False</property>
|
|
23
|
+
<property name="position">0</property>
|
|
24
|
+
</packing>
|
|
25
|
+
</child>
|
|
26
|
+
<child>
|
|
27
|
+
<object class="GtkButton" id="button1">
|
|
28
|
+
<property name="label" translatable="yes"><Hello world></property>
|
|
29
|
+
<property name="use_action_appearance">False</property>
|
|
30
|
+
<property name="visible">True</property>
|
|
31
|
+
<property name="can_focus">True</property>
|
|
32
|
+
<property name="receives_default">False</property>
|
|
33
|
+
<property name="use_action_appearance">False</property>
|
|
34
|
+
<property name="use_underline">True</property>
|
|
35
|
+
<signal name="clicked" handler="on_quit" swapped="no"/>
|
|
36
|
+
</object>
|
|
37
|
+
<packing>
|
|
38
|
+
<property name="expand">False</property>
|
|
39
|
+
<property name="fill">False</property>
|
|
40
|
+
<property name="position">1</property>
|
|
41
|
+
</packing>
|
|
42
|
+
</child>
|
|
43
|
+
</object>
|
|
44
|
+
</child>
|
|
45
|
+
</object>
|
|
46
|
+
</interface>
|
data/samples/hello_noop.rb
CHANGED
|
@@ -16,7 +16,8 @@ class HelloNoop
|
|
|
16
16
|
# You can call bindtextdomain as instance methods.
|
|
17
17
|
# In this case, it initializes(decided the locale lazily)
|
|
18
18
|
# in a instance.
|
|
19
|
-
|
|
19
|
+
base_dir = File.dirname(__FILE__)
|
|
20
|
+
bindtextdomain("hello_noop", :path => File.join(base_dir, "locale"))
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def hello
|
data/samples/hello_plural.rb
CHANGED
data/samples/hello_tk.rb
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- mode: ruby; coding: utf-8 -*-
|
|
2
2
|
#
|
|
3
|
-
#
|
|
3
|
+
# po_parser.ry - ruby version of msgfmt
|
|
4
4
|
#
|
|
5
5
|
# Copyright (C) 2002-2008 Masao Mutoh <mutomasa at gmail.com>
|
|
6
|
-
# Copyright (C) 2012 Kouhei Sutou <kou@clear-code.com>
|
|
6
|
+
# Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
|
|
7
7
|
# Copyright (C) 2012-2013 Haruka Yoshihara <yoshihara@clear-code.com>
|
|
8
8
|
#
|
|
9
9
|
# You may redistribute it and/or modify it under the same
|
|
@@ -66,7 +66,7 @@ class GetText::POParser
|
|
|
66
66
|
$stderr.print "msgid = '#{val[1]}\n"
|
|
67
67
|
end
|
|
68
68
|
else
|
|
69
|
-
on_message(
|
|
69
|
+
on_message("", unescape(val[3]))
|
|
70
70
|
end
|
|
71
71
|
@fuzzy = false
|
|
72
72
|
else
|
|
@@ -117,17 +117,8 @@ class GetText::POParser
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
---- header
|
|
120
|
-
require "gettext/
|
|
120
|
+
require "gettext/po"
|
|
121
121
|
|
|
122
|
-
# For suppressing warning. PoData is deprecated and will be removed.
|
|
123
|
-
module GetText
|
|
124
|
-
module Tools
|
|
125
|
-
class MsgMerge
|
|
126
|
-
class PoData
|
|
127
|
-
end
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
end
|
|
131
122
|
---- inner
|
|
132
123
|
if GetText.respond_to?(:bindtextdomain)
|
|
133
124
|
include GetText
|
|
@@ -219,7 +210,7 @@ end
|
|
|
219
210
|
str = str[1..-1]
|
|
220
211
|
end
|
|
221
212
|
end
|
|
222
|
-
@q.push [false,
|
|
213
|
+
@q.push [false, "$end"]
|
|
223
214
|
if $DEBUG
|
|
224
215
|
@q.each do |a,b|
|
|
225
216
|
puts "[#{a}, #{b}]"
|
|
@@ -241,8 +232,7 @@ end
|
|
|
241
232
|
def on_message(msgid, msgstr)
|
|
242
233
|
msgstr = nil if msgstr.empty?
|
|
243
234
|
|
|
244
|
-
if @data.instance_of?(PO)
|
|
245
|
-
@data.instance_of?(GetText::Tools::MsgMerge::PoData)
|
|
235
|
+
if @data.instance_of?(PO)
|
|
246
236
|
type = detect_entry_type
|
|
247
237
|
entry = POEntry.new(type)
|
|
248
238
|
entry.translator_comment = format_comment(@translator_comments)
|
|
@@ -255,15 +245,7 @@ end
|
|
|
255
245
|
entry.msgid_plural = @msgid_plural
|
|
256
246
|
entry.msgstr = msgstr
|
|
257
247
|
|
|
258
|
-
|
|
259
|
-
@data[@msgctxt, msgid] = entry
|
|
260
|
-
elsif @data.instance_of?(GetText::Tools::MsgMerge::PoData)
|
|
261
|
-
id = ""
|
|
262
|
-
id << "#{@msgctxt}\004" unless @msgctxt.nil?
|
|
263
|
-
id << msgid
|
|
264
|
-
id << "\000#{@msgid_plural}" unless @msgid_plural.nil?
|
|
265
|
-
@data[id] = entry
|
|
266
|
-
end
|
|
248
|
+
@data[@msgctxt, msgid] = entry
|
|
267
249
|
else
|
|
268
250
|
options = {}
|
|
269
251
|
options[:msgctxt] = @msgctxt
|
|
@@ -293,8 +275,7 @@ end
|
|
|
293
275
|
|
|
294
276
|
def on_comment(comment)
|
|
295
277
|
@fuzzy = true if (/fuzzy/ =~ comment)
|
|
296
|
-
if @data.instance_of?(PO)
|
|
297
|
-
@data.instance_of?(GetText::Tools::MsgMerge::PoData)
|
|
278
|
+
if @data.instance_of?(PO)
|
|
298
279
|
if comment == "#"
|
|
299
280
|
@translator_comments << ""
|
|
300
281
|
elsif /\A(#.)\s*(.*)\z/ =~ comment
|
|
@@ -306,7 +287,7 @@ end
|
|
|
306
287
|
when POEntry::EXTRACTED_COMMENT_MARK
|
|
307
288
|
@extracted_comments << content
|
|
308
289
|
when POEntry::REFERENCE_COMMENT_MARK
|
|
309
|
-
@references
|
|
290
|
+
@references.concat(parse_references_line(content))
|
|
310
291
|
when POEntry::FLAG_MARK
|
|
311
292
|
@flag << content
|
|
312
293
|
when POEntry::PREVIOUS_COMMENT_MARK
|
|
@@ -331,15 +312,31 @@ end
|
|
|
331
312
|
parse(File.open(*args) {|io| io.read }, data)
|
|
332
313
|
end
|
|
333
314
|
|
|
315
|
+
private
|
|
334
316
|
def detect_file_encoding(po_file)
|
|
335
|
-
open(po_file, :encoding =>
|
|
317
|
+
open(po_file, :encoding => "ASCII-8BIT") do |input|
|
|
318
|
+
in_header = false
|
|
336
319
|
input.each_line do |line|
|
|
337
|
-
|
|
320
|
+
case line.chomp
|
|
321
|
+
when /\Amsgid\s+"(.*)"\z/
|
|
322
|
+
id = $1
|
|
323
|
+
break unless id.empty?
|
|
324
|
+
in_header = true
|
|
325
|
+
when /\A"Content-Type:.*\scharset=(.*)\\n"\z/
|
|
326
|
+
charset = $1
|
|
327
|
+
next unless in_header
|
|
328
|
+
break if template_charset?(charset)
|
|
329
|
+
return Encoding.find(charset)
|
|
330
|
+
end
|
|
338
331
|
end
|
|
339
332
|
end
|
|
340
333
|
Encoding.default_external
|
|
341
334
|
end
|
|
342
335
|
|
|
336
|
+
def template_charset?(charset)
|
|
337
|
+
charset == "CHARSET"
|
|
338
|
+
end
|
|
339
|
+
|
|
343
340
|
def detect_entry_type
|
|
344
341
|
if @msgctxt.nil?
|
|
345
342
|
if @msgid_plural.nil?
|
|
@@ -355,10 +352,9 @@ end
|
|
|
355
352
|
end
|
|
356
353
|
end
|
|
357
354
|
end
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
module GetText
|
|
362
|
-
PoParser = POParser
|
|
355
|
+
|
|
356
|
+
def parse_references_line(line)
|
|
357
|
+
line.split(/\s+/)
|
|
363
358
|
end
|
|
359
|
+
---- footer
|
|
364
360
|
|
data/test/fixtures/N_.rb
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
4
|
+
#
|
|
5
|
+
# License: Ruby's or LGPL
|
|
6
|
+
#
|
|
7
|
+
# This library is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU Lesser General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
module Fixtures
|
|
21
|
+
module Method_
|
|
22
|
+
class DoubleQuoteInDoubleQuote
|
|
23
|
+
include GetText
|
|
24
|
+
|
|
25
|
+
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
|
|
26
|
+
|
|
27
|
+
def message
|
|
28
|
+
_("double \"quote\" in double quote")
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
4
|
+
#
|
|
5
|
+
# License: Ruby's or LGPL
|
|
6
|
+
#
|
|
7
|
+
# This library is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU Lesser General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
module Fixtures
|
|
21
|
+
module Method_
|
|
22
|
+
class DoubleQuoteInSingleQuote
|
|
23
|
+
include GetText
|
|
24
|
+
|
|
25
|
+
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
|
|
26
|
+
|
|
27
|
+
def message
|
|
28
|
+
_('double "quote" in single quote')
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
4
|
+
#
|
|
5
|
+
# License: Ruby's or LGPL
|
|
6
|
+
#
|
|
7
|
+
# This library is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU Lesser General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
module Fixtures
|
|
21
|
+
module Method_
|
|
22
|
+
class LiteralConcatenationWithContinuationLine
|
|
23
|
+
include GetText
|
|
24
|
+
|
|
25
|
+
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
|
|
26
|
+
|
|
27
|
+
def message
|
|
28
|
+
_("literal " \
|
|
29
|
+
"concatenation " \
|
|
30
|
+
"with " \
|
|
31
|
+
"continuation " \
|
|
32
|
+
"line")
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
4
|
+
#
|
|
5
|
+
# License: Ruby's or LGPL
|
|
6
|
+
#
|
|
7
|
+
# This library is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU Lesser General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
module Fixtures
|
|
21
|
+
module Method_
|
|
22
|
+
class MiddleNewLine
|
|
23
|
+
include GetText
|
|
24
|
+
|
|
25
|
+
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
|
|
26
|
+
|
|
27
|
+
def message
|
|
28
|
+
_("middle\nnew line")
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
#
|
|
3
|
+
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
|
4
|
+
#
|
|
5
|
+
# License: Ruby's or LGPL
|
|
6
|
+
#
|
|
7
|
+
# This library is free software: you can redistribute it and/or modify
|
|
8
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
9
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
10
|
+
# (at your option) any later version.
|
|
11
|
+
#
|
|
12
|
+
# This library is distributed in the hope that it will be useful,
|
|
13
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15
|
+
# GNU Lesser General Public License for more details.
|
|
16
|
+
#
|
|
17
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
18
|
+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
+
|
|
20
|
+
module Fixtures
|
|
21
|
+
module Method_
|
|
22
|
+
class MultipleLinesLiteral
|
|
23
|
+
include GetText
|
|
24
|
+
|
|
25
|
+
bindtextdomain("_", :path => GetTextTestUtils.locale_path)
|
|
26
|
+
|
|
27
|
+
def message
|
|
28
|
+
_("multiple
|
|
29
|
+
lines
|
|
30
|
+
literal
|
|
31
|
+
")
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|