Show Address in a Specific Language

Instructions

  1. Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
    1. Update $language with the ISO 639 two-letter lowercase abbreviation of the desired language e.g. ‘en’ for English (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).

Code

Filename: gpaa-show-address-in-language.php

<?php
/**
 * Gravity Perks // GP Address Autocomplete // Show Address in a Specific Language
 * https://gravitywiz.com/documentation/gravity-forms-address-autocomplete
 *
 * Instructions:
 *     1. Install snippet per https://gravitywiz.com/documentation/how-do-i-install-a-snippet/
 *     2. Update $language with the ISO 639 two-letter lowercase abbreviation of the desired language e.g. 'en' for English (https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes).
 */
add_filter( 'script_loader_src', function( $src, $handle ) {
	if ( 'gp-address-autocomplete-google' !== $handle ) {
		return $src;
	}

	$language = '';

	return add_query_arg( 'language', $language, $src );
}, 10, 2 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.