Exemple #1
0
    public string GetText(string id, string lang, bool log = true)
    {
        GEText text = GetTextElement(id);

        if (text == null || text.IsEmpty())
        {
            if (log)
            {
                ObjectManager.Logger.LogWarn("There is no GEText with the given id! " + id);
                //throw new Exception(String.Format("There is no text with the given id! id: {0}", id));
            }
            return(null);
        }
        return(text.GetText(lang, log));
    }
Exemple #2
0
    public GEText AddText(string id, string txt, string lang)
    {
        GEText text = GetTextElement(id, false);

        if (text == null || text.IsEmpty())
        {
            text = new GEText(id, defLang, lang, txt);
            AddTextElement(text);
        }
        else
        {
            text.AddText(lang, txt);
        }
        if (!AvailableLangs.Contains(lang))
        {
            AvailableLangs.Add(lang);
        }
        return(text);
    }