- Add-ons
- Architecture
- BLOB providers
- Caching
- Client resources
- Configuration
- Configuring episerver
- Configuring episerver.dataStore
- Configuring episerver.framework
- Configuring episerver.packaging
- Configuring episerver.search
- Configuring episerver.shell
- Configuring module.config
- Configuring staticFile
- Configuring episerver.basicAuthentication
- Configuring .NET SignalR
- Configuring Image Service
- Configuring link validation
- Reading application settings programmatically
- Content
- IContentRepository/DataFactory interface
- Persisting IContent instances
- Synchronization
- Selecting content
- Validation
- ContentType attribute
- Grouping content types and properties
- Page types and templates
- Creating page templates and block controls
- Block types and templates
- EditHint in MVC
- Creating a page programmatically
- Converting page types for pages
- Refactoring content type classes
- Multilingual content
- Properties
- Links
- Assets and media
- Providers
- Deployment
- Dynamic content
- Dynamic data store
- Editing
- Event management
- Globalization
- Initialization
- Logging
- Personalization
- Rendering
- Reports
- Routing
- Scheduled jobs
- Search
- Search integration
- Searching and filtering
- Installing and deploying Search Service
- About EPiServer Full-Text Search Client
- About EPiServer Full-Text Search Service
- Configuring EPiServer Full-Text Search Client
- Configuring EPiServer Full-Text Search Service
- Searching for pages based on page type
- Adding search providers
- Security
- Authentication and authorization
- Virtual roles
- Configuring Active Directory membership provider
- Recommendations for ASP.NET security settings
- Securing edit and admin user interfaces
- AspNet Identity OWIN authentication
- Federated security
- Forms authentication
- OWIN authentication
- Mixed mode OWIN authentication
- Permissions to functions
- Protecting users from session hijacking
- Managing cookies on the website
- User interface
- Context-sensitive components
- Service locator
- Describing content in the UI
- Dialogs
- Shell profile
- Store architecture
- Drag-and-drop
- Message service pool
- Publish and subscribe messaging system
- Introduction to Dojo
- Using jQuery
- Extending edit view
- Creating a component
- Extending the navigation
- Developing gadgets
- Command Pattern
- Object editing
- Views
- Virtual path providers
- Workflows
- XForms
This content is archived. See latest version here
Last updated: Feb 23 2015
Adding languages
Introduction
This document describes how to add a new language that does not appear in the list of available languages in the Manage Website Languages function in Admin mode. This is useful when you want to add less commonly-used language and local combinations on an EPiServer CMS installation.
Adding a language to the list of available languages
EPiServer CMS takes the list of the languages that you can enable for a site from the languages that are installed on the host operating system. This can be a problem as the available languages can vary between different machines. The risk here is that if you have a language enabled in your EPiServer CMS database which is not installed on your target machine then EPiServer CMS will throw an exception on start-up, which will make the entire site go down.
If you want to add a new language to EPiServer CMS then you will have to install it on your operating system. This can be done via the CultureAndRegionInfoBuilder class in System.Globalization. This class allows you to create a new language from scratch or by copying it from an existing language, although you will have to run the code in the context of an Administrator account for it to work.
The code sample below shows how CultureAndRegionInfoBuilder can be used to create and register a new language based upon an existing language, in this case creating Hong Kong English (en-HK) from UK English (en-GB). Note that you will need a reference to sysglobl.dll in your project for this to compile.
public static void CreateCulture()
{
//* Get the base culture and region information
CultureInfo cultureInfo = new CultureInfo("en-GB");
RegionInfo regionInfo = new RegionInfo(cultureInfo.Name);
//* Create the a locale for en-HK
CultureAndRegionInfoBuilder cultureAndRegionInfoBuilder = new CultureAndRegionInfoBuilder("en-HK", CultureAndRegionModifiers.None);
//* Load the base culture and region information
cultureAndRegionInfoBuilder.LoadDataFromCultureInfo(cultureInfo);
cultureAndRegionInfoBuilder.LoadDataFromRegionInfo(regionInfo);
//* Set the culture name
cultureAndRegionInfoBuilder.CultureEnglishName = "English (Hong Kong)";
cultureAndRegionInfoBuilder.CultureNativeName = "English (Hong Kong)";
//* Register with your operating system
cultureAndRegionInfoBuilder.Register();
}
Run the code, start EPiServer CMS, go to the Admin view, select Manage Website Languages from the Config tab, click Add Language and your new local combination will be ready to use.
Do you have feedback on this documentation? Send an email to documentation@episerver.com. For development-related questions and discussions, refer to our Forums on https://world.episerver.com/forum/