Class: HammerCLI::I18n::AbstractLocaleDomain
- Inherits:
-
Object
- Object
- HammerCLI::I18n::AbstractLocaleDomain
- Defined in:
- lib/hammer_cli/i18n.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#domain_name ⇒ Object
readonly
Returns the value of attribute domain_name.
-
#locale_dir ⇒ Object
readonly
Returns the value of attribute locale_dir.
Instance Method Summary collapse
Instance Attribute Details
#domain_name ⇒ Object (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_dir ⇒ Object (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
53 54 55 |
# File 'lib/hammer_cli/i18n.rb', line 53 def available? Dir[File.join(locale_dir, '**', "#{domain_name}.#{type}")].any? end |
#available_locales ⇒ Object
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_files ⇒ Object
45 46 47 |
# File 'lib/hammer_cli/i18n.rb', line 45 def translated_files [] end |
#type ⇒ Object
49 50 51 |
# File 'lib/hammer_cli/i18n.rb', line 49 def type :mo end |