You are here

function message_get_string_i18n in Message 6

Get the string of the message.

Parameters

$message: The message object,

Return value

This function checkes if the i18n module is enabled and provides the translated string if needed. It also checkes if the message was overriden and if so, return the overriden string.

1 call to message_get_string_i18n()
message_t in ./message.module
Replace arguments with their placeholders.

File

./message.module, line 654
API functions to manipulate messages.

Code

function message_get_string_i18n($message_instance) {
  $message = message_load($message_instance->name);
  if (!empty($message_instance->override)) {
    $name_property = $message_instance->override_name;
    $message_property = $message_instance->message;
  }
  else {
    $name_property = $message->name;
    $message_property = $message->message;
  }
  if (module_exists(i18nstrings)) {

    // Get the translation of the original or overriden message.
    $string = i18nstrings('messages:message:' . $name_property . ':message', $message_property);
  }
  else {
    $string = $message_property;
  }
  return $string;
}