//Return a single LocalizedField, that holds the values of multiple fields that have the same name public LocalizedCSVField GetLocalizedField(string key) { //Construct the new field LocalizedCSVField field = new LocalizedCSVField(); //Fill it in with values from every supported language foreach (string locale in LocalizationManager.supportedLanguages) { if (data.ContainsKey(key + locale)) { //French has weird punctuation rules! Let's enforce them here, shall we? if (locale == "Fr") { //Replaces spaces by non-breaking spaces before punctuation markers field.AddText(locale, data[key + locale].asString() .Replace(" ?", " ?") .Replace(" !", " !") .Replace(" :", " :") ); } else { field.AddText(locale, data[key + locale].asString()); } } } return(field); }
//Copy constructor public LocalizedCSVField(LocalizedCSVField original) { this.fieldData = new Dictionary <string, string>(original.fieldData); }