#
# Copyright (C) 2003-2005 Kouichirou Eto
#     All rights reserved.
#     This is free software with ABSOLUTELY NO WARRANTY.
#
# You can redistribute it and/or modify it under the terms of 
# the GNU General Public License version 2.
#

$LOAD_PATH << "../../lib" unless $LOAD_PATH.include?("../../lib")
require "qwik/catalog-factory"

module QuickML
  class CatalogFactory < Qwik::CatalogFactory
    def catalog_re
      /\Aml-catalog-(..)\.rb\z/
    end

    def load_all_catalogs(dir)
      # lang has just two letters length.
      @catalogs = load_all_catalogs_impl(dir, catalog_re)
    end
  end
end

if $0 == __FILE__
  require "test/unit"
  $KCODE = "s"
  $debug = true
end

if defined?($debug) && $debug
  class TestMLCatalogFactory < Test::Unit::TestCase
    def test_all
      cf = QuickML::CatalogFactory.new
      cf.load_all_catalogs(".")
      catalog_ja = cf.get_catalog("ja")
      assert_equal(true, catalog_ja != nil)
    end
  end
end
