You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PhishingAwarenessSimulation/Assets/Scripts/LanguageDatabase.cs

16 lines
433 B
C#

using UnityEngine;
using System.Collections.Generic;
[CreateAssetMenu(menuName = "Localization/LanguageDatabase")]
public class LanguageDatabase : ScriptableObject
{
public List<LocalizedText> texts;
public string GetText(string key, string language)
{
var entry = texts.Find(t => t.key == key);
if (entry == null) return key;
return language == "Arabic" ? entry.arabic : entry.english;
}
}