• Resolved yuccaa

    (@yuccaa)


    Hi,

    I am trying to change the display names of languages on switcher.
    I edited array in bogo/includes/functions.php, however it only changed title and didn’t change the display name. (even though I think it worked before.)

    <li class="en-US en first"><a rel="alternate" hreflang="en-US" href="https://xxxxxx" title="En">English (United States)</a></li>

    Please give me advice how to change the display name.

    Thank you.

    https://www.ads-software.com/plugins/bogo/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi, can you share how you solved it?

    I’ve had to do that several times before, and i solved it with bogo_language_switcher_links hook, and adding the following in functions.php:

    add_filter('bogo_language_switcher_links', 'change_lang_link_names', 10, 2);
    function change_lang_link_names($links, $args) {
    	foreach($links as $index => $link) {
    		switch($link['locale']) {
    			case 'en_CA':
    				$link['native_name'] = __( 'English', 'bogo' );
    				break;
    			case 'fr_CA':
    				$link['native_name'] = __( 'Fran?ais', 'bogo' );
    				break;
    		}
    		$links[$index] = $link;
    	}
    	return $links;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change switcher's names of languages’ is closed to new replies.