Closed (fixed)
Project:
Contact Forms
Version:
7.x-1.2
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
5 Jan 2012 at 09:26 UTC
Updated:
18 Jan 2013 at 07:39 UTC
Jump to comment: Most recent file
Comments
Comment #1
steffenrTranslation of .po files works fine for - the problem is a not used t-function for the additional_info variable.
If you wrap $additional_info in t() you'll get the strings in the "Translate interface" Backend of your Drupal installation. Attached you find a patch that solves the issue.. Please review..
Comment #2
behindthepage commentedThanks for your patch. I am reluctant to make that change as the documenation for t() says "You should never use t() to translate variables, unless...."
Maybe putting t() in the previous line would be better
$additional_info = (!$categories_data->page_info) ? variable_get('contactforms_information' , t('You can send @category a message using the contact form below.')) : $categories_data->page_info ;What do you think?
Are you using a single language (German) site or a multi language site?
Regards
Geoff
Comment #3
steffenrHi Geoff - that won't work - cause you'll never find the string "You can send @category a message using the contact form below." on your drupal site. The term "@category" is replaced by the category name provided by the user. The module is used on a multilingual site.
Maybe it would be better to use a parameter in the t() Function to replace @category instead of str_replace - in this case it should work in "drupal way" ;)
Comment #4
behindthepage commentedHi Steffan,
I found the proper way to do this here - http://drupal.org/node/304002 which involves changes to the queries in the module which I have made and push to the git repo.
git clone --branch 7.x-1.x http://git.drupal.org/project/contact_forms.git
I would appreciate you testing this on your (dev) site and letting me know if the changes work.
If you don't do git the module is attached.
Regards
Geoff
Comment #5
steffenrthx for your patch - i just tried it on my dev site but couldn't get it working..
Seems like t function won't fetch the text you insert in additional information textarea to make it translatable.
Regards,
Steffen
Comment #6
behindthepage commentedWhat translation modules are you using? And what languages?
Have you cleared cache? switched module on and off?
Regards
Geoff
Comment #7
behindthepage commentedComment #8
steffenrI just installed your latest GIT Version on a plain drupal-7.10 - testing site.
With your latest version i get 2 PHP notices on module settings page:
Notice: Undefined property: stdClass::$page_title in contact_forms_category_list() (line 252
Notice: Undefined property: stdClass::$page_info in contact_forms_category_list() (line 253
After saving settings of a chosen contacts category i get the following error:
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_title' in 'field list'
PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'page_info' in 'field list'
Indeed the column was not created while installing the module - caused by db_column_exists function in contact_forms.install, that's no longer existing in drupal core - attached a patch that fixes this issue.
SteffenR
Comment #9
behindthepage commentedSorry Steffan,
That was old code. My versions have those changes in them. Maybe I committed old code or something sorry for wasting your time. Hold on until I get Git sorted out with ALL the new code.
Regards
Geoff
Comment #10
behindthepage commentedOK the version on Git is now the latest version of code to test.
Thanks
Geoff
Comment #11
behindthepage commentedVer 7.x-1.4 now is fully tranlatable.
Regards
Geoff