You are here

function _simplenews_tt_newsletter_name in Simplenews 6.2

Helper function to translate a newsletter name if required.

Parameters

<object> $newsletter: Newsletter object. Typically from taxonomy_get_term(). $newsletter -> tid newsletter tid $newsletter -> name newsletter name

<string> $langcode: Optional language code (defaults to current global $language);

Return value

<string> translated newsletter name.

3 calls to _simplenews_tt_newsletter_name()
simplenews_get_newsletters in ./simplenews.module
Get array of newsletters with names translated.
simplenews_mail in ./simplenews.module
Implementation of hook_mail().
simplenews_token_values in ./simplenews.module
Implementation of hook_token_value().

File

./simplenews.module, line 2321
Simplenews node handling, sent email, newsletter block and general hooks

Code

function _simplenews_tt_newsletter_name($newsletter, $langcode = NULL) {
  global $language;
  $langcode = isset($langcode) ? $langcode : $language->language;
  if (module_exists('i18ntaxonomy') && i18ntaxonomy_vocabulary(variable_get('simplenews_vid', '')) == I18N_TAXONOMY_LOCALIZE) {
    return tt('taxonomy:term:' . $newsletter->tid . ':name', $newsletter->name, $langcode);
  }
  return $newsletter->name;
}