first of all I tried to get the strings mor drupalish
* no Camel Case
* double spaces in t()'s removed
* Email, email, etc => e-mail
* put _install() in its own file forward.install
* fix things like

...t('Thank you for your interest in spreading the word on').' '.variable_get('site_name', 'drupal').'.</p><p>'...

to

...t('Thank you for your interest in spreading the word on %site_name.', array('%site_name' => variable_get('site_name', 'drupal')))...

* t("e-mail this %type") and t("e-mail this page") are two different things now
-->i was not able to translate this in a proper way to german
-->"e-mail this %type" is still not perfect for the german language... but I have no better solution...
* removed ? > at the end of the file

I was not able to do a new pot-file, because I'm using the "new" SuSE Linux 10.1 which sucks in many ways
so please make one and look at it again if there are still some inconsistencies

ther is still one inconsistency at _settings():
on some textareas like "e-Postcard Message body:"
we have a variables like "%site"
on other textareas like the "Thank You Message:" or "Forward Instructions:" the user has no access to them - the site name gets inserted before the user sees the textarea
we have to decide if we want to have variables like %site on every textarea or if we remove them entirely...

Comments

Tobias Maier’s picture

StatusFileSize
new820 bytes

and here comes thie .install file
you can remove forward.mysql

Tobias Maier’s picture

Status: Active » Needs review
Tobias Maier’s picture

StatusFileSize
new30.72 KB

here comes a new update of my changes
* update-path for the new .install file (UTF8 support as of http://drupal.org/node/22218#utf8_sql)
* removed some redundant drupal_get_path_alias() calls, because drupal_goto() calls url() which calls drupal_get_path_alias() again

seanr’s picture

Looks good, but I prefer to keep two spaces between sentences for grammatical reasons.

Tobias Maier’s picture

I should mention that I did the second argument of variable_get() calls consistent

Tobias Maier’s picture

is it normal in the english language to have two spaces between two sentences?
you have to know this is not my primary language

seanr’s picture

Depends. Most style guides I've seen recommend it, but it's not necessary. My preference is to use two simply because it better deliniates the sentence boundaries, but I suppose its more a matter of personal preference than anything.

Tobias Maier’s picture

StatusFileSize
new31.31 KB

I replaced print theme("page", $output);
with return $output;

I want to point you to

-    $output = drupal_get_form('forward_form', $form);
+    $output .= drupal_get_form('forward_form', $form);

without this forward_instructions where never printed...

Tobias Maier’s picture

I let the double spacing issue as it is in the patch for now
I'm too tired to change this for today

If you may commit this and you think this is necessary to change back,
then you can do this for the few places where it is needed
imho we dont do it in the rest of the drupal world so we shouldnt do it in contrib modules, too...

good night,

tobi

Tobias Maier’s picture

StatusFileSize
new30.67 KB

well, here comes a new version.
I hope this one fits all of our needs...

Tobias Maier’s picture

StatusFileSize
new30.67 KB

a very small change...

david lesieur’s picture

I like (and need) those changes. However, I have noticed something suspicious in forward.module, near line 343. With the patch, the following:

    $form['message']['forward_footer'] = array(
      '#type' => 'hidden',
      '#value' => variable_get('forward_footer', ''),
    );
    $form['message'][] = array(
      '#type' => 'submit',
      '#value' => t('Send e-mail'),
    );

... becomes:

    $form['message']['forward_footer'] = array(
      '#type' => 'hidden',
      '#type' => 'submit',
      '#value' => t('Send e-mail'),
    );

Any explanation? Thanks.

seanr’s picture

It's this part of the patch:

@@ -341,15 +341,12 @@ function forward_form() {
     );
     $form['message']['forward_footer'] = array(
       '#type' => 'hidden',
-      '#value' => variable_get('forward_footer', ''),
-    );
-    $form['message'][] = array(
       '#type' => 'submit',
-      '#value' => t('Send Message'),
+      '#value' => t('Send e-mail'),
     );
 
     $form['#method'] = 'post';
-    $output = drupal_get_form('forward_form', $form);
+    $output .= drupal_get_form('forward_form', $form);
   }
   return $output;
 }

That should be changed to this:

@@ -341,15 +341,12 @@ function forward_form() {
     );
     $form['message'][] = array(
       '#type' => 'submit',
-      '#value' => t('Send Message'),
+      '#value' => t('Send e-mail'),
     );
 
     $form['#method'] = 'post';
-    $output = drupal_get_form('forward_form', $form);
+    $output .= drupal_get_form('forward_form', $form);
   }
   return $output;
 }
david lesieur’s picture

Also, I'm not too sure about some of the changes in function forward_link().

Before the patch, variable "forward_show_on_main" was actually used in forward_link() to determine if the links are to be shown on teasers, which I think is the kind of option we really need. The problem was, the variable was misnamed; it should have been "forward_show_on_teasers". I don't think we need a special case for the home page. So I'd remove the new checks for drupal_is_front_page() and rename the variable. What do you think? If agreed, I can re-roll the patch with that change.

david lesieur’s picture

StatusFileSize
new49.6 KB

Here is an improved patch that includes the fix in #13 and implements my comment in #14.

This also fixes some uses of t() that caused extractor.php to complain (and would have caused user-entered strings to find their way into the locales table). There were even some nested t()'s in the form of t(variable_get('var', t('str'))); ! These are fixed too.

Ah, and this patch also includes an updated forward.pot file.

I hope everybody will be pleased with this. ;-)

French and Spanish translations of the module are coming soon and will be based on this patch.

david lesieur’s picture

FYI: Here is the promised French translation.

Tobias Maier’s picture

hello Sean,

whats about the patch?
do you plan to commit it or does it need more changes?

seanr’s picture

A lot of these changes and many others have been made since then so I'm quite cetain the patch will no longer apply. I'm not sure exactly which changes were implemented at this point since I got very busy with other work and lost track of it for a bit. If someone can re-roll the patch against the latest version I'll commit it.

Tobias Maier’s picture

StatusFileSize
new45.36 KB

i applied Davids patch which looks good to me,
tested it if it works
and made a new patch file

seanr’s picture

OK, will test this today and hopefully get it committed today or Monday.

seanr’s picture

Thank you very much, BTW.

alexandreracine’s picture

Any update on this one? :)

alexandreracine’s picture

Status: Needs review » Closed (fixed)

Seems ok...