FORCEINLINE bool operator()( const FCulturePtr A, const FCulturePtr B ) const { check( A.IsValid() ); check( B.IsValid() ); // Non-Specific Region should appear before all else. if(A->GetNativeRegion().IsEmpty()) { return true; } // Non-Specific Region should appear before all else. if(B->GetNativeRegion().IsEmpty()) { return false; } // Compare native region strings. return( GetCultureNativeRegionText( A ).CompareToCaseIgnored( GetCultureNativeRegionText( B ) ) ) < 0; }
static FText GetCultureNativeRegionText( const FCulturePtr Culture ) { check( Culture.IsValid() ); FString Region = Culture->GetNativeRegion(); if ( Region.IsEmpty() ) { // Fallback to displaying the language, if no region is available return LOCTEXT("NoSpecificRegionOption", "Non-Specific Region"); } return FText::FromString(Region); }