Action when removing a language
Hello all, Is there a way to perform some actions in code when deleting a language ? I've tried to find some hooks in the API but couldn't find what i need. Thank you !
On Thu, 2010-09-02 at 13:36 +0300, blouhwtf wrote:
Is there a way to perform some actions in code when deleting a language ? I've tried to find some hooks in the API but couldn't find what i need.
Unfortunately there is no hook for that (I think that it should be), and the only thing that I can think of is really a hack: create hook_watchdog and catch locale's watchdog entry (from locale.inc): watchdog('locale', 'The %language language (%code) has been created.', array('%language' => $name, '%code' => $langcode));
On Thu, 2010-09-02 at 13:42 +0200, Nikola Kotur wrote:
watchdog('locale', 'The %language language (%code) has been created.', array('%language' => $name, '%code' => $langcode));
Whoops, I actually meant this one: watchdog('locale', 'The language %locale has been removed.', $variables);
You could also just hook_form_alter() and add your submit handler to #submit. in test.module: function test_form_locale_languages_delete_form_alter(&$form) { $form['#submit'][] = 'test_form_submit'; } function test_form_submit($form, $form_state) { echo 'hello'; } Nikola Kotur wrote, On 09/02/2010 01:45 PM:
On Thu, 2010-09-02 at 13:42 +0200, Nikola Kotur wrote:
watchdog('locale', 'The %language language (%code) has been created.', array('%language' => $name, '%code' => $langcode));
Whoops, I actually meant this one:
watchdog('locale', 'The language %locale has been removed.', $variables);
Thank you both for your answers. On 2 September 2010 16:01, Olivier Jacquet <ojacquet@jax.be> wrote:
You could also just hook_form_alter() and add your submit handler to #submit.
in test.module:
function test_form_locale_languages_delete_form_alter(&$form) { $form['#submit'][] = 'test_form_submit'; }
function test_form_submit($form, $form_state) { echo 'hello'; }
Nikola Kotur wrote, On 09/02/2010 01:45 PM:
On Thu, 2010-09-02 at 13:42 +0200, Nikola Kotur wrote:
watchdog('locale', 'The %language language (%code) has been created.',
array('%language' => $name, '%code' => $langcode));
Whoops, I actually meant this one:
watchdog('locale', 'The language %locale has been removed.', $variables);
participants (3)
-
blouhwtf -
Nikola Kotur -
Olivier Jacquet