Exemplo n.º 1
0
        public IEnumerable <Translation> Load(string path)
        {
            string fileContent = _fileLoader.GetContent(path);

            int interator = 0;

            while (interator < fileContent.Length)
            {
                char starter = fileContent[interator];
                if (starter != _separator)
                {
                    interator++;
                    continue;
                }

                int    lenght         = GetIndexOfEndSeparator(fileContent, interator) - interator;
                string translationRow = fileContent.Substring(interator + 1, lenght - 1); // eliminate separators

                yield return(_translationFactory.CreateTranslation(translationRow));

                interator += lenght + 1; // to next char
            }
        }