get the localized message provided in the message files in the com.ibm.ws.jaxb.tools.

@param msgKey
@return
558462
public static String formatMessage(String msgKey) {
        String msg;
        try {
            msg = JaxbToolsConstants.messages.getString(msgKey);
        } catch (Exception ex) {
            // no FFDC required
            return msgKey;
        }

        return msg;
    }
1195516
public static String getMessage(String key, Locale locale) {

        ResourceBundle bundle = null;
        try {
            bundle = CmsResourceBundleLoader.getBundle("org.opencms.inactiveusers.custom", locale);
            return bundle.getString(key);
        } catch (MissingResourceException e) {
            LOG.info("Customization bundle not found: org.opencms.inactiveusers.custom", e);
            bundle = CmsResourceBundleLoader.getBundle("org.opencms.ui.messages", locale);
            return bundle.getString(key);
        }
    }
440917
@GET
    @Path("/{key}")
    @Produces(MediaType.APPLICATION_JSON)
    @RequiresPermissions(I18nPermissions.TRANSLATION_READ)
    public TranslationRepresentation getTranslation(@PathParam("key") String key) {
        TranslationRepresentation translation = translationFinder.findTranslation(locale, key);
        if (translation == null) {
            throw new NotFoundException("No translation for key: " + key + " and locale: " + locale);
        }
        return translation;
    }
312377
public String getMessage(Locale locale) {
		if (getCause() != null) {
			String message = getShortMessage(locale) + ", " + translate("ROOT_CAUSE", locale) + " ";
			if (getCause() instanceof GeomajasException) {
				return message + ((GeomajasException) getCause()).getMessage(locale);
			}
			return message + getCause().getMessage();
		} else {
			return getShortMessage(locale);
		}
	}
930015
function (msgctxt, msgid) {
  var message;
  if (this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[msgctxt]) {
    message = this.$i18n.getLocaleMessage(this.$i18n.activeLocale)[msgctxt][msgid];
  }

  if (!message) {
    return msgid
  } else {
    return message.msgstr[0] || message.msgid
  }
}
1139325
protected String translate(String key, Object... objects) {
        return messageSource.getMessage(key, objects, null);
    }
287907
public String importMessage(String key, Locale locale) {

        key = key.trim();
        String[] tokens = key.split("#");
        if (tokens.length != 2) {
            return null;
        }
        String className = tokens[0];
        String messageName = tokens[1];
        try {
            Method messagesGet = Class.forName(className).getMethod("get");
            I_CmsMessageBundle bundle = (I_CmsMessageBundle)(messagesGet.invoke(null));
            return bundle.getBundle(locale).key(messageName);
        } catch (Exception e) {
            LOG.error(e.getLocalizedMessage(), e);
            return null;
        }
    }
826731
public String getMessage(String key, Locale locale)
	{
		if (null == locale)
		{
			return getMessage(key);
		}
		return CollectionTools.getString(getResourceBundle(locale), key, getBehaviourOnMissingMessage().getValueOnMissingMessage(key));
	}
1087152
public static String formatMessage(TraceComponent tc, Locale locale, String msgKey, Object... objs) {
        return formatMessage(tc, (locale == null) ? null : Collections.singletonList(locale), msgKey, objs);
    }
619354
public String getShortMessage(Locale locale) {
		String message;
		message = translate(Integer.toString(exceptionCode), locale);
		if (message != null && msgParameters != null && msgParameters.length > 0) {
			for (int i = 0; i < msgParameters.length; i++) {
				boolean isIncluded = false;
				String needTranslationParam = "$${" + i + "}";
				if (message.contains(needTranslationParam)) {
					String translation = translate(msgParameters[i], locale);
					if (null == translation && null != msgParameters[i]) {
						translation = msgParameters[i].toString();
					}
					if (null == translation) {
						translation = "[null]";
					}
					message = message.replace(needTranslationParam, translation);
					isIncluded = true;
				}
				String verbatimParam = "${" + i + "}";
				String rs = null == msgParameters[i] ? "[null]" : msgParameters[i].toString();
				if (message.contains(verbatimParam)) {
					message = message.replace(verbatimParam, rs);
					isIncluded = true;
				}
				if (!isIncluded) {
					message = message + " (" + rs + ")"; // NOSONAR replace/contains makes StringBuilder use difficult
				}
			}
		}
		return message;
	}
192784
protected MessageFormat createMessageFormat(String msg, Locale locale) {
        return new MessageFormat((msg != null ? msg : ""), locale);
    }
472721
public String getMessage(final MSLocale locale, final String key) {
        if(locale == null) {
            return loadResource(null).getMessage(key);

        } else {
            return loadResource(locale.getLocale()).getMessage(key);
        }
    }
714072
public String getMessage(final MSLocale formatLocale, Locale runtimeLocale, final String key) {

        if(formatLocale != null) {
            return getMessage(formatLocale, key);
        } else {
            return getMessage(runtimeLocale, key);
        }

    }
770443
private String findMessage(final String messageKey) {
        String message = null;

        try {
            if (!this.resourceBundles.isEmpty()) {
                for (int i = this.resourceBundles.size() - 1; i >= 0 && message == null; i--) {

                    if (this.resourceBundles.get(i).containsKey(messageKey)) {
                        message = this.resourceBundles.get(i).getString(messageKey);
                    }
                }
            }
        } catch (final MissingResourceException e) {
            LOGGER.error("Message key not found into resource bundle", e);
        }

        return message;
    }
446701
public static String getText(String code, Object[] args, Locale locale) {
        Preconditions.checkState(messageSource != null,
                "If i18n is enabled, please make sure MessageSource is properly set as a member in "
                        + "MessageSupport");
        return messageSource.getMessage(code, args, locale);
    }
1042342
public static String getString (final String key, final Locale msgLocale) {
        /*read message resource file.*/
        ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, msgLocale);
        try {
            return RESOURCE_BUNDLE.getString(key);
        } catch (final MissingResourceException e) {
            return key;
        }
    }
645527
public String getMessage(String key, Locale locale, Object[] parameters)
	{
		if (null == locale)
		{
			return getMessage(key, parameters);
		}
		if (null == parameters)
		{
			return getMessage(key, locale);
		}
		if (null != key)
		{
			MessageFormat _messageFormat = new MessageFormat(getMessage(key, locale));
			return _messageFormat.format(parameters);
		}

		return null;
	}