Search Unity

Question No suitable formatter could be found

Discussion in 'Localization Tools' started by Nickericer, Jun 9, 2022.

  1. Nickericer

    Nickericer

    Joined:
    Feb 3, 2022
    Posts:
    4
    Hi there!
    I am using Localization 1.3.2 (faced the same problem on 1.3.1 and 1.4.0exp1) and Unity 2020.3.17f1.
    I have a smart string on a TextMeshPro, where the variable is linked to a component of another gameobject:
    Your current VIP status will expire after {tooltip.expirationTime:time(short)}. Make a purchase to renew it.

    The parsing works fine in English, but throws an error on all the rest of the languages, even with exactly the same string.
    Any ideas on what I may be doing wrong?

    Thank you. Screenshot 2022-06-09 093224.png Screenshot 2022-06-09 093246.png
     
  2. Nickericer

    Nickericer

    Joined:
    Feb 3, 2022
    Posts:
    4
    Hey so I just saw that, and I understand that, what I am trying to fails because time values cannot be translated. So my question is, what use is this tool for? upload_2022-6-9_9-49-47.png
     
  3. Nickericer

    Nickericer

    Joined:
    Feb 3, 2022
    Posts:
    4
    So, the way I understand this, I'll have to write a custom formatter for localizing the time in other languages.
    Searching around, I stumbled upon
    TimeSpanUtility.cs
    where at the end of the file, I saw this upload_2022-6-9_10-22-13.png
    I guess all one has to do is expand that switch statement and include more properties that return TimeTextInfo in a proper way for the language they want to include.

    But then again, it is too risky writing code there, cause with the next update of the plugin it will be overwritten.
    So what is the suggested approach?
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
  5. Nickericer

    Nickericer

    Joined:
    Feb 3, 2022
    Posts:
    4
    Hey Karl, thanks for your reply!
    Ended up dumping this Formatter and translating time manually for each occurrence of a time value.
    It seems that at its current state the TimeFormatter is of no good use.
    I hope you guys get to upgrade that feature in the future.
    Cheers :)
     
    karl_jones likes this.
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    Ah sorry to hear that. How would you expect it to work ideally? Any feedback would be great.
     
  7. Morphus74

    Morphus74

    Joined:
    Jun 12, 2018
    Posts:
    174
    Hi, just found out the same way that Time format do nothing.

    To answer @karl_jones question. I would like that if I change language, it behave like in english but for all languages.

    So in french instead of 2 hours, you get 2 heures.
    And so on for each languages, and I assume language that are right to left like arabic have their own way to present it
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,279
    We probably wouldn't be able to do that as it would require having the translations for all languages built-in. We could maybe do some core languages. Ideally we would want to be able to connect the values to string table entries so translations can be provided for any language.
    I'll add a task to look into this in the future.