-
Notifications
You must be signed in to change notification settings - Fork 8
/
LocalizationManager.cs
43 lines (36 loc) · 1.25 KB
/
LocalizationManager.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Collections.Generic;
using UnityEngine;
using JotunnLib.Entities;
using JotunnLib.Utils;
namespace JotunnLib.Managers
{
/// <summary>
/// Handles all logic to do with managing the game's localizations.
/// </summary>
public class LocalizationManager : Manager
{
public static LocalizationManager Instance { get; private set; }
internal Dictionary<string, List<LocalizationConfig>> Localizations = new Dictionary<string, List<LocalizationConfig>>();
private void Awake()
{
if (Instance != null)
{
Debug.LogError("Error, two instances of singleton: " + this.GetType().Name);
return;
}
Instance = this;
}
/// <summary>
/// Registers a new translation for a word for the current language
/// </summary>
/// <param name="key">Key to translate</param>
/// <param name="text">Translation</param>
public void RegisterTranslation(string key, string text)
{
ReflectionUtils.InvokePrivate(Localization.instance, "AddWord", new object[] { key, text });
}
internal void RegisterTranslation(LocalizationConfig localization)
{
}
}
}