Search Unity

Suggestion: Treat Platform as Localization layer

Discussion in 'Localization Tools' started by nrvllrgrs, Jul 20, 2020.

  1. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    62
    Consider adding platform as a localization layer. For example, there is often a "(X) to Interact" prompt at the button of the screen. But (X) only makes sense for a Xbox Gamepad. If the system detects a mouse and keyboard, then the platform locale would change to Keyboard and change the prompt to "Left Mouse to Interact". And of course, all of these prompts could be further altered using a TextMesh sprite icon.

    So in effect there would be 2 locales. One is the language; the other is platform.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,300
    Hmm. I think this is something you would do through the input system. I believe the new input system can detect the correct device for the platform and give you it's name, this would then be fed into a smart string.
     
  3. nrvllrgrs

    nrvllrgrs

    Joined:
    Jan 12, 2010
    Posts:
    62
    When I writing the initial post I was certainly thinking along those lines as well. I was think that it would also be used in tandem with the Addressables system to pull the appropriate icon.

    I would like to have one string: "<sprite name="Fire"> to Interact". As stated before, "Fire" for the Xbox gamepad would be the X button, on the Playstation gamepad it would be the Square button, and on the Keyboard/Mouse it would be the left mouse button. Would swapping the Sprite Asset on the TextMesh component based on the detected platform be the best solution? Or adding a localization layer? Or something else entirely?

    I suggest this because I have used other game engines that had such a feature and it worked reasonably well.