Hello. I’m relatively new to Unity and C#. I was hoping for advice on the subject of managing natural languages. I’d like for the user to have a drop-down menu in preferences to select between say, English and Spanish.
My instinct is to have separate files for each language. I’d have a default class called Language:
public class Language : MonoBehaviour {
public string text_greeting = “Hello world”;
}
and then other languages would inherit from it
public class Spanish : Language {
public string text_greeting = “Hola mundo”;
}
and then in my scene instantiate a Language and print chosenLanguage.text_greeting
Now there MUST be a more elegant way to do this. Or maybe even a built-in way that I’ve overlooked? I’m simply storing variables; is MonoBehaviour overkill? I appreciate your input, o wise Unity community!