Class: HammerCLI::I18n::AbstractLocaleDomain

Inherits:
Object
  • Object
show all
Defined in:
lib/hammer_cli/i18n.rb

Direct Known Subclasses

LocaleDomain

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domain_nameObject (readonly)

Returns the value of attribute domain_name.



57
58
59
# File 'lib/hammer_cli/i18n.rb', line 57

def domain_name
  @domain_name
end

#locale_dirObject (readonly)

Returns the value of attribute locale_dir.



57
58
59
# File 'lib/hammer_cli/i18n.rb', line 57

def locale_dir
  @locale_dir
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/hammer_cli/i18n.rb', line 53

def available?
  Dir[File.join(locale_dir, '**', "#{domain_name}.#{type}")].any?
end

#available_localesObject



41
42
43
# File 'lib/hammer_cli/i18n.rb', line 41

def available_locales
  Dir.glob(locale_dir+'/*').select { |f| File.directory? f }.map { |f| File.basename(f) }
end

#translated_filesObject



45
46
47
# File 'lib/hammer_cli/i18n.rb', line 45

def translated_files
  []
end

#typeObject



49
50
51
# File 'lib/hammer_cli/i18n.rb', line 49

def type
  :mo
end