private static DataSet GatherDataItemsFromCollectionSettings(CollectionSettings collectionSettings)
{
var data = new DataSet();
data.WritingSystemAliases.Add("N1", collectionSettings.Language2Iso639Code);
data.WritingSystemAliases.Add("N2", collectionSettings.Language3Iso639Code);
// if (makeGeneric)
// {
// data.WritingSystemCodes.Add("V", collectionSettings.Language2Iso639Code);
// //This is not an error; we don't want to use the verncular when we're just previewing a book in a non-verncaulr collection
// data.AddGenericLanguageString("iso639Code", collectionSettings.Language1Iso639Code, true);
// //review: maybe this should be, like 'xyz"
// data.AddGenericLanguageString("nameOfLanguage", "(Your Language Name)", true);
// data.AddGenericLanguageString("nameOfNationalLanguage1", "(Region Lang)", true);
// data.AddGenericLanguageString("nameOfNationalLanguage2", "(National Lang)", true);
// data.AddGenericLanguageString("country", "Your Country", true);
// data.AddGenericLanguageString("province", "Your Province", true);
// data.AddGenericLanguageString("district", "Your District", true);
// data.AddGenericLanguageString("languageLocation", "(Language Location)", true);
// }
// else
{
data.WritingSystemAliases.Add("V", collectionSettings.Language1Iso639Code);
data.AddLanguageString("nameOfLanguage", collectionSettings.Language1Name, "*", true);
data.AddLanguageString("nameOfNationalLanguage1",
collectionSettings.GetLanguage2Name(collectionSettings.Language2Iso639Code), "*", true);
data.AddLanguageString("nameOfNationalLanguage2",
collectionSettings.GetLanguage3Name(collectionSettings.Language2Iso639Code), "*", true);
data.UpdateGenericLanguageString("iso639Code", collectionSettings.Language1Iso639Code, true);
data.UpdateGenericLanguageString("country", collectionSettings.Country, true);
data.UpdateGenericLanguageString("province", collectionSettings.Province, true);
data.UpdateGenericLanguageString("district", collectionSettings.District, true);
string location = "";
if (!String.IsNullOrEmpty(collectionSettings.District))
location += collectionSettings.District + @", ";
if (!String.IsNullOrEmpty(collectionSettings.Province))
location += collectionSettings.Province + @", ";
if (!String.IsNullOrEmpty(collectionSettings.Country))
{
location += collectionSettings.Country;
}
location = location.TrimEnd(new[] { ' ' }).TrimEnd(new[] { ',' });
data.UpdateGenericLanguageString("languageLocation", location, true);
}
return data;
}