Ejemplo n.º 1
0
        private static TextObject Translate(string id, bool isFullId = false)
        {
            TextObject translatedText;

            if (!isFullId)
            {
                var fullId = Main.ModId + "_" + id;
                var text   = LocalizedTextManager.GetTranslatedText(BannerlordConfig.Language, fullId);
                if (!"VARTS".Equals(Main.GetGuildName()) && text.Contains("VARTS"))
                {
                    text = text.Replace("VARTS", Main.GetGuildName());
                }

                translatedText = new TextObject(text);
                translatedText.AddIDToValue(fullId);
            }
            else
            {
                var text = LocalizedTextManager.GetTranslatedText(BannerlordConfig.Language, id);
                if (!"VARTS".Equals(Main.GetGuildName()) && text.Contains("VARTS"))
                {
                    text = text.Replace("VARTS", Main.GetGuildName());
                }

                translatedText = new TextObject(text);
                translatedText.AddIDToValue(id);
            }

            return(translatedText);
        }