File: tools.rb

package info (click to toggle)
libgettext-activerecord-ruby 2.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 608 kB
  • ctags: 285
  • sloc: ruby: 2,895; makefile: 13
file content (30 lines) | stat: -rw-r--r-- 843 bytes parent folder | download | duplicates (2)
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
=begin
  tools.rb - Utility functions

  Copyright (C) 2009 Masao Mutoh

  You may redistribute it and/or modify it under the same
  license terms as Ruby or LGPL.
=end

require 'gettext/tools'
require 'gettext_activerecord'
require 'gettext_activerecord/parser'

module GetText
  extend self

  alias :create_mofiles_org :create_mofiles  #:nodoc:
  alias :update_pofiles_org :update_pofiles  #:nodoc:

  # update_pofiles for ActiveRecord.
  # In this method, GetText::ActiveRecordParser.init is called 
  # with "options".
  #  (e.g.)
  #  GetText.update_po_files("foo", Dir.glob("lib/**/*"), "1.0.0", :untranslate_classes = ["UntranslateClass"]
  def update_pofiles(textdomain, files, app_version, options = {})
    GetText::ActiveRecordParser.init(options)
    GetText.update_pofiles_org(textdomain, files, app_version, options)
  end

end