We're running drupal 5.7 and i18n 5.x-2.2

I've added $conf['i18n_variables'] = array etc etc to settings.php as per instructions http://drupal.org/node/134002 (and in the INSTALL.txt)

According to that book page we should see "This is a multilingual variable" appearing next to variables such as site_name and site_slogan (those are two we really need), but we don't and they don't work. If we fill in a value it does not get populated to the i18n_variable table (I assume they are supposed to?).

In other words, its just saves it to the variables table as per normal and the value is therefore still the same for both Swedish and English versions of the site.

Disabling / enabling the module does not help.

Adding rows to the i18n_variable table directly in the database does not work either.

The i18n_variable tables are utf8_general_ci (found a forum post that indicated the collation setting of the table may have something to do with this issue).

Its like as far as our site is concerned, the i18n_variable table does not exist and nothing is looking for it.

I've been trying to figure this out for weeks (on and off) and have basically run out of ideas, can anyone offer some advice, have you had a similar issue - anything! We're a little desperate now because we noticed (now the site is live) that Swedish characters appearing in the English version of the site (site_slogan in particular) are wrongly encoded by Google...

Comments

Jeff Burnz’s picture

Forgot to add, I have tried other themes such as Garland but that makes no difference.

jose reyero’s picture

Status: Active » Postponed (maintainer needs more info)

It looks like your variable settings are not working, otherwise independently of the i18n_variables table the text should show up in forms, so If you could share that part of your settings.php file it would be easier to see.

Besides that, the collation is never specified in the scripts so it should an issue with your db default set up. But if you cant really add rows manually to that table there's something else really wrong with the table (?)

Jeff Burnz’s picture

Here are the variables we have now, as it appears in settings.php :

    $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',
    );

I ran a check table on i18n_variable table and its OK.

I should clarify, I can add rows to the table - no problem, but I am unsure about the format of the value field, in the variable table its like this, for example for the site_slogan s:25:"Twiga är en ideell organisation"; , If I copy paste that into a new row in i18n_variable table and set the language to "en" and change the text to "Twiga ar an ideal organizaton", it does not show up as the site slogan in the Englsih version of the site (the orginal is Swedish). Even if I ad both version to i18n_variable table - one for each language, still no go.

For example:

name         language        value
site_slogan   en             s:25:"Twiga ar an ideal organization";
site_slogan   sv             s:25:"Twiga är en ideell organisation";

Should I try dropping that tables and build it again?

Jeff Burnz’s picture

Can anyone offer some advice or opinion as to why this might not be working?

lisa’s picture

When you went to the admin->site configuration->site information page was your language set to English when you entered and submitted the site name and site slogan in English?

Then using the translation block switch to Swedish. Navigate again to admin->site configuration->site information and enter the site name and site slogan in Swedish and save settings.

See http://drupal.org/node/67824

You need to redefine these variables for the first time for every language, as previous values are lost and they return to defaults -they will be back if you disable i18n-. To define this values, you have to switch to every language when you are in the administration page where you set that variable.

Jeff Burnz’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ok, so I have figured this out...

We have CiviCRM installed and use some code in settings.php to prevent CRM pages from being cached - this was added after the variables were defined.

Moving the variables array to the very bottom of settings.php (so they are the last thing in the file with nothing else after it, not even a blank line) has resolved this issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

mediameriquat’s picture

Hmmmm.... that is interesting.

We're experiencing a similar problem on our website (Koumbit.org -- see for instance the slogan language below the logo that doesn't switch). Some CiviCRM conf were added in the settings.php file, and that could explain why all our i18n variables stopped working all of a sudden.

However, moving the i18n variables at the bottom of the file didn't solve the problem.

Besides, I am currently experiencing the same problem on another Drupal 5.9 website, where the settings.php file used to be the Drupal default (apart from the $db_url line, of course). Added i18n variables, nothing happened.

Clearing the table then importing some data from a similar, fully functional website, and even deleting the i18n_variable table seem to make no difference. That table is not "seen" by the rest of the database.

mediameriquat’s picture

Ooops, I realize a permissions issue prevented me from "really" saving my settings.php file...

So yeah, I can confirm the CiviCRM thing was what caused our problem.

binhcan’s picture

Also found out the settings.php was unchanged because its permission was "555"... Still trying to figure out now.

Got an error that the second array term is not a valid variable. So I kept first 5 disabled the rest. No more error message but still didn't see any "this is a multilingual value".

binhcan’s picture

Alright, I haven't got the "this is a multilingual value" displayed but found out it's working after modifying some value and click Save Configuration.

Cheers to me!!!

BTW, the site is http://jewell.vn try take a look. It will publish the whole site in a day later.

ptrang’s picture

Chào bạn mình đang muốn dịch các slogan, hay footer của website. Mình đã ghé thăm http://jewell.vn và thấy bạn đã dịch được. Bạn có thể chỉ cho mình dịch các biến trong site information được không?
Thanks a lot