File: simple.rb

package info (click to toggle)
ruby-gettext 3.4.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,084 kB
  • sloc: ruby: 10,461; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# -*- coding: utf-8 -*-

require 'gettext'

class Simple
  include GetText
  bindtextdomain("test1", :path => Helper::Path.locale_path)

  def test
    _("language")
  end

  def test_formatted_string
    _("one is %d.") % 1
  end

  def test_plural
    n_("There is an apple.", "There are %{num} apples.", 5) % {:num => 5}
  end
end