code: public void addMessages(CmsMessages messages) throws CmsIllegalArgumentException {
  
          Locale locale = messages.getLocale();
          if (!getLocale().equals(locale)) {
              // not the same locale, try to change the locale if this is a simple CmsMessage object
              if (!(messages instanceof CmsMultiMessages)) {
                  // match locale of multi bundle
                  String bundleName = messages.getBundleName();
                  messages = new CmsMessages(bundleName, getLocale());
              } else {
                  // multi bundles with wrong locales can't be added this way
                  throw new CmsIllegalArgumentException(Messages.get().container(
                      Messages.ERR_MULTIMSG_LOCALE_DOES_NOT_MATCH_2,
                      messages.getLocale(),
                      getLocale()));
              }
          }
          if (!m_messages.contains(messages)) {
              if ((m_messageCache != null) && (m_messageCache.size() > 0)) {
                  // cache has already been used, must flush because of newly added keys
                  m_messageCache = new Hashtable<String, String>();
              }
              m_messages.add(messages);
          }
      }
docs: Adds a messages instance to this multi message bundle.<p>
  
  The messages instance should have been initialized with the same locale as this multi bundle,
  if not, the locale of the messages instance is automatically replaced. However, this will not work
  if the added messages instance is in face also of type <code>{@link CmsMultiMessages}</code>.<p>
  
  @param messages the messages instance to add
  
  @throws CmsIllegalArgumentException if the locale of the given <code>{@link CmsMultiMessages}</code> does not match the locale of this multi messages