code: public void addLanguageResource(String key, Resource resource) {
  
          // Skip loading of language if not allowed
          if (!isLanguageAllowed(key)) {
              logger.debug("OMITTING language: \"{}\"", key);
              return;
          }
  
          // Merge language resources if already defined
          Resource existing = resources.get(key);
          if (existing != null) {
  
              try {
  
                  // Read the original language resource
                  JsonNode existingTree = parseLanguageResource(existing);
                  if (existingTree == null) {
                      logger.warn("Base language resource \"{}\" does not exist.", key);
                      return;
                  }
  
                  // Read new language resource
                  JsonNode resourceTree = parseLanguageResource(resource);
                  if (resourceTree == null) {
                      logger.warn("Overlay language resource \"{}\" does not exist.", key);
                      return;
                  }
  
                  // Merge the language resources
                  JsonNode mergedTree = mergeTranslations(existingTree, resourceTree);
                  resources.put(key, new ByteArrayResource("application/json", mapper.writeValueAsBytes(mergedTree)));
  
                  logger.debug("Merged strings with existing language: \"{}\"", key);
  
              }
              catch (IOException e) {
                  logger.error("Unable to merge language resource \"{}\": {}", key, e.getMessage());
                  logger.debug("Error merging language resource.", e);
              }
  
          }
  
          // Otherwise, add new language resource
          else {
              resources.put(key, resource);
              logger.debug("Added language: \"{}\"", key);
          }
  
      }
docs: Adds or overlays the given language resource, which need not exist in
  the ServletContext. If a language resource is already defined for the
  given language key, the strings from the given resource will be overlaid
  on top of the existing strings, augmenting or overriding the available
  strings for that language.
  
  @param key
  The language key of the resource being added. Language keys are
  pairs consisting of a language code followed by an underscore and
  country code, such as "en_US".
  
  @param resource
  The language resource to add. This resource must have the mimetype
  "application/json".