Jump to content
kakadong

For Those Who Want To Use Their Language In Google Maps Shortcode .

Recommended Posts

kakadong

Hi, don't know if I post it here is correct.

I need the googlemap shortcode to use . But it just shows the English Address.

I need it in Traditional Chinese.

So, if you want to use your Language rather English.

Use your code editor to edit the pagelines/includes/class.shortcodes.php

Find


function googleMaps( $atts, $content = null ) {

delete from

function googleMaps( $atts, $content = null ) {

to

return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&amp;output=embed"></iframe>';

}

(Line 204 ) And Paste this in!

function googleMaps( $atts, $content = null ) {

	    extract( shortcode_atts( array(

		   "width"	   =>  '480',

		   "height"	  =>  '480',

		   "locale"	  =>  'en',

		   "address"   =>   ''

	    ), $atts ) );

	    $src = "http://maps.google.com/maps?f=q&source=s_q&hl=".$locale."&q=".$address;

	    return '<iframe width="'.$width.'" height="'.$height.'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.$src.'&amp;output=embed"></iframe>';

}

Save it. Done.

Now you can add an attribute locale="your country" in your shortcode .

For example :

[googlemap width="100%" height="300" locale="zh_TW" address="台南市永康區小東路689號"]

You can find your country Here !

Remember, it is core file. So , before you edit, please backup.

And everytime you upgrade your PL , you have to do it again.

Share this post


Link to post
Share on other sites
Simon

Thanks, next version has your patch!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×