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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Question How to properly identify different languages in a text chat Unity app?

Discussion in 'UGUI & TextMesh Pro' started by dmarqs, Feb 27, 2023.

  1. dmarqs

    dmarqs

    Joined:
    Oct 16, 2013
    Posts:
    38
    Hello,

    I'm developing a text chat and we need to give support for multiple languages, like Japanese, simplified and traditional Chinese, English, etc.

    For example, if I wrote in English and someone else wrote in Simplified Chinese and another in Japanese, I should be able to see all 3 languages with their respective correct fonts.

    I already have the fonts, I can change to the right font in the TextMesh editor. My question is: How can I properly identify the text language? (So I can use the right font)

    The solution that I can see is to send the language used with every text message, but I would like to know with you guys if we have another possible solution to dynamically identify the language.

    Thanks in advance.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,393
    The solution of sending the language is the safest. Trying to dynamically identify the language from the text will be difficult. You dont need to send it with every message though, have it part of the information you store on each user or have it as something that can be queried by your system.
     
  3. SF_FrankvHoof

    SF_FrankvHoof

    Joined:
    Apr 1, 2022
    Posts:
    780