When you install additional languages into Telligent Community users have the option to choose one of those installed languages as their preferred language. This will mean all content not generated dynamically or by the community will be translated into that language. If someone is browsing the site and not logged in, the site will evaluate the Accept-Language HTTP Header sent by browser. By default Telligent Community ships with U.S English as the language(en-US).
When Would You Would Use ILanguageDetector?
As mentioned, a site uses the following logic to determine what language should be used:
There may however be scenarios where you would like alter the logic that determines what language to display. You can implement a custom ILanguageDetector plugin to completely change the logic that is used to make this decision. ILanguageDetector is an ISingletonPlugin type, therefore you can only have 1 enabled at a time.
Creating a Custom Language Detector
In the rare instance you want to create a new way of defining the site language you can do so by creating a new plugin implementing ILanguageDetector. It's also important know that ILanguageDetector is a singleton plugin, meaning a site can only have a single language detector enabled at a time. This means in order to use a custom ILanguageDetector you must first disable any existing ones which includes the default one that ships in Telligent Community. It is called "Anonymous User Language Detector" and can be found in Administration under the Extensions menu option.
Required References:
- Telligent.Evolution.Platform.dll
- System.Web (.NET Assembly Reference)