You are here

potx_test_7.module in Translation template extractor 6.3

File used purely to test the parser in potx.

File

tests/potx_test_7.module
View source
<?php

/**
 * @file
 *   File used purely to test the parser in potx.
 */

/**
 * Implementation of hook_menu()
 */
function potx_test_7_menu() {
  $items = array();
  $items['translate/test'] = array(
    'title' => 'Test menu item',
    'description' => 'This is a test menu item',
    'page callback' => 'potx_test_7_page',
  );
  $items['translate/test-empty'] = array(
    'title' => '',
  );
  $items['translate/test-empty']['description'] = 'Test menu item description';
  return $items;
}

/**
 * Implementation of hook_menu_alter()
 */
function potx_test_7_menu_alter(&$items) {
  $items['translate/test-empty']['description'] = 'Test menu item description altered (1)';
  $items['translate/test-empty'] = array_merge($items['translate/test-empty'], array(
    'title' => 'Test menu item title altered',
    'description' => 'Test menu item description altered (2)',
  ));
}
function potx_test_7_page() {
  t('This is a test string.');
  format_plural($count, '1 test string', '@count test strings');
  watchdog('test watchdog type', 'My watchdog message');
  st('Installer only test string');
  $t('Dynamic callback test string');
  t('Test string in context', array(), array(
    'context' => 'Test context',
  ));
  format_plural($count, '1 test string in context', '@count test strings in context', array(), array(
    'context' => 'Test context',
  ));
  t('');
  st('Installer string in context', array(), array(
    'context' => 'Installer context',
  ));
  $t('Dynamic string in context', array(), array(
    'context' => 'Dynamic context',
  ));
}
function potx_test_7_perm() {
  return array(
    'test potx permission',
    'one more test potx permission',
    '',
  );
}
function potx_test_7_permission() {
  return array(
    'test potx permission' => array(
      'title' => t('Test potx permission'),
      'description' => t('Test potx permission description'),
    ),
    'one more test potx permission' => array(
      'title' => t('One more test potx permission'),
      'description' => t('One more test potx permission description'),
    ),
  );
}