Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: How to switch a language in the C1 admin panel using "Composite.Navigation.LanguageSwitcher"?

$
0
0
Hi @ralfilab

You can see the code that does it in:

\Composite.Workflows\C1Console\Users\Workflows\ChangeOwnActiveLocaleWorkflow.cs

To change the language use the following line:
UserSettings.ActiveLocaleCultureInfo = cultureInfo;
Since our console UI supports only one active language at a time, one should either send a message to opened instances of the console to switch its language (which will be confusing to the user), or at least check if there're no opened consoles, and then change the language only in that case:
            var cultureInfo = new CultureInfo("uk-UA");
            
            if (UserValidationFacade.IsLoggedIn())
            {
                if (!ConsoleFacade.GetConsoleIdsByUsername(UserSettings.Username).Any())
                {
                    UserSettings.ActiveLocaleCultureInfo = cultureInfo;
                }
            }

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>