You are here

potx_test_6.module in Translation template extractor 8

File used purely to test the parser in potx.

File

tests/potx_test_6.module
View source
<?php

// @codingStandardsIgnoreFile

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

/**
 * Implementation of hook_menu()
 */
function potx_test_6_menu() {
  $items = array();
  $items['translate/test'] = array(
    'title' => 'Test menu item',
    'description' => 'This is a test menu item',
    'page callback' => 'potx_test_6_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_6_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_6_page() {
  t('This is a test string.');
  format_plural($count, '1 test string', '@count test strings');
  format_plural($count);
  format_plural();
  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_6_perm() {
  return array(
    'test potx permission',
    'one more test potx permission',
    '',
  );
}

/**
 *
 */
function potx_test_6_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'),
    ),
  );
}

Functions

Namesort descending Description
potx_test_6_menu Implementation of hook_menu()
potx_test_6_menu_alter Implementation of hook_menu_alter()
potx_test_6_page
potx_test_6_perm
potx_test_6_permission