Class: Translatomatic::ResourceFile::XCodeStrings
- Defined in:
- lib/translatomatic/resource_file/xcode_strings.rb
Overview
XCode strings resource file
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.extensions ⇒ Array<String>
File extensions supported by this resource file.
-
.is_key_value? ⇒ boolean
True if the file format consists of keys and values.
Instance Method Summary collapse
-
#save(target = path, options = {}) ⇒ void
Save the resource file.
Methods inherited from Base
#create_variable, enabled?, #format, #get, #initialize, #locale_path, #sentences, #set, supports_variable_interpolation?, #to_s, #type, #variable_regex
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.
26 27 28 |
# File 'lib/translatomatic/resource_file/xcode_strings.rb', line 26 def self.extensions %w{strings} end |
.is_key_value? ⇒ boolean
Returns True if the file format consists of keys and values.
31 32 33 |
# File 'lib/translatomatic/resource_file/xcode_strings.rb', line 31 def self.is_key_value? true end |
Instance Method Details
#save(target = path, options = {}) ⇒ void
This method returns an undefined value.
Save the resource file.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/translatomatic/resource_file/xcode_strings.rb', line 36 def save(target = path, = {}) out = "" out += comment(created_by) unless [:no_created_by] properties.each do |key, value| key = escape(key) value = escape(value) out += %Q{"#{key}" = "#{value}";\n} end target.write(out) end |