Skip to content

Instantly share code, notes, and snippets.

@allgood2386
Created August 4, 2014 15:55
Show Gist options
  • Save allgood2386/4e80f475e1753ed3b836 to your computer and use it in GitHub Desktop.
Save allgood2386/4e80f475e1753ed3b836 to your computer and use it in GitHub Desktop.
<?php
/**
* @file translation_form_changes.module
* TODO: Enter file description here.
*/
/**
* Implements hook_form_alter().
*/
function translation_form_changes_form_alter(&$form, &$form_state, $form_id) {
drupal_set_title(t('Second Language for ') . $form['node']['#value']->title);
}
function translation_form_changes_module_implements_alter(&$implementations, $hook) {
if ($hook == 'translation_help' && is_array($implementations)) {
unset($implementations['translation_help']);
}
}
/**
* Implements hook_help().
*/
function translation_form_changes_help($path, $arg) {
switch ($path) {
case 'admin/help#translation':
$output = 'This is my replacement string';
return $output;
case 'node/%/translate':
$output = '<p>' . t('Translations of a piece of content are managed with translation sets. Each translation set has one source post and any number of translations in any of the <a href="!languages">enabled languages</a>. All translations are tracked to be up to date or outdated based on whether the source post was modified significantly.', array('!languages' => url('admin/config/regional/language'))) . '</p>';
return $output;
}
}
function translation_form_changes_menu_alter(&$items) {
sdpm($items);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment