Here's a case study of how I am using this module, areas where I have encountered problems and some solutions.
The project is for an international organisation that wishes to have multi-lingual content. They have international volunteers who translate work and submit this to the site administrator. This is currently done in word documents and the task is extremely labour intensive as everything they have currently setup is static. Administrator has to manually add the content and archive files etc. They have over 3000 static documents in english which are currently being translated into several languages. A new english document is added everyday and translations come through everyday from around the world. Furthermore there is an international community with groups in many countries. More being added everyday.
The project goals: to allow volunteers to login and translate indexed content from English and to have a way of communicating with volunteers via a volunteer home page; to have home pages for each language group themed to present content for that particular language; scalable to take on more volunteers and languages; search engine friendly; nurture and grow the community around each language group with user profiles and user submitted content per language group (forum, comments etc.).
The solution I am looking at is to use localizer and drupal multi-site setup along with cck, views to handle presentation of languages on multiple-domains and possibly og module to manage groups. I've setup a database and 1 main domain for english and 4 subdomains (de,it,es,tr). In order to have flexibility with theming and share content as well as user info accross the sites I used the following multi-site config...
1 database with all tables shared except the cache and variable tables. Therefor I have:
tr_cache
tr_variable
es_cache
es_variable etc.
Within each site/sub-domain folder I have the settings.php files configured with corresponding base_url and table prefix settings. Here is an eg.
$db_prefix = array(
'default' => '',
'cache' => 'de_',
'variable' => 'de_',
);
The above setting works for D5.x (previously each shared table had to be listed as opposed to each unique domain table).
I've followed the handbook suggestions for file and folder setups and have placed all shared modules in the site/all directory, where the localizer module also happens to be. I have seperate theme folders for each sub-domain.
Some areas where I am having a tough time...
numerous cache errors...cache table unlocked
Table 'cache' was not locked with LOCK TABLES query: UPDATE cache SET data = 'a:0:{}', created = 1170297261, expire = 0, headers = '' WHERE cid = 'locale:en' in /home/domain/domains/domain.com/public_html/includes/database.mysql.inc in Zeile 172.
cannot modify headers
Cannot modify header information - headers already sent by (output started at /home/zenmate/domains/zenmate.com/public_html/includes/database.mysql.inc:172) in /home/zenmate/domains/zenmate.com/public_html/includes/common.inc in Zeile 311.
When I had one database with all shared tables, I was unable to switch back to the original english language after switching to other sub-domain languages. So I thought this had to do with caching which lead to me creating seperate cache and variable tables for each sub-d. After doing this I started getting the above mentioned errors...cache unlocked and cannot modify headers.
I've got cck installed, localizer, views and pathauto. When I disable localizer the above mentioned errors go away.
Now I understand that these errors are more likely to do with a combination of factors. I am no coder so cannot really interpret what's happening with the error logs.
Have you managed to test localizer on a setup with different hostnames and one db? Is the above setup achievable? Or will I have to look at another way of solving. Any suggestions and comments from the module developer and community will be much appreciated. Thank you Roberto for your consistent effort so far! I feel that once localizer starts to have some documentation to assist with scenarios and questions like the above, it will be a much desired and used tool within Drupal. Maybe it will even find its way into core.
I will be happy to assist with writing out the documentation for the above scenario once we find a solution...whew long post...i've got to get a piano!
Comments
Comment #1
Roberto Gerola commented>When I disable localizer the above mentioned errors go away.
Ok. So the problem is my patches for cache support.
Restore the original version of bootstrap.inc and common.inc files.
Then it should work.
I'll try to understand where the problem is. It is strange because my patches simply extend
the key of page caching adding the content locales in use.
>I feel that once localizer starts to have some documentation
Some friends are writing it. We have a first basic How-To ready.
In the next days we'll release it.
>I will be happy to assist with writing out the documentation for the above scenario once we find a solution
Pay attention, please. The above solution is not a solution. I have to find a more coherent solution.
I don't understand why you want to separate the cache tables.
For variables. I think it isn't a good solution separating the variables tables.
I am implementing the support for the translations of "Site information page"
based on the work of Troy, but I am so busy also with my business that I have not much time.
I hope to be able to provide a support for the first days of the next week.
Comment #2
ray007 commentedI'm not the most qualified to answer that question, but I don't think you need a multisite setup for what you want to do.
Check the option of localization by hostname, turn off the "detect locale" option, and all should be fine, no?
@Roberto: does it make sense to have multiple "switch by" options enabled in the localizer settings? or should those be radio buttons?
Comment #3
Roberto Gerola commented>does it make sense to have multiple "switch by" options enabled in the localizer settings? or should those be radio buttons
The first option : Redirect front page, is correctly a check box
Switch by locale parameter, switch by node's locale and switch by locale prefix can coexist :
the fist permits you to force the switching on url and the third can be useful for non-node
pages, like, for example views.
If the fourth : Switch by hostname is activated, the other three : Switch by locale parameter,
switch by node's locale and switch by locale prefix, should be disabled.
Yes, probably it should be better to have two boxes :
- One site installation with the options :
Switch by locale parameter, switch by node's locale and switch by locale prefix
- Multi site installation with the option :
Switch by hostname
I'll see how to implement it.
Comment #4
Mojah commentedThank you for your responses.
The cache errors may not be related to localizer, as I am getting them whenever logged in. I will try your suggestions however and post back.
The main reason for having the cache table seperate is so that I may have different themes running on each language subdomain. The variables patch that you will be adding will eliminates the need for seperate variables tables.
The change by hostname, works to a certain extent. The navigational elements seem to remain stuck on the last selected language when trying to return to the english main domain. I will continue to experiment and test and post back here.
Comment #5
Roberto Gerola commentedVariables support, or better, site information support is available :
http://drupal.org/node/114980
Comment #6
Roberto Gerola commentedForget your hack with the cache table that can cause a lot of troubles.
In the specific settings.php, you can set the default theme :
# $conf = array(
# 'site_name' => 'My Drupal site',
# 'theme_default' => 'minnelli',
# 'anonymous' => 'Visitor',
# );
Comment #7
Mojah commentedAwesome! Thanks Roberto.
I will upgrade to the lastest cvs version with the variable support.
I did also move away from the cache hack and am trying to use the localizer with standard settings. No switch by hostname, because this is not giving me the desired result. Essentially I would like to have a home page for each language group. Thats why I went for the subdomain option.
Well I will keep working on it and then do a step by step write up once its done.
Many thnx.
Comment #8
Mojah commentedEverything works great when I use the switch by local options. The locale site variables works gracefully...beautifully done.
I then went back to the multi-domain setup. The content displays great. The navigation switches. Site variables all change.
However when I switch back to the tld domain, which is the original english, the navigation, content and site variables remain stuck on the last selected language. I tested while logged in and logged out and on both firefox and ie.
I have all the switch by options unchecked and only the switch by hostname selected.
in the @ hostname boxes I have
domain.net (which should display the original english)
es.domain.net
de.domain.net
Front page is set as the standard node. When I first entered the localizer config, I noticed that the parameter for the english hostname was en.domain.net, which I removed and inserted just domain.net without the en prefix. Could this be causing the problem? Naturally the english content must be accessed via the tld domain and not a subdomain.
Any ideas. Thank you.
Comment #9
Roberto Gerola commented>domain.net (which should display the original english)
Shouldn't it be :
www.domain.net
perhaps ?
Comment #10
Mojah commentednope :)
Comment #11
Mojah commentedI enabled the multi-lingual support option and noticed that when I went into my account and clicked edit then immediately save, without changing any user options, the navigation and content would return to English. But when I change to Spanish or German, and then try the English again, it gets stuck on the last selected language. To return to the english I have to repeat the above procedure...
My account -> edit -> save
Comment #12
Roberto Gerola commented>without changing any user options, the navigation and content would return to English
Yes. It is correct.
There is a hook on the preferences saving tha set the UI locale to the user selected locale.
>But when I change to Spanish or German, and then try the English again, it gets stuck on the last selected language
Help me to understand.
What options are you using under Localizer ?
Are you using the switching by hostname ?
If so, disable the other switch options : by url prefix and
by node's locale.
Could you post the links that you see in the language switching block
that seem not working ?
Comment #13
Mojah commentedI have switch by hostname enabled and all the other switch by locale name options disabled.
I am testing out on this domain http://zenmate.com
Here is the link for the english language: http://zenmate.com/node
for german: http://de.zenmate.com/node
for spanish: http://es.zenmate.com/node
If I enter the site on the english domaina and then click to go to the spanish domain, the content, navigation and site variables switches perfectly. When I click to the german, site, the content, navigation and site variables also switches perfectly. However when I return to the default english, which is on the main domain http://zenmate.com, the navigation, site variables and content remain as the last selected language...in the above example, I would be on the http://zenmate.com (default english) looking at german navigation, content and site variables.
The only way I found to return to the english, was to log in, click on my account -> edit -> save. It returns to the default.
Lets say a visitor gets to the site, decides they want to read some spanish content and then return to reading the english. How would they be able to return to the english content and navigation?
It looks like it has something to do with caching?
Comment #14
ray007 commentedIs the "detect through browser's locale" option active?
Comment #15
Mojah commentedDisactivated.
Thanks.
Comment #16
Mojah commentedThat may have been a bit amgibuous...the detect by browser option was disactivated and is still disactivated.
Just a minute ago I also tested it with the option activated, but no go. At present I have it disactivated with only the switch by hostname option activated.
Comment #17
Roberto Gerola commentedProbabily the problem is due to the localizer_gethost function.
And you are using only the domain for english version, without a hostname.
Now I'm at home, but tomorrow I''ll check it.
I think that if you use as English domanin www.domain.net or en.domain.net
it should work.
Can you try it ? Only for testing.
Let me know.
The problem is there I think.
I can fix it easily.
Comment #18
Mojah commentedSpot on! I created a sub called en.domain and it worked perfectly.
Maybe an option somewhere to specifiy default language and domain? Well I'm sure you have the solution.
Thank you very much.
Comment #19
Roberto Gerola commentedOk, solved.
Download the latest version form CVS :
http://cvs.drupal.org/viewcvs/*checkout*/drupal/contributions/modules/lo...
There was some bugs.
The first page redirection routine is not yet perfect, but it should work at now.
I'll fix it definitively in the next days.
Let me know.
Comment #20
Mojah commentedWorks perfectly Roberto.
Many many thanks.
Comment #21
sunComment #22
(not verified) commented