I'm building an AJAX translation module which will improve the ease of online translating compared to the locale and other existing modules. I'm fairly new to drupal development and ran into a problem already. The install() hook does not seem to be called when installing the module. This is the code in the translator.install file so far:
<?php
// $Id: translator.install
/**
* Implementation of hook_install().
*/
function translator_install() {
echo "translator_install()";
drupal_install_schema('translator');
}
/**
* Implementation of hook_uninstall().
*/
function translator_uninstall() {
db_query('ALTER TABLE locales_source DROP comments;');
db_query('ALTER TABLE locales_target DROP fuzzy;');
}
/**
* Implementation of hook_schema().
*/
function translator_schema() {
echo "translator_schema()";
// Our schema will be based on that of the locale module
$schema = locale_schema();
$schema['fields']['locales_source']['comments'] = array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => t('Comments are only visible to translators. It can be used to specify a context or interpretation which might be useful when translating.'),
);
$schema['fields']['locales_target']['fuzzy'] = array(
'type' => 'int:tiny',