PrettyPrintLanguage() public method

Give the string the user expects to see as the name of a specified language. This routine uses the user-specified name for the main project language. For the other two project languages, it explicitly uses the appropriate collection settings name for that language, though currently this gives the same result as the final default. This will find a fairly readable name for the languages Palaso knows about and fall back to the code itself if it can't find a name. Most names are not yet localized.
public PrettyPrintLanguage ( string code ) : string
code string
return string
Ejemplo n.º 1
0
 public void PrettyPrintLanguage_DoesNotModifyUnknownCodes()
 {
     var htmlDom = new HtmlDom();
     var settingsettings = new CollectionSettings() { Language1Iso639Code = "pdc", Language1Name = "German, Kludged" };
     var data = new BookData(htmlDom, settingsettings, null);
     Assert.That(data.PrettyPrintLanguage("xyz"), Is.EqualTo("xyz"));
 }
Ejemplo n.º 2
0
 public void PrettyPrintLanguage_AdjustsKnownLanguages()
 {
     var htmlDom = new HtmlDom();
     var settingsettings = new CollectionSettings() { Language1Iso639Code = "pdc", Language1Name = "German, Kludged", Language2Iso639Code = "de", Language3Iso639Code = "fr"};
     var data = new BookData(htmlDom, settingsettings, null);
     Assert.That(data.PrettyPrintLanguage("de"), Is.EqualTo("German"));
     Assert.That(data.PrettyPrintLanguage("fr"), Is.EqualTo("French"));
     Assert.That(data.PrettyPrintLanguage("en"), Is.EqualTo("English"));
     Assert.That(data.PrettyPrintLanguage("es"), Is.EqualTo("Spanish"));
 }