question

fangfangwu avatar image
0 Votes"
fangfangwu asked ·

Localization issues when using App Bundle in UWP

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 ?








windows-uwpwindows-uwp-runtime
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RoyLi-MSFT avatar image
0 Votes"
RoyLi-MSFT answered ·

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.






· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.