Beispiel #1
0
    public static string Get(string key, ref bool success)
    {
        if (string.IsNullOrEmpty(key))
        {
            return(key);
        }
        int length = key.IndexOf(".");

        if (length < 0)
        {
            return(key);
        }
        string tableID = key.Substring(0, length);
        string key1    = key.Substring(length + 1);

        LocalizedText.TextTable textTable = LocalizedText.FindTable(tableID);
        if (textTable == null)
        {
            textTable = LocalizedText.InternalLoadTable(tableID, (LocalizedText.TextTable)null);
            if (textTable == null)
            {
                return(key);
            }
        }
        string text = textTable.FindText(key1);

        success = !string.IsNullOrEmpty(text) && !text.Equals(key1);
        return(text);
    }
Beispiel #2
0
 public static void LoadTable(string tableID, bool forceReload = false)
 {
     LocalizedText.TextTable overwriteTable = LocalizedText.FindTable(tableID);
     if (overwriteTable == null || forceReload)
     {
         overwriteTable = LocalizedText.InternalLoadTable(tableID, overwriteTable);
     }
     overwriteTable.AutoUnload = false;
 }
Beispiel #3
0
    public static string SGGet(string language, string tableID, string textID)
    {
        if (string.IsNullOrEmpty(textID))
        {
            return(textID);
        }
        if (string.IsNullOrEmpty(tableID))
        {
            return(tableID);
        }
        string str = (LocalizedText.FindTable(tableID) ?? LocalizedText.InternalLoadTable(language, tableID, (LocalizedText.TextTable)null)).FindText(textID);

        if (string.IsNullOrEmpty(str) || str.Equals(textID))
        {
            str = tableID + (object)'.' + textID;
        }
        return(str);
    }