Hi -

I'd like to build a multi-language site, so I'm trying to add some languages to my Drupal 6.6 site using admin/settings/language/add.

However, I keep getting an error message after clicking the 'Add Language' button on admin/settings/language/add, and then when I go to admin/build/translate all the added languages show 0%.

My Drupal 6.6 site seems to be at least partially "aware" that the language packages have been properly installed, because I'm able to do the following two things:

a. I'm able to add a 'Language Switcher' block, which displays the added languages in addition to English. However, clicking on the various added languages only changes the browser's URL (eg, from http://mydomain.com/admin to http://mydomain.com/de/admin after clicking on 'German' in the 'Language Switcher' block), while the admin interface unfortunately remains displayed in English.

b. I'm able to install, enable and use the 'Language Sections' module. However, this only translates the Body (not the Title) of Pages which I've added using node/add/page. Instead, I would prefer to use the more complete 'Internationalization' module which is also supposed to translate the admin interface as well.

Here's the steps I followed to reproduce this error (for Portuguese (Brazil), Spanish and German - and at two different shared web hosting providers):

1. First I downloaded a language package to my computer, uploaded it to my site (in my drupal directory) and extracted the files (using cPanel) so that each .po file got extracted to the appropriate subdirectory, following the instructions given here:

http://drupal.org/node/275705
http://drupal.org/node/203318
http://11heavens.com/building-powerful-and-robust-websites-with-drupal-6...
http://www.lullabot.com/videocast/installing-drupal-translation

Some of these site say that you should extract the .po files from a language package into the proper subdirectories before using admin/settings/language/add (and
http://drupal.org/node/275705 also says that that you should install and enable the i18n package before using admin/settings/language/add), so I extracted the .po files from the language package and I installed enabled the i18n module before proceeding with my step 2 below.

I also went to admin/settings/language/configure and and changed the 'language negotiation' setting from 'None' to 'Path prefix only'. (I've tested doing this two both before and after proceeding with my step 2 below, and I still get the error.)

2. Then I went to admin/settings/language/add, and after using the dropdown menu to select the language to be added and clicking the 'Add Language' I get the following (very lengthy!) error message:

An error occurred. /?id=&op=do <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <title>mydomain | mydomain</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/node/node.css?V" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/system/defaults.css?V" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system.css?V" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/system/system-menus.css?V" /> <link type="text/css" rel="stylesheet" media="all" href="/modules/user/user.css?V" /> <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/style.css?V" /> <link type="text/css" rel="stylesheet" media="print" href="/themes/garland/print.css?V" /> <!--[if lt IE 7]> <link type="text/css" rel="stylesheet" media="all" href="/themes/garland/fix-ie.css" /> <![endif]--> </head> <body class="sidebar-left"> <!-- Layout --> <div id="header-region" class="clear-block"></div> <div id="wrapper"> <div id="container" class="clear-block"> <div id="header"> <div id="logo-floater"> <h1><a href="/" title="mydomain"><img src="/themes/garland/logo.png" alt="mydomain" id="logo" /><span>mydomain</span></a></h1> </div> </div> <!-- /header --> <div id="sidebar-left" class="sidebar"> <div id="block-user-1" class="clear-block block block-user"> <h2>admin</h2> <div class="content"><ul class="menu"><li class="leaf first"><a href="/user/1">My account</a></li> <li class="collapsed"><a href="/node/add">Create content</a></li> <li class="collapsed"><a href="/admin">Administer</a></li> <li class="leaf last"><a href="/logout">Log out</a></li> </ul></div> </div> </div> <div id="center"><div id="squeeze"><div class="right-corner"><div class="left-corner"> <div class="messages status"> The language <em>Portuguese, Brazil</em> has been created and can now be used. More information is available on the <a href="/admin/help/locale">help screen</a>.</div> <div class="clear-block"> <div id="first-time"><h1 class="title">Welcome to your new Drupal website!</h1><p>Please follow these steps to set up and start using your website:</p><ol><li><strong>Configure your website</strong> Once logged in, visit the <a href="/admin">administration section</a>, where you can <a href="/admin/settings">customize and configure</a> all aspects of your website.</li><li><strong>Enable additional functionality</strong> Next, visit the <a href="/admin/build/modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="http://drupal.org/project/modules">Drupal modules download section</a>.</li><li><strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="/admin/build/themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="http://drupal.org/project/themes">Drupal themes download section</a>.</li><li><strong>Start posting content</strong> Finally, you can <a href="/node/add">create content</a> for your website. This message will disappear once you have promoted a post to the front page.</li></ol><p>For more information, please refer to the <a href="/admin/help">help section</a>, or the <a href="http://drupal.org/handbooks">online Drupal handbooks</a>. You may also post at the <a href="http://drupal.org/forum">Drupal forum</a>, or view the wide range of <a href="http://drupal.org/support">other support options</a> available.</p></div> </div> <div id="footer">hosted by <a href="http://vlexo.com" target="_blank">vlexo.com</a><div id="block-system-0" class="clear-block block block-system"> <div class="content"><a href="http://drupal.org"><img src="/misc/powered-blue-80x15.png" alt="Powered by Drupal, an open source content management system" title="Powered by Drupal, an open source content management system" width="80" height="15" /></a></div> </div> </div> </div></div></div></div> <!-- /.left-corner, /.right-corner, /#squeeze, /#center --> </div> <!-- /container --> </div> <!-- /layout --> </body> </html>

3. Later when I go to admin/build/translate, the ratios all show up as zero percent for the languages I've attempted to add:

Language	Built-in interface	Blocks	Content type	Menu	Profile	Taxonomy
English (built-in)	n/a	n/a	n/a	n/a	n/a	n/a
German	0/1003 (0%)	0/0 (0%)	0/5 (0%)	0/0 (0%)	0/0 (0%)	0/0 (0%)
Portuguese, Brazil	0/1003 (0%)	0/0 (0%)	0/5 (0%)	0/0 (0%)	0/0 (0%)	0/0 (0%)
Spanish	0/1003 (0%)	0/0 (0%)	0/5 (0%)	0/0 (0%)	0/0 (0%)	0/0 (0%)

So when I attempt to use the 'Language Switcher' block, the built-in interface remains in English instead of switching to the added language I selected.

Any help would be most appreciated.

Thanks!

Comments

StefanScottAlexx’s picture

Update:

I've tested this further and found that I am the website does allow editing and viewing translations for added content.

It's just not working for the built-in interface.

I think this might have something to do with the .po files included in the various language packages.

Do the strings in them actually match (letter-for-letter) the strings in the current built-in interface?

My installed Drupal version is 6.6, and the three language packages which I uploaded and extracted to my Drupal directory (Portuguese (Brazil), Spanish, and German) all said '6.x' - so I'm assuming the strings do match.

Oh well, at least end users can now view the added content in my site in various languages. But I'm still concerned about the error message and the ratios all being 0%. Also, I haven't completely tested this, to make sure that the entire site (as viewed by a user) is translated (eg, menus, taxonomy, etc.).

Any suggestions about fixing the error message and the ratios reported in my original post would be greatly appreciated!

Thanks.

jps001’s picture

Hi,

i have the same problem when i try to install the dutch language file.

Steps i made.

1. fresh install of 6.6
2. uploaded the http://drupal.org/node/284616
3. Module local and content translation installed
4. Add language when selected Dutch (nederlands)
5. Almost the same error as above (diffrence are my file and server names)

someone help me out please

Jasper

mmeilby’s picture

I get the same error when I try to install danish language pack:

An error occurred. /?id=&op=do

Tried to install danish and german languages. No difference - same error.
Seems to be some kind of general problem in the import/scan feature of the add language functionality.

Import of single .po files works ok.

Tried to verify permissions on filesystem. Tried to change the tmp folder and files folder but problem still exists.

Itangalo’s picture

Some people in the Swedish Drupal forum have experienced the same problem. It appears that the problem is caused by what formats are or are not accepted by the server.

Try turning off mod_security filtering, which hopefully can be done by adding the following to the .htaccess files:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterInheritance Off
</IfModule>

The discussions about this in our Swedish forums can be found at:
http://groups.drupal.org/node/17263
http://groups.drupal.org/node/10127#comment-34394
http://groups.drupal.org/node/11514#comment-37524

Good luck.
//Johan Falk, Sweden

Regw’s picture

Hi - thx Johan for the tip (unfortunately I don't read swedish).
I deleted the languages in the language admin interface, checked that my language files were still in the various folders on the server, changed the htaccess file and add a language again in the languages admin interface => same error.

Help help!

steveray’s picture

I'm having the same problem with Drupal 6.9 and Espanol.
Either the Add Language function is broken or I'm setting it up wrong.
I've searched for hours and can't find clear docs on how to set it up either, so I don't know what to try next.

I've got the Spanish files extracted into each of the module directories, e.g.:
drupal/modules/blog/translations/module-blog.es.po

On the Add Languages page, I hit Add Language and get the same "an error occured" followed by HTML on a red background. Embedded in the HTML is the message: "

The language Spanish has been created and can now be used. More information is available on the help screen.

"

But I don't get any Spanish translation.

Any help would be appreciated.

Steve

mjpixley’s picture

I got the same problem with chinese .po

Does anyone have a solution?

tunic’s picture

Same error, Drupal 6.9, adding Spanish (or any other language) I get that error: "An error occurred. /?id=&op=do" followed by what it seems to be a raw HTML web page.

.htaccess file tip doesn't work.

I can get some strings translated importing manually the po files, but not all if them. I've not check to import mannually all the Spanish translation PO files, may be that's the workaround for this error...

Help is highly apreciated, thanks in advance...

EDIT (SOLVED)
Ok, afert looking to this comment I've solved the issue:
http://drupal.org/node/352145#comment-1180747

So, for Spanish translation I've executed (on a Unix system):

curl -s http://ftp.drupal.org/files/projects/es-6.x-1.3.tar.gz| tar xzOf - --wildcards modules/* profiles/* themes/* > es.po 

Then, I've imported this es.po file to Drupal in Translate Interface import tab and now almost all buil in strings are translated. I hope this will help.

ncameron’s picture

Gracias señor, thank you sir! You stopped me bashing my head against the wall for another 4 hours.

manObject’s picture

Turning off Mod Security Filtering sounds a bit risky - especially as a first step. Instead, I suggest inserting the appropriate mod_security entries for each of the language pack top level directories you've added. depending on your server set-up, you might need to get your server administrators to do this for you.

pimok3000’s picture

I can definitly confirm that when having the error :

/?id=&op=do

deactivating mod_sec in apache solves this error. It would be great to get to know where in the mod_sec rules set one can add .po files to be allowed to be executed so the install can run through without this error. Does anyone have some more information on this?

Best Regards
Torsten Zenk

rashendi’s picture

Disable all the modules you've enabled, then enable the module 'Locale' -> Then go to /admin/settings/language and add your language, then enable all the module you need.

charlz’s picture

I tried disabling all modules but it still didn't work... :-(

What DID work though was this:
Instead of choosing the Predefined Languages option I chose Custom Language when in the Add Language tab. And all of a sudden, everything worked!

parzno’s picture

This problem does not occur if the translation will extract the installation of Drupal.
Unfortunately, I do not know what to do and to add language to work on already installed Drupal: (

davidwhthomas’s picture

Same error here, but, after the batch api error, I could "reimport translation packages" using

http://drupal.org/project/l10n_client

The interface translation then works.

However, I can't get the 'translate' tab to show up on nodessnlation works, but, I can't get the 'translate' tab to show up on nodes and there's no language select box on node create/edit forms

UPDATE: I could get the language select box showing on node forms after updating the content type edit form under "workflow settings"

yehanny’s picture

Try the "Custom Language" option like y did and it works! by adding the following:

Language code: es (It's the default language for your country, for example: en = english, es = spanish, fr = french)
Name in english: Spanish
Native language name: Español
Path prefix: es (use the same as language code)
Language domain: Leave in blank
Direction: Left to right

Click the "Add custom language" button and that it!

Cheers!.. Hopes it work for you too!... (=