|
||||
|
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 ?
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
||||
|
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 ).
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
|
||||
|
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...
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
|||
|
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 |
|
||||
|
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:
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog Last edited by SpotSec : 03-28-2007 at 09:50 PM. |
|
||||
|
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/....
__________________
Zend Framework Tutorials | Zend Framework Forums | Zend Framework IRC Channel | | Zend Framework Resources | CoreShifter | Microsoft Forums | Microsoft Links | Microsoft Books |
|
||||
|
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
__________________
SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home SpotSec Blog: http://spotsec.com/blog |
![]() |
| Thread Tools | |
| Display Modes | |
|
|