src/BloomExe/Collection/CollectionSettings.cs
/// <summary>
/// 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, which the user also set.
/// If the user hasn't set a name for the given language, this will find a fairly readable name
/// for the languages Palaso knows about (probably the autonym) and fall back to the code itself
/// if it can't find a name.
/// BL-8174 But in case the code includes Script/Region/Variant codes, we should show them somewhere too.
/// </summary>
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, which the user also set.
If the user hasn't set a name for the given language, this will find a fairly readable name
for the languages Palaso knows about (probably the autonym) and fall back to the code itself
if it can't find a name.
BL-8174 But in case the code includes Script/Region/Variant codes, we should show them somewhere too.
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 which the user also set . If the user hasn ' t set a name for the given language this will find a fairly readable name for the languages Palaso knows about ( probably the autonym ) and fall back to the code itself if it can ' t find a name . BL - 8174 But in case the code includes Script / Region / Variant codes we should show them somewhere too .
public string GetDisplayNameForLanguage(string code, string metadataLanguageIsoCode = null)
		{
			if (metadataLanguageIsoCode == null)
				metadataLanguageIsoCode = this.Language2Iso639Code;
			if (code == this.Language1Iso639Code && !string.IsNullOrWhiteSpace(this.Language1.Name))
				return GetLanguageNameWithScriptVariants(code, this.Language1.Name, this.Language1.IsCustomName, metadataLanguageIsoCode);
			if (code == this.Language2Iso639Code)
				return GetLanguageNameWithScriptVariants(code, this.Language2.Name, this.Language2.IsCustomName, metadataLanguageIsoCode);
			if (code == this.Language3Iso639Code)
				return GetLanguageNameWithScriptVariants(code, this.Language3.Name, this.Language3.IsCustomName, metadataLanguageIsoCode);
			return this.GetLanguageName(code, metadataLanguageIsoCode);
		}
public string GetDisplayNameForLanguage ( string code , string metadataLanguageIsoCode = null ) { if ( metadataLanguageIsoCode == null ) metadataLanguageIsoCode = this . Language2Iso639Code ; if ( code == this . Language1Iso639Code && ! string . IsNullOrWhiteSpace ( this . Language1 . Name ) ) return GetLanguageNameWithScriptVariants ( code , this . Language1 . Name , this . Language1 . IsCustomName , metadataLanguageIsoCode ) ; if ( code == this . Language2Iso639Code ) return GetLanguageNameWithScriptVariants ( code , this . Language2 . Name , this . Language2 . IsCustomName , metadataLanguageIsoCode ) ; if ( code == this . Language3Iso639Code ) return GetLanguageNameWithScriptVariants ( code , this . Language3 . Name , this . Language3 . IsCustomName , metadataLanguageIsoCode ) ; return this . GetLanguageName ( code , metadataLanguageIsoCode ) ; }
Give the string the user expects to see as the name of a specified language.
Give the string the user expects to see as the name of a specified language .
code
string
metadataLanguageIsoCode
string