You are here

function _simplenews_newsletter_description in Simplenews 7

Helper function to translate a newsletter description if required.

Parameters

object $newsletter: Newsletter category object, typically from simplenews_category_load(). Contains at least the following properties:

  • tid: The newsletter category id.
  • name: The newsletter name.

string $langcode: (optional) The language code. Defaults to $GLOBALS['language'].

Return value

string The translated newsletter name.

2 calls to _simplenews_newsletter_description()
simplenews_subscription_list_add in includes/simplenews.admin.inc
Menu callback: Mass subscribe to newsletters.
simplenews_subscription_list_remove in includes/simplenews.admin.inc
Menu callback: Mass subscribe to newsletters.

File

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

Code

function _simplenews_newsletter_description($newsletter, $langcode = NULL) {
  if (module_exists('i18n_taxonomy')) {
    return i18n_string(array(
      'taxonomy',
      'term',
      $newsletter->tid,
      'description',
    ), $newsletter->description, array(
      'langcode' => $langcode,
    ));
  }
  return $newsletter->description;
}