 // - MARK: Helpers
 
 extension StringsDict {
-  typealias VariableKeyResult = (key: String, range: Range<String.Index>, positionalArgument: Int?)
-
-  /// Parses variable keys and their ranges from a formatKey.
-  /// Every variable key that is contained within the format string is preceded
+  typealias VariableNameResult = (name: String, range: Range<String.Index>, positionalArgument: Int?)
+
+  /// Parses variable names and their ranges from a `NSStringLocalizedFormatKey`.
+  /// Every variable name that is contained within the format key is preceded
   /// by the %#@ characters or by the positional variants, e.g. %1$#@, and followed by the @ character.
   ///
-  /// - Parameter formatKey: The formatKey from which the variable keys should be parsed.
-  /// - Returns: An array of discovered variable keys and their range within the `formatKey`.
+  /// - Parameter formatKey: The formatKey from which the variable names should be parsed.
+  /// - Returns: An array of discovered variable names, their range within the `formatKey` and the positional argument.
   // swiftlint:disable:next discouraged_optional_collection
-  private static func variableKeysFromFormatKey(_ formatKey: String) -> [VariableKeyResult]? {
+  private static func variableNamesFromFormatKey(_ formatKey: String) -> [VariableNameResult]? {
     let pattern = #"(%(?>(\d)\$)?#@([\w\.\p{Pd}]+)@)"#
     guard let regex = try? NSRegularExpression(pattern: pattern, options: []) else { return nil }
     let nsrange = NSRange(formatKey.startIndex..<formatKey.endIndex, in: formatKey)

          return lhs < rhs
        }
      }
      .map { $0.key }

    return try sortedVariableKeys.reduce(into: [PluralEntry.Variable]()) { variables, variableKey in
      let variableRule = try container.decode(PluralEntry.VariableRule.self, forKey: CodingKeys(key: variableKey))
      variables.append(PluralEntry.Variable(key: variableKey, rule: variableRule))
    }
  }
}

  var translation: String? {
    var result = formatKey

    for intermediateResult in sequence(first: result, next: unfurlVariableNamesInFormatKey(_:)) {
      result = intermediateResult
    }

    return "Plural case 'other': \(result)"
  }

  /// Unfurls any variables in a `NSStringLocalizedFormatKey` to get a possible translation for the `other` case.
  ///
  /// This method should be used in a recursive context, in which the output will be used as the input for the
  /// next iteration.
  ///
  /// - Parameter formatKey: A format key containing variables.
  /// - Returns: The format key in which all its variables are replaced with the content of the `other` translation,
  ///  if the `formatKey` contained any variables, `nil` otherwise.
  private func unfurlVariableNamesInFormatKey(_ formatKey: String) -> String? {
    guard let firstRemainingVariableName = StringsDict.variableNamesFromFormatKey(formatKey)?.first else {
      return nil
    }

    let (name, range, _) = firstRemainingVariableName
    guard let variable = variables.first(where: { $0.name == name }) else { return nil }

    return formatKey.replacingCharacters(in: range, with: variable.rule.other)
  }
}
