localeAccessor = (locale, singular, allowDelayedTraversal) => {
    // Bail out on non-existent locales to defend against internal errors.
    if (!locales[locale]) return Function.prototype

    // Handle object lookup notation
    const indexOfDot = objectNotation && singular.lastIndexOf(objectNotation)
    if (objectNotation && indexOfDot > 0 && indexOfDot < singular.length - 1) {
      // If delayed traversal wasn't specifically forbidden, it is allowed.
      if (typeof allowDelayedTraversal === 'undefined')
        allowDelayedTraversal = true
      // The accessor we're trying to find and which we want to return.
      let accessor = null
      // An accessor that returns null.
      const nullAccessor = () => null
      // Do we need to re-traverse the tree upon invocation of the accessor?
      let reTraverse = false
      // Split the provided term and run the callback for each subterm.
      singular.split(objectNotation).reduce((object, index) => {
        // Make the accessor return null.
        accessor = nullAccessor
        // If our current target object (in the locale tree) doesn't exist or
        // it doesn't have the next subterm as a member...
        if (
          object === null ||
          !Object.prototype.hasOwnProperty.call(object, index)
        ) {
          // ...remember that we need retraversal (because we didn't find our target).
          reTraverse = allowDelayedTraversal
          // Return null to avoid deeper iterations.
          return null
        }
        // We can traverse deeper, so we generate an accessor for this current level.
        accessor = () => object[index]
        // Return a reference to the next deeper level in the locale tree.
        return object[index]
      }, locales[locale])
      // Return the requested accessor.
      return () =>
        // If we need to re-traverse (because we didn't find our target term)
        // traverse again and return the new result (but don't allow further iterations)
        // or return the previously found accessor if it was already valid.
        reTraverse ? localeAccessor(locale, singular, false)() : accessor()
    } else {
      // No object notation, just return an accessor that performs array lookup.
      return () => locales[locale][singular]
    }
  }
Allows delayed access to translations nested inside objects.
@param {String} locale The locale to use.
@param {String} singular The singular term to look up.
@param {Boolean} [allowDelayedTraversal=true] Is delayed traversal of the tree allowed?
This parameter is used internally. It allows to signal the accessor that
a translation was not found in the initial lookup and that an invocation
of the accessor may trigger another traversal of the tree.
@returns {Function} A function that, when invoked, returns the current value stored
in the object at the requested location.