Class: Fame::LocalizableStringsEntry

Inherits:
Struct
  • Object
show all
Defined in:
lib/fame/models.rb

Overview

node = LocalizedNode property = localizable element, e.g. text of a label value = localizable strings value (i.e. the translation)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nodeObject

Returns the value of attribute node

Returns:

  • (Object)

    the current value of node



15
16
17
# File 'lib/fame/models.rb', line 15

def node
  @node
end

#propertyObject

Returns the value of attribute property

Returns:

  • (Object)

    the current value of property



15
16
17
# File 'lib/fame/models.rb', line 15

def property
  @property
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



15
16
17
# File 'lib/fame/models.rb', line 15

def value
  @value
end

Instance Method Details

#formatted_infoObject

The formatted info of this entry



25
26
27
# File 'lib/fame/models.rb', line 25

def formatted_info
  [node.vc_name, node.element_name, property].compact.join(" ")
end

#formatted_strings_file_entryObject

The formatted .strings file entry



18
19
20
21
22
# File 'lib/fame/models.rb', line 18

def formatted_strings_file_entry
  comment = node.i18n_comment || "No comment provided by engineer."
  key = "#{node.original_id}.#{property}"
  ["/* #{formatted_info}: #{comment} */", "\"#{key}\" = \"#{value}\";"].join("\n")
end