locked
[UWP][Kiosk][Language][c#] Language support in Kiosk mode RRS feed

  • Question

  • I have an app with two languages en-US and es-MX, I switch the language through an option in my app. But when I side loaded the app the language verbiage did not change when I changed languages. Once I installed the ex-MX language option in the Windows 10 and re-installed the app the language option worked.  But I am trying to install this app in Kiosk mode.  In Windows 10 I can create a Kiosk user and assign the app which I do, but when I restart the computer and login to the Kiosk user the app starts and runs, but the language option does not work and there's no way I can add es-MX language when in Kiosk mode.

    How do I active/add/porogram the languages in Kiosk mode?

    Here is a part of my code:

            private ResourceContext _context;
            private readonly ResourceMap _resourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("Resources");
            _context = new ResourceContext { Languages = new[] { ViewModel.SelectedLanguage.Value } }

     private string GetResource(string key)
            {
                return _resourceMap.GetValue(key, _context).ValueAsString;
            }


    Peter

    Wednesday, October 23, 2019 7:59 PM

Answers

  • Hi,

    Language is a static option for the application. Once the language is determined during application initialization, it cannot be rewritten within the application.

    You can adjust the language of your app according to your options when the app starts.

    App.xaml.cs

    public App()
    {
        this.InitializeComponent();
        this.Suspending += OnSuspending;
        ApplicationLanguages.PrimaryLanguageOverride = "es-MX";
    }

    For more information on localization, please see this document.

    After you create a resource file as required, when you modify PrimaryLanguage, the corresponding resource file is automatically loaded without manually retrieving the resource file.

    Best regards.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by pczurak Monday, October 28, 2019 4:44 AM
    Thursday, October 24, 2019 8:13 AM

All replies

  • Hi,

    Language is a static option for the application. Once the language is determined during application initialization, it cannot be rewritten within the application.

    You can adjust the language of your app according to your options when the app starts.

    App.xaml.cs

    public App()
    {
        this.InitializeComponent();
        this.Suspending += OnSuspending;
        ApplicationLanguages.PrimaryLanguageOverride = "es-MX";
    }

    For more information on localization, please see this document.

    After you create a resource file as required, when you modify PrimaryLanguage, the corresponding resource file is automatically loaded without manually retrieving the resource file.

    Best regards.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by pczurak Monday, October 28, 2019 4:44 AM
    Thursday, October 24, 2019 8:13 AM
  • It's not what I needed, but it pointed me in the right direction.

    Thanks


    Peter

    Monday, October 28, 2019 4:45 AM