Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Localisation - Unable to change locale name

Discussion in 'Localization Tools' started by ainara4holition, Nov 21, 2020.

  1. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    Hello :)

    I am using the localisation package (Version 0.8.1-preview) and I am pretty happy with it, thank you, very useful.

    I have a couple of issues and would like to ask for your help, please.

    I have created a dropdown menu following this example (point 4) https://docs.unity3d.com/Packages/com.unity.localization@0.4/manual/index.html

    In my app I would like to change the name of the language. For example I have locale "Spanish (es)" and I would like to display just "Spanish". I got this working on my Game window by changing the name tag in the locale inspector - see image attached. I managed to do this for some of my languages, however I cant really understand how I managed to get this working, as, trying for another language, every time I save or build, it goes back to have the language code in parentheses after the name.

    Another issue I have is that, even though I managed to change the name, built locally, addressables built, when I push to my CI (Unity Cloud Build), the app generated has the original - not changed names (Spanish (es)) - see image.

    What if I would like to change the display name to something different like Español or Castellano.

    Could you advise on this? Many many thanks!

    Ainara
     

    Attached Files:

  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Hey,
    How are you displaying the name?
    If you are doing locale.ToString() it will return the value with the code (Spanish(es) etc) if you do locale.name then it will return the value set for the asset(the name field).
    You can also get to the language name through the LocaleIdentifier.CultureInfo field.

    Those docs are very old, this is the latest https://docs.unity3d.com/Packages/com.unity.localization@0.9/manual/index.html
    Notice the version number after the @
    Also in 0.9.0 we have some Samples which create locale selection menus although they do also show it with the code. You can modify them to just show the name.
     
  3. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    Hi Karl,

    Thanks for your quick response with all the info:)

    I am using locale.name , I am using the code in the example "Make a basic Locale selection menu"
    from here https://docs.unity3d.com/Packages/com.unity.localization@0.9/manual/Scripting.html (this is the same as previous link of older version)

    I have updated now to version 0.9. I managed to change the name field in the inspector but I dont know how (before I was doing the same but when building or clicking save it was automatically going back to previous full name with (es)).

    I have this solved locally now, but I have the same problem on the link generated by the cloud build. On the dropdown menu on the downloaded and installed app I see the languages with the full name - English (es). On the cloud build I have the Build Addressables option enabled - see image.

    Any idea what could be causing this?

    As always, many thanks in advance.

    Ainara
     

    Attached Files:

  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Are you setting the name value by script?
    You need to mark the asset dirty or the change won't be saved.
    EditorUtility.SetDirty(locale)
     
  5. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    Not by script. I am setting the name value by editing it directly on the inspector.
     

    Attached Files:

  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    And the value is not saved when you build? That sounds like a bug. Could you please file a bug report?
     
  7. ainara4holition

    ainara4holition

    Joined:
    Aug 7, 2020
    Posts:
    18
    Sometimes it does save, sometimes it doesn't.
    Sure, will fill a bug report.

    At the moment, the names have been modified and saved on my 4 locales. However I am still having the problem on the unity cloud build generated app, it shows complete name instead of edited one
     
    karl_jones likes this.
  8. Snotax

    Snotax

    Joined:
    Jan 28, 2019
    Posts:
    14
    I have the same problem I think. I can't save the name of the created locales. It just won't save them.
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,846
    Could you please file a bug report?
     
  10. Snotax

    Snotax

    Joined:
    Jan 28, 2019
    Posts:
    14
    @karl_jones I did, thank you :D

    If you don't hit CTRL + S to save it, it works for the next game run but resets it when you save the project. Very strange.

    Thank you and good bug hunting :D