Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-27-2007, 10:23 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
Default MVC multilanguage applications

Hello,

I am wondering which is the best approach for working with multi-language applications.

Language identifier
Fact: Language identifier will be on URL
Question: How is optimal to be, as controller or a different parameter ? So, we have controllers based on language or not ?


Common views and different views
Facts:
1. Some of the views would be totally same
2. Some of the views would be same just that will be some dynamic code grabbing proper words depending on language
3. Some of the views may have different views (totally, different layout, aso)

Question: Which is be the best approach for such case ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-27-2007, 11:11 PM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

Personally I don't do either...
There are many ways to solve this problem, so here is another one.

You can detect the users language and locale 95% of the time using $_SERVER["HTTP_ACCEPT_LANGUAGE"]
from there you can use something like Zend_Translate to implement multi language support into your application (of course, please do allow the user the option to change languages ).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-28-2007, 05:45 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
Default

Ok, but if user is changing language how you going to send to pages info what language is used ? Was supposed to be on GET.

I don't think COOKIE or SESSION is good idea...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-28-2007, 03:41 PM
Member
 
Join Date: Mar 2007
Posts: 34
Default

I've read in ZF mailing list, that storing language in session, cookie or sth like that is not good idea, because Google, and other search engines can't index other language versions...
IMO the best way is to use sth. like /LANG/controller/action
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-28-2007, 09:48 PM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

That is true, but obviously you should think of the user experience first and foremost. Usually I would not suggest one method, but a combination (cookies, http_accept_language, etc..) so that if one fails you still have other ways to language the user wants.

Using cookies and session is not a problem most of the time if it is backed up with other systems in place. The method provided my Hujer is a perfect example as
the /lang/module/controller/action can be implemented with a custom router to detect if there was a lang prefix else display the default language.

With several systems in place the user will enjoy the automatic detect of their own language and you get the benefit of seo as most spiders dont submit their language anyways.

Detection:
  1. GET/POST
  2. Cookie
  3. Session (usually never needed)
  4. HTTP_ACCEPT_LANGUAGE
  5. Default language

Last edited by SpotSec : 03-28-2007 at 09:50 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 03-29-2007, 05:06 AM
Cristian's Avatar
Administrator
 
Join Date: Feb 2007
Location: Sibiu, Romania
Posts: 99
Default

I won't use Sessions and Cookies due to same limitation on indexing by SE.

I am a SEO freak sometime so i made now my own routes to be used, and would include also language identifier, controller, action, and additional parameters if needed...

All this using a better format for SE than /language/controller/action/....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 03-29-2007, 08:59 PM
SpotSec's Avatar
Senior Member
 
Join Date: Feb 2007
Location: United States
Posts: 116
Default

Not using sessions or cookies just because of seo is not a good idea. Just think if a user comes to a site from a search engine and has problems using it then you will lose some traffic (I almost left because the firefox adblock block images from this site).

Using sessions or cookies alone is a problem for seo, but using it in combination with other methods shown above gives a more user friendly experience and gives you the benefit of seo.

Although I think too much seo does bring down your rankings.
Focus more on the user experience and content, that will most likely be more weighted by users
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 12:14 PM.