Fix the resx parser to pull in both translated and untranslated strings

The value was being set as the untranslated string.

Also, we need to get rid of the '\r' character
This commit is contained in:
Stephen Shaw 2012-09-25 12:20:57 -06:00
Родитель 3935c0bf94
Коммит e516b6ac25
1 изменённых файлов: 12 добавлений и 2 удалений

Просмотреть файл

@ -64,11 +64,21 @@ namespace Vernacular.Parsers
foreach (DictionaryEntry item in reader) {
var name = (string)item.Key;
var node = (ResXDataNode)item.Value;
yield return new LocalizedString {
var localized_string = new LocalizedString {
Name = name,
DeveloperComments = node.Comment,
UntranslatedSingularValue = (string)node.GetValue(null as ITypeResolutionService)
UntranslatedSingularValue = name,
TranslatedValues = new string [] {(string)node.GetValue(null as ITypeResolutionService) }
};
for (int i = 0; i < localized_string.TranslatedValues.Length; i++)
{
var s = localized_string.TranslatedValues [i];
s = s.Replace ("\r", "");
localized_string.TranslatedValues[i] = s;
}
yield return localized_string;
}
}