Search Unity

Unity generated UWP (IL2CPP) project defaults to en-US language

Discussion in 'Windows' started by PeachyPixels, Jun 10, 2021.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi Everyone,

    I've noticed that after building for Windows UWP (IL2CPP) in Unity (and before associating the app with the store) the resulting vcxproj file has the following language defined...

    <DefaultLanguage>en-US</DefaultLanguage>

    But my OS language is en-GB as are all my settings.

    Currently it means changing it during the local build process, not a big issue but one extra thing to-do. Forgetting to change it will fail the store submission process as the store language is en-GB as well.

    Currently the games only supports en-GB, so at present has no locale support configured\defined.

    So I'm wondering where this is picked up from and is it possible change in a setting somewhere please?
     
    Last edited: Jun 10, 2021
  2. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Hey, thanks for posting this issue.

    Unfortunately, the <DefaultLanguage>en-US</DefaultLanguage> is hard coded into UWP's Visual Studio project generation. As you said, instead it should default to the OS's current locale or maybe expose a setting. Perhaps we can add a setting allowing you to provide a .vcxproj file as the "template" instead of using our own hard-coded one.

    Could you please file a bug for feature request for this issue? Adding yet another UWP setting might not be the right fix but using the current locale when generating the VS project is a possibility.

    Also, just to make sure you're aware, Unity won't "overwrite" the VS project settings nor the .appxmanifest file if you build the Unity project to an existing UWP output folder. The vcxproj and appxmanifest files are only created for the first UWP build and then simply updated if you build to the same folder. This mean, if you change the locale within VS and continue to build to the same output folder, the modified setting will remain.

    This might not help, especially if you're using a build system that always generates a clean UWP package.
     
    PeachyPixels likes this.
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi @timke,

    Thanks for the quick reply.

    I'm not sure using the system locale would be a good solution. I can see plenty of scenarios where default store submissions would be in a non system locale languages. I suspect this would be particularly relevant to English (in its various flavours) and French & Spanish.

    I like the vcxproj template\merge idea, but as always it will require a little more dev knowledge (particularly of the project settings). I feel a project setting would be more suitable for a wider audience here. Whatever approach would obviously have to work with local & cloud builds as well.

    A post-build script will likely be a possibility, but again a more technical approach.

    That's my just 2c worth anyway :)

    Talking of cloud builds, with UCB Windows UWP cloud builds in beta and on the horizon, how does that handle this situation? At no point will this setting be editable, I'm assuming? So does this mean these builds will be hard coded to en-US? If so, that is going to be a show stopper for most.
     
  4. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    Thank you for your detailed feedback!
    This is all good info that we'll take into consideration, but please do file a feature request or something so we a ticket tracking this.

    Even with cloud builds the "en-us" still couldn't be changed (in Unity builds) right now. This is because the XML for the .vcxproj "template" is a literal C# string. Most of this XML is all boilerplate and the configurable stuff is already exposed through build system or other options, except for <DefaultLanguage/>.

    So exposing a new UWP setting for this may just be the best option. Although loading the .vcxproj template strings from a file may still be a good option, allowing advanced to modify the template.
     
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Hi @timke

    Thanks for the reply.

    You're welcome, logged as case 1342532

    That sounds like you're saying UWP cloud builds will be fully locked to en-US?

    If so, that means builds for non US users will be relatively useless.

    Until this is addressed in a future update, do you know of a way of amending this value with a pre\post build script please?
     
  6. timke

    timke

    Joined:
    Nov 30, 2017
    Posts:
    408
    I don't know how Unity Cloud builds will work with UWP, but if the cloud does build and packages the UWP app, then you're correct: this is a problem.

    We'll need to follow up with the Services team to understand how exactly cloud builds work for specific platforms.

    The only work around I can think of (as a post-build step) is to open the generated .vcxproj file, replace <DefaultLanguage/> with your own language value, and save the file back out.
     
    PeachyPixels likes this.
  7. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713
    Thanks @timke

    I should have access to the UCB->UWP build process soon, so will try it out and report back.

    The output will likely be msixupload or appxupload (or a bundle) so I'm not sure editing the vxcproj file is an option (unless their are tools out there to-do that)
     
  8. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    713