public LocalizationModel Load(Stream stream)
        {
            var model = new LocalizationModel
            {
                Localizations = new Dictionary <string, Dictionary <string, string> >()
            };

            var reader  = new CSVReader(stream);
            var headers = new string[0];
            var row     = 0;

            while (reader.Peek() >= 0)
            {
                var rowValues = reader.ReadRow();

                if (row == 0)
                {
                    headers = rowValues;
                    SetHeaders(model.Localizations, headers);
                }
                else
                {
                    AddKeys(model.Localizations, headers, rowValues);
                }

                row++;
            }

            return(model);
        }
Example #2
0
 public void SetModel(LocalizationModel model)
 {
     _model = model;
     SetLocale(_model.Default);
 }