Search Unity

Question Localization definement not working properly

Discussion in 'Localization Tools' started by bluesixteen, Jun 3, 2022.

  1. bluesixteen

    bluesixteen

    Joined:
    Nov 17, 2016
    Posts:
    28
    Hi, so lately I've been trying to define Unity Localization usage, but #if ENABLE_LOCALIZATION always returns true, even if the package is not imported in the project. I've tried all LTS releases (2019.4, 2020.3 and 2021.3) but the issue persists. Am I doing something wrong or is this a bug?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    We don't have any defines like that. Are you using version defines against the localization asmdef?
     
  3. bluesixteen

    bluesixteen

    Joined:
    Nov 17, 2016
    Posts:
    28
    Oh shoot, thought it was related to Unity Localization (similar to Input System). Thanks a lot for your answer, I'll find another workaround!
     
    karl_jones likes this.
  4. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    I have the same issue, it would make things simple if this define was working, it is visible in both Assembly-CSharp.csproj and Assembly-CSharp-editor.csproj:

    upload_2022-6-13_10-44-33.png
     
  5. dlorre

    dlorre

    Joined:
    Apr 12, 2020
    Posts:
    699
    So, I created an asmdef in my package script folder, and after some trial and errors I did this:

    upload_2022-6-13_11-41-21.png

    And it seems to work. The version defines trick is explained here.
     
    karl_jones likes this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    That define has nothing to do with the localization package, it's for editor localization. Localizing the editor into different languages etc.