aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/gettext-2.1.0/test/testlib/pgettext.rb
blob: 2d4c6fd60b75f70a6032dde1e3048ecfeecae424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
require 'gettext'

class TestPGetText
  include GetText
  bindtextdomain("pgettext", :path => "locale")

  def test_1
    p_("AAA", "BBB")
  end
  
  def test_2
    pgettext("AAA", "BBB")
  end

  def test_3
    pgettext("AAA|BBB", "CCC")
  end
  
  def test_4
    p_("AAA", "CCC") #not found
  end

  def test_5
    p_("CCC", "BBB")
  end

  def test_6  # not pgettext.
    _("BBB")
  end

  def with_context
    # TRANSLATORS:please translate 'name' in the context of 'program'.
    # Hint: the translation should NOT contain the translation of 'program'.
    p_('program', 'name')
  end
end