Function Reference: geodir_location_localize_all_js_msg

Summary

Outputs translated JS text strings.

Package

GeoDirectory_Location_Manager

Change Log

Since: 1.0.0

Source File

geodir_location_localize_all_js_msg() is located in geodir_location_manager/geodir_location_hooks_actions.php [Line: 576]

Source Code

function geodir_location_localize_all_js_msg()
{
	global $path_location_url;
	
	$arr_alert_msg = array(
							'geodir_location_admin_url' => admin_url('admin.php'),
							'geodir_location_plugin_url' => $path_location_url,
							'geodir_location_admin_ajax_url' => admin_url('admin-ajax.php'),
							'select_merge_city_msg' => MSG_LOCATION_JS_SELECT_CITY,
							'set_location_default_city_confirmation' => MSG_LOCATION_SET_DEFAULT_CITY,
							'LISTING_URL_PREFIX' =>  __('Please enter listing url prefix', GEODIRLOCATION_TEXTDOMAIN),
							'LISTING_URL_PREFIX_INVALID_CHAR' =>__('Invalid character in listing url prefix', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_URL_PREFIX'=> __('Please enter location url prefix', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATOIN_PREFIX_INVALID_CHAR' =>__('Invalid character in location url prefix', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_CAT_URL_SEP' =>__('Please enter location and category url separator', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_CAT_URL_SEP_INVALID_CHAR' =>__('Invalid character in location and category url separator', GEODIRLOCATION_TEXTDOMAIN),
							'LISTING_DETAIL_URL_SEP'=>__('Please enter listing detail url separator', GEODIRLOCATION_TEXTDOMAIN),
							'LISTING_DETAIL_URL_SEP_INVALID_CHAR' =>__('Invalid character in listing detail url separator', GEODIRLOCATION_TEXTDOMAIN),
							
							'LOCATION_PLEASE_WAIT' =>__('Please wait...', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_CHOSEN_NO_RESULT_TEXT' =>__('Sorry, nothing found!', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_CHOSEN_KEEP_TYPE_TEXT' =>__('Please wait...', GEODIRLOCATION_TEXTDOMAIN),
							'LOCATION_CHOSEN_LOOKING_FOR_TEXT' =>__('We are searching for', GEODIRLOCATION_TEXTDOMAIN),
							'select_location_translate_msg' => MSG_LOCATION_JS_SELECT_COUNTRY,
							'select_location_translate_confirm_msg' => MSG_LOCATION_JS_SELECT_COUNTRY_CONFIRM,
							'gd_text_search_city' => __( 'Search City', GEODIRLOCATION_TEXTDOMAIN ),
							'gd_text_search_region' => __( 'Search Region', GEODIRLOCATION_TEXTDOMAIN ),
							'gd_text_search_country' => __( 'Search Country', GEODIRLOCATION_TEXTDOMAIN ),
							'gd_text_search_location' => __( 'Search location', GEODIRLOCATION_TEXTDOMAIN ),
							'gd_base_location' => geodir_get_location_link('base'),
							'UNKNOWN_ERROR' => __( 'Unable to find your location.',GEODIRLOCATION_TEXTDOMAIN ),
							'PERMISSION_DENINED' => __( 'Permission denied in finding your location.',GEODIRLOCATION_TEXTDOMAIN ),
							'POSITION_UNAVAILABLE' => __( 'Your location is currently unknown.',GEODIRLOCATION_TEXTDOMAIN ),	
							'BREAK' => __( 'Attempt to find location took too long.',GEODIRLOCATION_TEXTDOMAIN ),
							'DEFAUTL_ERROR' => __( 'Browser unable to find your location.',GEODIRLOCATION_TEXTDOMAIN ),
							'msg_Near' => __( "Near:", GEODIRLOCATION_TEXTDOMAIN ),
							'msg_Me' => __( "Me", GEODIRLOCATION_TEXTDOMAIN ),
							'msg_User_defined' => __( "User defined", GEODIRLOCATION_TEXTDOMAIN ),
							'delete_location_msg' => __( 'Are you sure want to delete this location?', GEODIRLOCATION_TEXTDOMAIN ),
							'delete_bulk_location_select_msg' => __( 'Please select atleast one location.', GEODIRLOCATION_TEXTDOMAIN ),
						);

	foreach ( $arr_alert_msg as $key => $value )
	{
		if ( !is_scalar($value) )
			continue;
		$arr_alert_msg[$key] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8');
	}

	$script = "var geodir_location_all_js_msg = " . json_encode($arr_alert_msg) . ';';
	echo '';
}