コード例 #1
0
        /// <summary>
        /// Calculate translaction directory.
        /// </summary>
        /// <param name="exeFileName">Name of exe file name.</param>
        /// <returns></returns>
        public static string GetTranslationDirectory(string exeFileName)
        {
            try
            {
                var parentFolder = Path.GetDirectoryName(exeFileName);
                if (parentFolder != null)
                {
                    foreach (string fileName in LangReader.GetFiles(parentFolder, "*.lang"))
                    {
                        return(Path.GetDirectoryName(fileName));
                    }
                }

                return(Path.GetDirectoryName(exeFileName));
            }
            catch
            {
                return(Path.GetDirectoryName(exeFileName));
            }
        }
コード例 #2
0
 /// <summary>
 /// Reads all translation from files in specified directory.
 /// </summary>
 /// <param name="directoryName">Name of the directory.</param>
 public void Read(string directoryName)
 {
     LangReader.Read(directoryName, this);
 }
コード例 #3
0
 /// <summary>
 /// Reads the specified language from lines.
 /// </summary>
 /// <param name="language">The language.</param>
 /// <param name="lines">The lines.</param>
 public void Read(string language, string[] lines)
 {
     LangReader.Read(language, lines, this);
 }
コード例 #4
0
 /// <summary>
 /// Reads all translation from files in application directory.
 /// </summary>
 public void Read()
 {
     LangReader.Read(this);
 }