Language setting

Vote:
 
Hi. Is it possible to set current language to use on the site, without the current user logged in? I want to change to another language for the anonymous users. Thanks, Frank :)
#12105
Jul 07, 2004 13:32
Vote:
 
There are lots of ways to configure the language used on pages, listed below in the order they are checked by EPiServer (if language is defined in more than one way, the alternative with the lowest number applies). 1. Define the language in the querystring in a parameter called "epslanguage". 2. Provide the language in a cookie called "epslanguage". 3. Provide the language in Session state, in a session value named "epslanguage". 4. Define a property called PageLanguageID on a page. 5. Define a dynamic string property called PageLanguageID. You can use it to define different languages on entire branches. 6. System language, used if none of (1-5) above are defined. 7. Language attribute on the Page class, used if it has been defined and system language is not defined (or disabled). 8. Finally, fallback-language English is used incase none of the above applies. The language value is the 2-letter language id, also found in the language xml-files (NO, SV, EN... etc). You can disable some of the checks above on a page by defining the Language attribute on the page. For example, to disable 1-3 above: using EPiServer.Core; [Language(SessionLanguage=false,QueryStringLanguage=false,CookieLanguage=false)] public class MyPage : TemplatePage { .... } For more info about the Language attribute, check out the EPiServer.Core.LanguageAttribute class in the SDK.
#13660
Jul 07, 2004 14:40
Vote:
 
Remember that if your page shall be able to use the new language handling in EPiServer, it cannot inherit from SimplePage. It must inherit from TemplatePage.
#13661
Apr 28, 2005 14:32
Vote:
 
A page can inherit from SimplePage and still use the language functionality in EPiServer. If you want to have the same functionality as with TemplatePage you have to set the language attributes on your class as these are also inherited. An example how TemplatePage defines some language attributes that differs from EditPage: [Language(SessionLanguage=true,QueryStringLanguage=true,CookieLanguage=true,HttpContextLanguage=true)] public class TemplatePage : EditPage
#13662
May 16, 2005 11:07
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.