Ejemplo n.º 1
0
        /// <summary>
        /// Try to match a passed CultureInfo to the ones existing inside the dictionary
        /// </summary>
        /// <returns>Translations in dictionary or default translations</returns>
        private Texts SelectCultureInfo(CultureInfo info)
        {
            Texts result = null;

            if (info == null)
            {
                return(defaultLocale);
            }

            if (AllTexts.TryGetValue(info, out result))
            {// works if language codes match exactly
                return(result);
            }

            string lang2letters = info.TwoLetterISOLanguageName;

            foreach (CultureInfo key in AllTexts.Keys)
            {// retrieves e.g. "en" if passed "en-US"
                if (lang2letters.Equals(key.Name))
                {
                    return(AllTexts[key]);
                }
            }

            foreach (CultureInfo key in AllTexts.Keys)
            {// retrieves e.g. "de-DE" if passed "de-AT"
                if (lang2letters.Equals(key.TwoLetterISOLanguageName))
                {
                    return(AllTexts[key]);
                }
            }

            return(defaultLocale);
        }
 // Use this for initialization
 void Start()
 {
     allTexts = text.GetComponent <AllTexts>();
     zaehlerh = 0;
     zaehlerg = 0;
     PlayerPrefs.SetString("aktuelleSzene", SceneManager.GetActiveScene().name);
 }
Ejemplo n.º 3
0
    //public GameObject gretelINT;



    //public GameObject haenselTextINT;

    //public GameObject gretelTextINT;


    // Use this for initialization
    void Start()
    {
        anim = GetComponent <Animator>();

        //targetWayPoint = wayPoint [currentWayPoint];

        allTexts = text.GetComponent <AllTexts>();
    }
        public TextService(Language language)
        {
            var dictionaries = new Dictionary <TextCategories, TextsBase>
            {
                { TextCategories.ActionsInfoTexts, new ActionsInfoTexts(language) },
                { TextCategories.GenericButtonTexts, new GenericButtonTexts(language) },
                { TextCategories.MenuTexts, new MenuTexts(language) },
                { TextCategories.MiscellaneousTexts, new MiscellaneousTexts(language) },
                { TextCategories.MechanicsInfoTexts, new MechanicsInfoTexts(language) },
                { TextCategories.MenuInfoTexts, new MenuInfoTexts(language) },
                { TextCategories.StatInfoTexts, new StatInfoTexts(language) },
                { TextCategories.StatNameTexts, new StatNameTexts(language) }
            };

            _allTexts = new AllTexts(dictionaries);
        }
Ejemplo n.º 5
0
        public void AddText(Texts ent)
        {
            var exists = from t in nlDB.Texts
                         where t.TextId == ent.TextId
                         select t;

            if (exists.Count() == 0)
            {
                nlDB.Texts.InsertOnSubmit(ent);
                AllTexts.Add(ent);
            }
            else
            {
                Texts t = exists.FirstOrDefault();
                t.Title   = ent.Title;
                t.Content = ent.Content;
            }
            nlDB.SubmitChanges();
        }
 // Use this for initialization
 void Start()
 {
     allTexts = text.GetComponent <AllTexts>();
     PlayerPrefs.SetString("aktuelleSzene", SceneManager.GetActiveScene().name);
     // Debug.Log(PlayerPrefs.GetInt("zaehler"));
 }
Ejemplo n.º 7
0
 // Use this for initialization
 void Start()
 {
     allTexts = text.GetComponent <AllTexts>();
     PlayerPrefs.SetString("aktuelleSzene", SceneManager.GetActiveScene().name);
     // PlayerPrefs.SetString("zusatz", PlayerPrefs.GetString("Frame4"));
 }
Ejemplo n.º 8
0
 public void DeleteText(Texts ent)
 {
     AllTexts.Remove(ent);
     nlDB.Texts.DeleteOnSubmit(ent);
     nlDB.SubmitChanges();
 }