0

i have installed i18n module and added this lines to setting.php and empty cache to translate slogan and contact form information and ... but it doesnt affect site and values dont add to i18n_variable table.

$conf['i18n_variables'] = array(
        'site_name',
        'site_slogan',
        'site_mission',
        'site_footer',
        'anonymous',
        'user_registration_help',
        'user_mail_welcome_subject',
        'user_mail_welcome_body',
        'user_mail_approval_subject',
        'user_mail_approval_body',
        'user_mail_pass_subject',
        'user_mail_pass_body',
        'contact_form_information'
    );

do you have any suggestion to solve this problem?

2 Answers 2

1

You need to actually go to the page in the admin that updates the variable and edit it from the non-default language url.

For example, with site name, if you have one other language with 'es' as a path prefix you would go to 'http://example.com/es/admin/settings/site-information' and change the site name. Once you do that in another language it will create the variable in the i18n_variable table.

You will know you are on the right track when the element you want to update in the admin says "This is a multilingual variable"

4
  • i cant see "this is a multilingual variable" for site slogan in site information although i add this to setting.php
    – user780
    Commented Jul 13, 2011 at 21:07
  • are you sure internationalization is turned on? what happens if you 'dpm(variable_get('i18n_variables'));' ?
    – acouch
    Commented Jul 18, 2011 at 22:12
  • i18n is enabled (turn on is another thing?). and what is dpm(variable_get('i18n_variables'))?
    – user780
    Commented Jul 19, 2011 at 10:13
  • Any luck? The devel module drupal.org/project/devel will give you some general tools to help you work. "dpm" or "Drupal Print Message" will spit out a variable in an easy to read format. If you install and enable devel you could go to mysite.com/devel/php and type "dpm(variable_get('i18n_variables'));" and see if the i18n_variables is getting set correctly.
    – acouch
    Commented Aug 12, 2011 at 17:38
0

If you are using drush you can check what is the actual value of i18n_variables.

drush variable-get i18n_variables

If the list is different from what you put into settings.php, it means that there is another statement in settings.php or one of the modules that is overriding the variable.

One common cause is having Internationalization tests module enabled. This module overrides i18n_variables with

$conf['i18n_variables'] = array_merge(array('site_name', 'site_frontpage'),
              variable_get('i18n_variables_test', array()));

Unless i18n_variables_test is also set, you would only get site_name and site_frontpage.

If this is the case for you disable Internationalization tests module in the Testing section of Administer -> Site Building -> Modules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.