Beispiel #1
0
    static public string getContent(string id, IsoLanguages filterLang, bool warning = true)
    {
        if (manager == null)
        {
            manager = create();
        }

        LocalizationFile file = manager.getFileByLang(filterLang.ToString());

        Debug.Assert(file != null, "no file found for language : " + filterLang);

        return(file.getContentById(id, warning));
    }
Beispiel #2
0
    static public string getContent(string id, bool warning = false)
    {
        if (manager == null)
        {
            manager = create();
        }

        IsoLanguages lang = getSavedIsoLanguage();

        LocalizationFile file = manager.getFileByLang(lang.ToString());

        Debug.Assert(file != null, "no file found for language : " + lang);

        return(file.getContentById(id, warning));
    }
Beispiel #3
0
    /// <summary>
    /// A apl quand on change la lang
    /// </summary>
    static public void applyLanguage(IsoLanguages newLang)
    {
        Debug.Log("<color=cyan>applyLanguage</color> to <b>" + newLang + "</b>!");

        IsoLanguages iso = getSavedIsoLanguage();

        if (!Application.isPlaying)
        {
            reacts.Clear();
            reacts.AddRange(HalperInterfaces.getCandidates <iLanguageChangeReact>());
        }

        Debug.Log("applying new lang (" + iso + ") to x" + reacts.Count + " reacts");

        for (int i = 0; i < reacts.Count; i++)
        {
            reacts[i].onLanguageChange(iso.ToString());
        }
    }
Beispiel #4
0
 public LocalizationFile(IsoLanguages lang)
 {
     Init(lang.ToString());
 }
Beispiel #5
0
 static public string isoToLabel(IsoLanguages lang)
 {
     return(getContent("menu_" + lang.ToString()));
 }