docs: public static String getLocalizedMessage(CmsMessageContainer container, CmsObject cms) {
  
          Locale locale;
          if (cms != null) {
              CmsRequestContext context = cms.getRequestContext();
              locale = (context != null) ? context.getLocale() : Locale.getDefault();
          } else {
              locale = Locale.getDefault();
          }
          return container.key(locale);
      }