/// <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)); } }
/// <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); }
/// <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); }
/// <summary> /// Reads all translation from files in application directory. /// </summary> public void Read() { LangReader.Read(this); }