Search Unity

Question Locale fallback on missing translation

Discussion in 'Localization Tools' started by b4gn0, Oct 19, 2020.

  1. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    Hello,

    Is there a way to set up Localization to fallback to a default locale on missing translations only?

    Example: locale is set to "it"; get the text from a LocalizedString -> it is not set for italian -> fallback to english translation?

    This is different from the locale fallback you get by specifying multiple locale selectors in the settings.

    Thank you for this amazing package, we are in the process of adding translation support on all our scriptable objects / UI / etc. and it has been a breeze!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Fallback is planned but not implemented yet.
    We do have the ability to assign fallback locales through metadata

    upload_2020-10-19_10-25-5.png

    This info is not used at the moment but would be used in the future to do the fallback from 1 locale table to another.
     
  3. b4gn0

    b4gn0

    Joined:
    Jul 26, 2019
    Posts:
    119
    Thank you, I just set it as you suggested.

    Guess now we'll wait for the feature :)
     
    karl_jones likes this.
  4. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    I'm waiting too for this feature - as it's better to fallback to english in my oppinion than to a "No translation found for 'XXXX'".
    Maybe an option, as some wants that. In my case, I rather fallback to english :D

    Hope this feature will come soon, because this Localization package you have build here is just pure awesomeness already!
     
    karl_jones likes this.
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Fallback support will be in the next release 0.10.0, ETA end of January.
     
  6. Laumania

    Laumania

    Joined:
    Jun 27, 2012
    Posts:
    221
    Oh, that is very awesome - can't wait for that update. I will get that automatic, or at least see it, in the package manager as I added the git repository source?

    I really like this localization package - so easy to use and setup and the Google Sheet integration is brilliant!
    I have setup a Google Sheet, with some permission on each column/language, so my community helps translate the game - works really well and easy to push/pull updates.
     
    karl_jones likes this.
  7. Ciryus

    Ciryus

    Joined:
    Sep 17, 2012
    Posts:
    38
    Hello, is any update on that point? I am using Use Fallback for an Asset Data Table but with no success, it always return null (if locale not in the table or if entry empty in the problematic locale)
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    Ah we currently only have it implemented for string tables. It will be coming for asset tables in the future, hopefully the next release.
     
    Ciryus likes this.
  9. hadesfury

    hadesfury

    Joined:
    Jan 23, 2014
    Posts:
    55
    EDIT:
    Spoke too quick, I did not tick the Use Fallback options in "Project Settings > Localization"

    But I let my post here, if somebody have answers to other questions,

    Thanks anyway ;)

    EDIT2: it could be handy to have the "Translation not found" message even if the fallback is used

    EDIT3: maybe you can specify in the doc what are the option to improve the "translation not found" message to display the language.
    Here is my solution : No translation found for '{key}' in {table.TableCollectionName} for language {table.LocaleIdentifier}

     
    Last edited: Jun 3, 2021
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,282
    What do you mean? We should still be doing this if we eventually do not find a translation.

    Ah yes it looks like we only specify it in the scripting docs but having something in the manual is also a good idea.
    This is the info we have at the moment https://docs.unity3d.com/Packages/c...lizedStringDatabase_NoTranslationFoundMessage
     
  11. hadesfury

    hadesfury

    Joined:
    Jan 23, 2014
    Posts:
    55
    Thanks for you quick answer :D

    What I meant is that most of the time when you are in a fallback situation, it is because you miss some translation in your game.
    Being warned about these can be interesting if you are using an error agregator such as Unity reporting system, you want to track those missing localization.

    It is maybe a small use case and as I think of it, it is probably handled by the spreadsheet system.
     
    karl_jones likes this.