Search Unity

Question Shared metadata for whole table/locale?

Discussion in 'Localization Tools' started by c-Row, Jan 24, 2024.

  1. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    853
    Is it possible to set a standard value for a metadata property to ensure all entries have some default value for a specific property?

    I have implemented a gender option in one of my localization tables as demonstrated in the example included in the Localization package, and things work as expected when the Item Gender property is added to an entry. However, if the metadata property is not added at all the string is not parsed properly anymore as it cannot resolve the gender value (which makes sense as it has not been set).

    So far I have only found the option to set metadata over all locales for a single key, but there seems to be no way to have a default or fallback value set if no information was maintained in the first place.

    To be clear - I am not looking for a default value of my metadata property but a way to apply a metadata property to a whole table so the selector does not throw an error when the property has not been added to a specific key. :)
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,276
    Hi,

    A smart string is currently only able to access the metadata for the entry, it does not have access to the shared metadata for the table or locale. Ill add a task for us to look into adding this support in the future.
    For now the only thing I can think of would be to write a script that goes through the table and adds the default metadata if its missing. Most should be possible through the LocalizationEditorSettings.
     
    c-Row likes this.
  3. c-Row

    c-Row

    Joined:
    Nov 10, 2009
    Posts:
    853
    Thanks karl, that will make for a good temporary solution. Hope to see this implemented at some point. :)
     
    karl_jones likes this.