   # `value`.
   'i18n-content': (element, value, subMap) ->
     subs = i18nSubs element, value, subMap
-    element.innerHTML = utils.i18n value, subs
+    element.innerHTML = i18n.get value, subs
 
   # Replace the value of the properties and/or attributes of `element` with the
   # messages looked up for their corresponding values.

          obj = element
          obj = obj[path.shift()] while obj and path.length > 1
          if obj
            obj[path] = utils.i18n value, subs
            i18nProcess element, subMap if path is 'innerHTML'
        else
          element.setAttribute propName, utils.i18n propExpr, subs
# List of internationalization attributes/handlers available.
i18nAttributes = []
i18nAttributes.push key for own key of i18nHandlers


utils = window.utils =

  # Generate a unique key based on the current time and using a randomly
  # generated hexadecimal number of the specified length.
  keyGen: (separator = '.', length = 5) ->
    parts  = []
    # Populate the segment(s) to attempt uniquity.
    parts.push new Date().getTime()
    if length > 0
      min = @repeat '1', '0', if length is 1 then 1 else length - 1
      max = @repeat 'f', 'f', if length is 1 then 1 else length - 1
      min = parseInt min, 16
      max = parseInt max, 16
      parts.push @random min max
    # Convert segments to their hexadecimal (base 16) forms.
    parts[i] = part.toString 16 for part, i in parts
    # Join all segments and transform to upper case.
    parts.join(separator).toUpperCase()

  # Retrieve the first entity/all entities that pass the specified `filter`.
  query: (entities, singular, filter) ->
    return entity for entity in entities when filter entity if singular
    entity for entity in entities when filter entity

  # Generate a random number between the `min` and `max` values provided.
  random: (min, max) ->
    Math.floor(Math.random() * (max - min + 1)) + min

  # Repeat the string provided the specified number of times.
  repeat: (str = '', repeatStr = str, count = 1) ->
    if count isnt 0
      # Repeat to the right if `count` is positive.
      str += repeatStr for i in [1..count] if count > 0
      # Repeat to the left if `count` is negative.
      str = repeatStr + str for i in [1..count*-1] if count < 0
    str

# Storage setup
# -------------

store = window.store =

  # Clear all keys from `localStorage`.
  clear: ->
    delete localStorage[key] for own key of localStorage

  # Determine whether or not the specified `keys` exist in `localStorage`.
  exists: (keys...) ->
