Class LanguageSelectorFactory
Creates language selectors for different scenarios.
Inheritance
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 12.0.3Syntax
[ServiceConfiguration(ServiceType = null)]
public class LanguageSelectorFactory : Object
Constructors
LanguageSelectorFactory()
Declaration
public LanguageSelectorFactory()
Methods
AutoDetect()
Creates a language selector that reads current language selection and enables fallback languages
Declaration
public virtual LanguageSelector AutoDetect()
Returns
Type | Description |
---|---|
Language |
A language selector object |
AutoDetect(Boolean)
Creates a language selector that reads current language selection and enables fallback languages
Declaration
public virtual LanguageSelector AutoDetect(bool enableMasterLanguageFallback)
Parameters
Type | Name | Description |
---|---|---|
System. |
enableMasterLanguageFallback | Enable master language as a last resort for fallback instead of filtering a page |
Returns
Type | Description |
---|---|
Language |
A language selector object |
Create(String)
Creates an ILanguage
Declaration
public virtual LanguageSelector Create(string languageBranch)
Parameters
Type | Name | Description |
---|---|---|
System. |
languageBranch | The prefered language branch (overrides user choice) |
Returns
Type | Description |
---|---|
Language |
A new ILanguage |
Fallback(String, Boolean)
Creates a language selector with a custom language selection and enables fallback languages
Declaration
public virtual LanguageSelector Fallback(string preferredLanguageBranch, bool enableMasterLanguageFallback)
Parameters
Type | Name | Description |
---|---|---|
System. |
preferredLanguageBranch | The prefered language branch (overrides user choice) |
System. |
enableMasterLanguageFallback | Enable master language as a last resort for fallback instead of filtering a page |
Returns
Type | Description |
---|---|
Language |
A language selector object |
MasterLanguage()
Creates a language selector that always selects the master language of a page
Declaration
public virtual LanguageSelector MasterLanguage()
Returns
Type | Description |
---|---|
Language |
A language selector object |