• Resolved scriptgeni

    (@scriptgeni)


    Hi,

    I have added locale=”nl-NL” or locale=”nl-BE” but the route description text is still in English. How can I show dutch text instead?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author webaware

    (@webaware)

    This must be done at the level of requesting the Google Maps API, so I haven’t done it in the plugin itself because of how it can interfere with multiple maps on the page. Normally, Google Maps will pick up the locale from your web browser and serve directions in your preferred language, but you can force it to use a specific language by specifying a language when loading the Google Maps API. There’s a filter hook in the plugin for this:

    add_filter('flexmap_google_maps_api_args', function ($args) {
    	$args['language'] = get_locale(); // or 'nl-NL'
    	$args['region'] = 'NL';
    	return $args;
    });

    Add that to a simple plugin, or to your theme’s functions.php file.

    cheers,
    Ross

    Thread Starter scriptgeni

    (@scriptgeni)

    Great! thank you for the code.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Language Directions’ is closed to new replies.