Culture, Locale & Language¶
As of 2025-08, Majority supports two languages fully: Spanish (es) and English (en). French (fr) is also considered a supported language, but only limited translations are available, and new content is not translated into French.
Some pointers:
- A user has a Locale set on their profile. This Locale, published by the user area:
- Is always one of the supported Majority languages (e.g., "Majority Locale")
- Is of typenvarchar(12)
- Is safe to use for translations or other locale usages
- It is not safe to assume it is in the formatxx-YY; for example,es-419is a valid Majority Locale.
- When backend services call each other, the
Accept-Languageheader is automatically forwarded. - The
Accept-Languageheader is automatically parsed and set as the current culture on the thread/task (Thread.CurrentThread.CurrentUICulture). - If you need to translate something, prefer to use the methods in
Majority.Platform.Localization; they will read theThread.CurrentThread.CurrentUICultureand translate accordingly.- However, remember that when you are in an Event Handler, the
CurrentUICulturewill not be set to the user's preferred locale. Instead, you need to get the locale from the User area.
- The string in the
Accept-Languageheader is actually very complicated. Do NOT try to parse this into a language or similar unless you know what you are doing!- If you need a Majority Locale from a request, use the helper classes in the platform
Majority.Platform.Localization.
- If you really need to parse it, make sure to handle all the strange cases in the standard (Accept-Language and bcp47)
- Currently, there are two projects:
Rebtel.Core.Infrastructure.LocalizationandMajority.Platform.Localization. The Rebtel one is deprecated.