Exemplo n.º 1
0
        private void SetupLanguage(string fileName)
        {
            Type tp;
            var  translit = TranslateFromPO(fileName, ID_TRANSLIT);

            if (m_Translits.TryGetValue(translit, out tp))
            {
                m_CurrentTranslit = (ITranslitStrategy)Activator.CreateInstance(tp);
            }
        }
Exemplo n.º 2
0
        private string GetBaseFileName(string fileName)
        {
            m_CurrentTranslit = null;
            var baseLanguage = TranslateFromPO(fileName, ID_BASE);

            if (!string.IsNullOrEmpty(baseLanguage))
            {
                var dirName = Path.GetDirectoryName(fileName);
                if (dirName != null)
                {
                    var fname = Path.Combine(dirName, baseLanguage);
                    if (File.Exists(fname))
                    {
                        SetupLanguage(fileName);
                        return(fname);
                    }
                }
            }
            return(fileName);
        }