src/components/getLocalizedName.js
function getName(wofData) {

  // if this is a US county, use the qs:a2_alt for county
  // eg - wof:name = 'Lancaster' and qs:a2_alt = 'Lancaster County', use latter
  if (isUsCounty(wofData)) {
    return getPropertyValue(wofData, 'qs:a2_alt');
  }

  // attempt to use the following in order of priority and fallback to wof:name if all else fails
  return getLocalizedName(wofData, 'wof:lang_x_spoken') ||
         getLocalizedName(wofData, 'wof:lang_x_official') ||
         getLocalizedName(wofData, 'wof:lang') ||
         getPropertyValue(wofData, 'wof:label') ||
         getPropertyValue(wofData, 'wof:name');
}
function getName(wofData) {

  // if this is a US county, use the qs:a2_alt for county
  // eg - wof:name = 'Lancaster' and qs:a2_alt = 'Lancaster County', use latter
  if (isUsCounty(wofData)) {
    return getPropertyValue(wofData, 'qs:a2_alt');
  }

  // attempt to use the following in order of priority and fallback to wof:name if all else fails
  return getLocalizedName(wofData, 'wof:lang_x_spoken') ||
         getLocalizedName(wofData, 'wof:lang_x_official') ||
         getLocalizedName(wofData, 'wof:lang') ||
         getPropertyValue(wofData, 'wof:label') ||
         getPropertyValue(wofData, 'wof:name');
}
function getName ( wofData ) { // if this is a US county, use the qs:a2_alt for county // eg - wof:name = 'Lancaster' and qs:a2_alt = 'Lancaster County', use latter if ( isUsCounty ( wofData ) ) { return getPropertyValue ( wofData , 'qs:a2_alt' ) ; } // attempt to use the following in order of priority and fallback to wof:name if all else fails return getLocalizedName ( wofData , 'wof:lang_x_spoken' ) || getLocalizedName ( wofData , 'wof:lang_x_official' ) || getLocalizedName ( wofData , 'wof:lang' ) || getPropertyValue ( wofData , 'wof:label' ) || getPropertyValue ( wofData , 'wof:name' ) ; }
Return the localized name or default name for the given record

@param {object} wofData
@returns {false|string}
Return the localized name or default name for the given record