Class: Translatomatic::ResourceFile::Properties
- Defined in:
- lib/translatomatic/resource_file/properties.rb
Overview
Properties resource file
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.extensions ⇒ Array<String>
File extensions supported by this resource file.
-
.preferred_locale_separator ⇒ String
Preferred character to use to separate the locale from the file basename.
-
.supports_variable_interpolation? ⇒ boolean
True if this resource file supports variable interpolation.
Instance Method Summary collapse
-
#create_variable(name) ⇒ String
Create an interpolated variable string.
-
#variable_regex ⇒ Regexp
A regexp used to match interpolated variables.
Methods inherited from Base
enabled?, #get, #get_context, #initialize, key_value?, #locale_path, #properties, #properties=, #save, #sentences, #set, #to_s, #type
Methods included from PathUtils
#detect_path_locale, #modify_path_locale
Constructor Details
This class inherits a constructor from Translatomatic::ResourceFile::Base
Class Method Details
.extensions ⇒ Array<String>
Returns File extensions supported by this resource file.
11 12 13 |
# File 'lib/translatomatic/resource_file/properties.rb', line 11 def self.extensions %w[properties] end |
.preferred_locale_separator ⇒ String
Returns Preferred character to use to separate the locale from the file basename.
21 22 23 |
# File 'lib/translatomatic/resource_file/properties.rb', line 21 def self.preferred_locale_separator '_' end |
.supports_variable_interpolation? ⇒ boolean
Returns true if this resource file supports variable interpolation.
16 17 18 |
# File 'lib/translatomatic/resource_file/properties.rb', line 16 def self.supports_variable_interpolation? true end |
Instance Method Details
#create_variable(name) ⇒ String
Create an interpolated variable string.
26 27 28 |
# File 'lib/translatomatic/resource_file/properties.rb', line 26 def create_variable(name) "{#{name}}" end |
#variable_regex ⇒ Regexp
Returns A regexp used to match interpolated variables.
31 32 33 |
# File 'lib/translatomatic/resource_file/properties.rb', line 31 def variable_regex /\{.*?\}/ end |