How To Dynamically Set Blog Name and Blog Description in WordPress?

I have a WordPress website, where I want to set the Site Title and Tagline differently for different countries. How can I check some conditions and then change the title and tagline each time the website loads?
For Example.

<?php
if( $country == 'usa' ){
    // Title will be "Jobs in USA"
    // Tagline Will be "Best Jobs in United States"
}
else if( $country == 'uk' ){
    // Title will be "Jobs in UK"
    // Tagline Will be "Best Jobs in United Kingdom"
}

I can change those in Settings >> General but I want to check each country then show a different title and tagline. can anyone help me to solve this problem?

Add the below code in the function.php file of your theme and should change the blog name and blog description.

add_filter( 'option_blogname', 'change_blogname_by_country' );
add_filter( 'option_blogdescription', 'change_blogdescription_by_country' );

function change_blogname_by_country( $text ){

    $country =  ...;

    if ( $country == "us" ){
        $text = "Jobs in USA";
    } 
    elseif ( $country == "uk" ) {
        $text = "Jobs in UK";
    }                 

    return $text;
}
function change_blogdescription_by_country( $text ){

    $country =  ...;

    if ( $country == "us" ) {
        $text = "Best Jobs in United States";
    } 
    elseif ( $country == "uk" ) {
        $text = "Best Jobs in United Kingdom";
    }                 

    return $text;
}

Set your $country variable before you use the code in your theme.