Hi,

I installed the module and it works.
But I can't see the german translations.

For example "You can send XXX a message using the contact form below.". In the file "translations/de.po" are the correct translations.

Regards
David

Comments

steffenr’s picture

Status: Active » Needs review
StatusFileSize
new754 bytes

Translation 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..

behindthepage’s picture

Thanks 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

steffenr’s picture

Hi 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" ;)

behindthepage’s picture

StatusFileSize
new5.14 KB

Hi 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

steffenr’s picture

thx 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

behindthepage’s picture

What translation modules are you using? And what languages?
Have you cleared cache? switched module on and off?

Regards
Geoff

behindthepage’s picture

Title: German translation does not work. » New translation friendly code - needs testing
Assigned: Unassigned » behindthepage
steffenr’s picture

StatusFileSize
new779 bytes

I 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

behindthepage’s picture

Sorry 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

behindthepage’s picture

OK the version on Git is now the latest version of code to test.

Thanks
Geoff

behindthepage’s picture

Status: Needs review » Closed (fixed)

Ver 7.x-1.4 now is fully tranlatable.

Regards
Geoff