--- taxonomy_timer.module 2008-08-26 03:03:34.000000000 +0200 +++ taxonomy_timer_translatable.module 2009-03-10 12:41:52.000000000 +0100 @@ -27,7 +27,7 @@ function taxonomy_timer_menu($may_cache) ); $items[] = array( 'path' => 'admin/taxonomy_timer/notify_settings', - 'title' => 'Taxonomy Timer Email Settings', + 'title' => t('Taxonomy Timer Email Settings'), 'description' => t('Set the content for the email sent during notification'), 'callback' => 'taxonomy_timer_notify_form_display', 'access' => user_access('administer taxonomy_timer settings'), @@ -178,14 +178,14 @@ function taxonomy_timer_defaults() { /* drupal_set_message("
" . sprint_r( $actions ) . "
"); */ if ( !$options ) { - drupal_set_message("Taxonomy Timer requries the creation of some vocabs and terms. Please " . l('create some terms','admin/content/taxonomy') . " before trying to configure this module.",'error'); + drupal_set_message(t("Taxonomy Timer requries the creation of some vocabs and terms. Please") . " " . l(t('create some terms'),'admin/content/taxonomy') . t(" before trying to configure this module."),'error'); } else { $yesno = array('1' => t('Yes'), '0' => t('No') ); $form['tt_intro'] = array( - '#value'=>'

Taxonomy Timer can be used to schedule the expiration of nodes that contain certain terms (tids). You have the choice to just unpublish that node, or to assign a new tid. This can all be configured here.

+ '#value'=>t('

Taxonomy Timer can be used to schedule the expiration of nodes that contain certain terms (tids). You have the choice to just unpublish that node, or to assign a new tid. This can all be configured here.

Be sure to visit ' . l('the access control page','admin/user/access') . ' to configure who can over-ride this stuff at the node level.

-

' . l('Visit the email notification form','admin/taxonomy_timer/notify_settings') . ' to configure the email that gets sent as an expiration warning. We have placed that form on its own page so that we can add more email notifications in future versions.' +

' . l('Visit the email notification form','admin/taxonomy_timer/notify_settings') . ' to configure the email that gets sent as an expiration warning. We have placed that form on its own page so that we can add more email notifications in future versions.') ); /* list all tids that are already enabled...or show some text */ $form['tt_defaults'] = array( @@ -230,8 +230,8 @@ function taxonomy_timer_defaults() { $tt_output .= "" . $action . "\n"; // send a confirmation window for delees - $attr = array( 'onClick' => 'return confirm("Are you sure you wish to delete this timer?")'); - $tt_output .= "" . l('delete','admin/taxonomy_timer/delete/'. $row['ttid'], $attr); + $attr = array( 'onClick' => 'return confirm("'.t('Are you sure you wish to delete this timer?').'")'); + $tt_output .= "" . l(t('delete'),'admin/taxonomy_timer/delete/'. $row['ttid'], $attr); $tt_output .= "\n"; } @@ -243,7 +243,7 @@ function taxonomy_timer_defaults() { } else { $form['tt_defaults']['empty_text'] = array( - '#value' => '

There are no entries in the defaults table (yet). Please use the form below to start setting up your taxonomy expirations.' + '#value' => t('

There are no entries in the defaults table (yet). Please use the form below to start setting up your taxonomy expirations.') ); } @@ -257,7 +257,7 @@ function taxonomy_timer_defaults() { '#weight' => '10' ); $form['tt_add']['happy_text'] = array( - '#value' => '

Pick a term and a type to create a new default timer.

', + '#value' => t('

Pick a term and a type to create a new default timer.

'), '#weight' => '-10' ); $form['tt_add']['add_tid'] = array( @@ -278,8 +278,8 @@ function taxonomy_timer_defaults() { ); $form['tt_add']['duration'] = array( '#type' => 'textfield', - '#title' => 'Expire after', - '#description' => "...in days", + '#title' => t('Expire after'), + '#description' => t("...in days"), '#size' => 5, '#maxlength' => 4, '#required' => TRUE, @@ -287,8 +287,8 @@ function taxonomy_timer_defaults() { ); $form['tt_add']['action'] = array( '#type' => 'select', - '#title' => 'After expiration, assign this term (or unpublish node)', - '#description' => 'Select at least one of these, hold down ctrl to select multiple', + '#title' => t('After expiration, assign this term (or unpublish node)'), + '#description' => t('Select at least one of these, hold down ctrl to select multiple'), '#weight' => 6 , '#size' => 10, '#multiple' => TRUE, @@ -324,31 +324,31 @@ function taxonomy_timer_notify_form_disp function taxonomy_timer_notify_form( ) { $form['tt_intro'] = array( - '#value'=>'

Taxonomy Timer sends emails when expiration nears. You can configure that message here.

As future versions arise, we plan to add more notifications here.' + '#value'=>t('

Taxonomy Timer sends emails when expiration nears. You can configure that message here.

As future versions arise, we plan to add more notifications here.') ); $form['basics'] = array( '#type' => 'fieldset', - '#title' => 'Taxonomy Timer Email Settings', + '#title' => t('Taxonomy Timer Email Settings'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => 0 ); $form['basics']['from_address'] = array( '#type' => 'textfield', - '#title' => 'Emails from', + '#title' => t('Emails from'), '#default_value' => variable_get('taxonomy_timer_notification_from',''), '#required' => TRUE ); $form['warning'] = array( '#type' => 'fieldset', - '#title' => 'Taxonomy Timer Warning Email', + '#title' => t('Taxonomy Timer Warning Email'), '#collapsible' => TRUE, '#collapsed' => FALSE, '#weight' => 10 ); $form['warning']['subject'] = array( '#type' => 'textfield', - '#title' => 'Email Subject', + '#title' => t('Email Subject'), '#default_value' => variable_get('taxonomy_timer_notification_subject','%nodetitle due to %action on %exp'), '#description' => t('You can variable subst. %ext (expiration date), %action (e.g. unpublish) and %nodetitle (node title) in the subject field.'), '#required' => TRUE @@ -356,7 +356,7 @@ function taxonomy_timer_notify_form( ) { $form['warning']['email_content'] = array( '#type' => 'textarea', '#default_value' => variable_get('taxonomy_timer_notification_content','%nodetitle is due to %action at %exp.'), - '#title' => 'Expiration Warning Email (plain text)', + '#title' => t('Expiration Warning Email (plain text)'), '#required' => TRUE, '#description' => t('You can variable subst. %exp (expiration date, e.g. "Sep 9, 2007"), %action (the action...adding a term or unpublish...just use the word "expire" if you wish), %nodetitle (node title), %nodeeditlink (shows the title of the node, linked to the edit page). Currently this email is sent') ); @@ -401,7 +401,7 @@ function taxonomy_timer_defaults_validat } } if ( !$proceed ) { - form_set_error('action',"Please correct the selections for After expiration, assign this term (or unpublish node)"); + form_set_error('action',t("Please correct the selections for After expiration, assign this term (or unpublish node)")); } } } @@ -426,7 +426,7 @@ function taxonomy_timer_defaults_submit( drupal_set_message( "There was an error with $statement ",'error'); } else { - drupal_set_message("Taxonomy Timer: Success creating a new timer."); + drupal_set_message(t("Taxonomy Timer: Success creating a new timer.")); } } } @@ -528,7 +528,7 @@ function taxonomy_timer_form_alter( $for // following if statement (so then there will be from now on) $tt_data = _get_tt_data( $form['#node']->nid, $form['#node']->type ); if ( !$tt_data ) { - drupal_set_message("tt data will be the defaults..."); + drupal_set_message(t("Taxonomy Timer data will be the defaults...")); $tt_data = _set_tt_defaults( $form['#node']->nid, $form['#node']->type ); } @@ -537,13 +537,13 @@ function taxonomy_timer_form_alter( $for // stuff this into the node edit form $form['taxonomy_timer'] = array( '#type' => 'fieldset', - '#title' => 'Taxonomy Timer Configuration', + '#title' => t('Taxonomy Timer Configuration'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#weight' => 10 ); $form['taxonomy_timer']['intro'] = array( - '#value' => '

Taxonomy Timer enables automatic expiration, term changes and unpublishing of nodes after a given period of time. You have the opportunity to edit some (but not all) of the timers attached to this node.

', + '#value' => t('

Taxonomy Timer enables automatic expiration, term changes and unpublishing of nodes after a given period of time. You have the opportunity to edit some (but not all) of the timers attached to this node.

'), '#weight' => '-10' ); @@ -564,40 +564,41 @@ function taxonomy_timer_form_alter( $for //drupal_set_message("expiration date = " . $tt_data[$tt_entry]['tt_expiration'] ); $actiondate = getdate( $tt_data[$tt_entry]['tt_expiration']); //drupal_set_message("action date = $actiondate"); - $pretty_date = $actiondate['month'] . ' ' . $actiondate['mday'] . ', '. $actiondate['year']; + $pretty_date = t("!month !day, !year", array('!month' => t($actiondate['month']), '!day' => $actiondate['mday'], '!year' => $actiondate['year']) ); + //drupal_set_message("pretty date = $pretty_date"); $expires_in_days = intval( ($tt_data[$tt_entry]['tt_expiration'] - $today_stamp) / 86400 ); //drupal_set_message("expires_in_days = $expires_in_days"); //drupal_set_message("
" . sprint_r( $tt_data[$tt_entry]) . '
'); // what's gonna happen? - $tt_action = 'unpublish this ' . $form['#node']->type; + $tt_action = t('unpublish this %nodetype', array('%nodetype' => $form['#node']->type) ); if ( $tt_data[$tt_entry]['tt_next_tid']) { $next_term = taxonomy_get_term( $tt_data[$tt_entry]['tt_next_tid'] ); - $tt_action = "assign the term " . $next_term->name . " to this " . $form['#node']->type; + $tt_action = t("assign the term %termname to this %nodetype", array('%termname' => $next_term->name, '%nodetype' => $form['#node']->type)); } // if there are at least 1 days until this happens, allow a mod-down (this form is only showing for users with mod-down perms) $mod_options = array( - 'no change' => 'Do not change this scheduled action', - 'immediately' => 'Schedule Immediately' + 'no change' => t('Do not change this scheduled action'), + 'immediately' => t('Schedule Immediately') ); if ( $expires_in_days > 0 ) { for ($x=$expires_in_days; $x>=0; $x--) { $mod_date = getdate( $tt_data[$tt_entry]['tt_expiration'] - ($x * 86400) ); // hide the date that's already scheduled (e.g. we were getting "Sept 26" in the drop // down even though the event is already scheduled for that day) - $pretty_mod_date = $mod_date['month'] . ' ' . $mod_date['mday'] . ', '. $mod_date['year']; - $mod_options[$mod_date[0]] = 'Schedule for ' . $pretty_mod_date; + $pretty_mod_date = t("!month !day, !year", array('!month' => t($mod_date['month']), '!day' => $mod_date['mday'], '!year' => $mod_date['year']) ); + $mod_options[$mod_date[0]] = t('Schedule for !date', array('!date' => $pretty_mod_date)); } } if ( user_access('reset taxonomy_timer settings on nodes') ) { - $mod_options['reset tt_assigned'] = 'Restart this timer'; + $mod_options['reset tt_assigned'] = t('Restart this timer'); } $form['taxonomy_timer'][ 'tt_entry_' . $tt_data[$tt_entry]['ttid'] ] = array( '#type' => "select", '#options' => $mod_options, - '#title' => t("On $pretty_date we will automatically $tt_action"), + '#title' => t("On %date we will automatically !action", array('%date' => $pretty_date, '!action' => t($tt_action) ) ), '#description' => t('Use this form to make it happen sooner.'), '#default_value' => '0', '#weight' => $tt_entry