Exemplo n.º 1
0
 /// <summary>
 /// Appends LocaModel to loca text list (for editing)
 /// </summary>
 /// <param name="lm">The LocaModel to be added</param>
 private void InsertLocaIntoFile(LocaModel lm)
 {
     locaTextLines[lm.Index]     = MainVM.Settings.Term + lm.Term;
     locaTextLines[lm.Index + 2] = MainVM.Settings.Desc + lm.Description;
     locaTextLines[lm.Index + 4] = MainVM.Settings.Lan + lm.English;
     locaTextLines[lm.Index + 5] = MainVM.Settings.Lan + lm.French;
     locaTextLines[lm.Index + 6] = MainVM.Settings.Lan + lm.Chinese;
     locaTextLines[lm.Index + 7] = MainVM.Settings.Lan + lm.Portuguese;
     locaTextLines[lm.Index + 8] = MainVM.Settings.Lan + lm.Russian;
     locaTextLines[lm.Index + 9] = MainVM.Settings.Lan + lm.Spanish;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Takes line id and fills + returns a LocaModel
        /// </summary>
        /// <param name="startId">Id where loca starts</param>
        /// <returns></returns>
        private LocaModel ConvertTextToLoca(int startId)
        {
            LocaModel lm = new LocaModel();

            lm.Index       = startId;
            lm.Term        = Decode(locaTextLines[startId].Substring(MainVM.Settings.Term.Length));
            lm.Description = Decode(locaTextLines[startId + 2].Substring(MainVM.Settings.Desc.Length));
            lm.English     = Decode(locaTextLines[startId + 4].Substring(MainVM.Settings.Lan.Length));
            lm.French      = Decode(locaTextLines[startId + 5].Substring(MainVM.Settings.Lan.Length));
            lm.Chinese     = Decode(locaTextLines[startId + 6].Substring(MainVM.Settings.Lan.Length));
            lm.Portuguese  = Decode(locaTextLines[startId + 7].Substring(MainVM.Settings.Lan.Length));
            lm.Russian     = Decode(locaTextLines[startId + 8].Substring(MainVM.Settings.Lan.Length));
            lm.Spanish     = Decode(locaTextLines[startId + 9].Substring(MainVM.Settings.Lan.Length));
            return(lm);
        }
Exemplo n.º 3
0
 /// <summary>
 /// returns Formatted version of given LocaModel
 /// </summary>
 /// <param name="lm">LocaModel</param>
 /// <returns></returns>
 private string TransformLocaModelToString(LocaModel lm)
 {
     return("\n" + lm.Format(MainVM.Settings.LocaFormat));
 }