Support locale and multilanguage sites - 5.x

swentel - November 29, 2007 - 10:18
Project:Boost
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:critical
Assigned:Arto
Status:closed
Description

Use case: I enabled the locale module and added 2 new languages. I created a view which thanks to the i18n module knows that when the locale is en, only english articles are served, same thing for the french locale. Now boost caches this /en/myview as myview.html the first time I hit this page. When I change the language, a new path is made with a new symlink pointing to the same html file (which is first overwritten), when someone new now goes to /en/myview he will see a french list (and all other language differences on that page).

So locale and i18n support would be great!

#1

moshe weitzman - November 30, 2007 - 03:23
Version:5.x-1.0» 5.x-1.x-dev
Status:active» postponed

i thik supporting this has to be a drupal6 only feature since urls not standardized before then.

#2

Benjamin Melançon - January 22, 2008 - 13:44
Category:task» support request
Priority:normal» critical
Status:postponed» active

There's got to be a way! I understand i18n is not in core until D6, and other modules (Localization) may do things differently, but I would greatly appreciate if people with some experience with Boost and/or URL rewriting could indulge the 'critical support request' rating, and take a look at how Boost might work with locales, as this is pretty important to WSF2008.net staying up in a few days.

As described by the swentel in the original post, Boost insists on treating all 'path' as a single path, and create symlinks from 'en/path.html', 'es/path.html' etc. to the path.html it created first (in whichever language the page was first viewed).

I changed the weight of i18n.module and locale.module to come before boost.module, hoping this would let paths be internationalized before boost saw them, but it didn't help.

0 stedile:/var/www/d53/cache# ls -la wsf2008.net/0/eng/place/373.html
lrwxrwxrwx 1 www-data www-data 20 2008-01-22 08:28 wsf2008.net/0/eng/place/373.html -> ../../place/373.html
0 stedile:/var/www/d53/cache# ls -la wsf2008.net/0/nl/place/373.html
lrwxrwxrwx 1 www-data www-data 20 2008-01-22 08:29 wsf2008.net/0/nl/place/373.html -> ../../place/373.html

It seems that worst case it should be possible to replicate internationalization logic in boost, but I'm not even sure where to start with that.

It seems the best approach though is to convince boost the paths are not identical and stop it from writing that symlink.

Thanks very much,

benjamin, Agaric Design Collective

#3

moshe weitzman - January 22, 2008 - 15:11

please try barry's patch at http://drupal.org/node/174380 which stops symlink creation.

#4

Benjamin Melançon - January 22, 2008 - 15:34

Had just found that, thanks!

Applied and in use, it appears symlinks are still being created? Or is that a different kind of link, home.html -> ../index.html ... but it's still not wanted!

0 stedile:/var/www/d53/cache/wsf2008.net# ls -la 0/fr
total 16
drwxrwxr-x  4 www-data www-data 4096 2008-01-22 10:32 .
drwxrwxr-x 21 www-data www-data 4096 2008-01-22 10:32 ..
lrwxrwxrwx  1 www-data www-data   13 2008-01-22 10:32 home.html -> ../index.html
drwxrwxr-x  2 www-data www-data 4096 2008-01-22 10:32 node
drwxrwxr-x  2 www-data www-data 4096 2008-01-22 10:31 place

#5

Benjamin Melançon - January 22, 2008 - 15:38

I take that back, svn is ignoring me somehow...

#6

Benjamin Melançon - January 22, 2008 - 16:26
Status:active» fixed

Thanks Moshe, and thanks Barry Jaspin for that patch!

It works great! The whole world is happier. (I had applied an empty patch because I'm not used to curl because I just had to replace my laptop and haven't installed wget yet.)

curl -C - -O http://drupal.org/files/issues/boost-no-symlinks-174380-13.patch
patch
< boost-no-symlinks-174380-13.patch

And no more symlinks short-circuiting the caching and display of the proper language.

benjamin, Agaric Design Collective

#7

Anonymous (not verified) - February 5, 2008 - 16:34
Status:fixed» closed

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

#8

Arto - October 25, 2008 - 12:08
Title:Support locale and multilang sites» Support locale and multilanguage sites
Assigned to:Anonymous» Arto

I'll see about including this in 6.x-1.x-dev in some form, perhaps through an option to disable symlinking.

#9

rsvelko - April 9, 2009 - 14:51
Title:Support locale and multilanguage sites» Support locale and multilanguage sites - 5.x

title change cause creating the same for 6.x - #428976: Support locale and multilanguage sites - 6.x

 
 

Drupal is a registered trademark of Dries Buytaert.