Localization issues when using App Bundle in UWP

fangfang wu 91 Reputation points Microsoft Employee
2019-10-30T06:16:16.72+00:00

I’m having issues with Localization in my UWP applications.
I can reproduce this issue using Microsoft Localization sample. The following is what I have done to reproduce this issue:

Step1:

I open the project in Visual Studio.

I test it in Debug or Release. I can change the languages correctly.

I select English and click Apply and the application changes the language to English.

I select Chinese and click Apply and the application changes the language to Chinese.

Everything works correctly.

Step 2:

I create the App Package with Generate App Bundle Never.

I install it to test it running the Add-AppDevPackage.ps1

I select English and click Apply and the application changes the language to English.

I select Chinese and click Apply and the application changes the language to Chinese.

Everything works correctly.

Step 3:

I create the App Package with Generate App Bundle Always.

I install it to test it running the Add-AppDevPackage.ps1

I select the Languages and click Apply and the application does not change the languages.

The application always runs in English and does not change the languages.

It does not work at all.

So based on the test result, this issue only happens when generating App Bundle as Always and works fine when setting the App Bundle as Never.

Can you confirm that this is the excepted behavior ?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Roy Li - MSFT 33,371 Reputation points Microsoft Vendor
    2019-10-30T07:43:11.247+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    So based on the test result, this issue only happens when generating App Bundle as Always and works fine when setting the App Bundle as Never. Can you confirm that this is the excepted behavior?

    Yes, this is excepted behavior.

    The reason for that is because that if we have set the "Generate App bundle" as "always" or "if needed", it will create the App Bundle. When using the App Bundle it will cut your application into different parts to optimize the download and installation process. Only the language resources that match the current language and culture of the device will be installed. Therefore, if your device is configured for en-US, only the en-US language resources are installed with your app. So if you try to change the language that you do not have the corresponding Windows-Language-Pack installed on your device, it will fall back to the same base language and the app will do not show the related language for that property which are pointing to the resources file.

    As you have tested setting App Bundle as Never will work fine, but if you still want to use the Appx Bundle and keep all the language resources in the package as well, please create a configuration file for the app package that specifies that certain resources are required during installation (including language resources). This optimized installation feature is automatically enabled when your application's .appxbundle is generated during packaging.

    For more information, please refer to the "Deployment Considerations" section this artilce: Make your app localizable.

    Thanks.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.