Title: Using localisation
Last modified: August 20, 2016

---

# Using localisation

 *  [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/)
 * Hey again,
 * The plugin has worked brilliantly so far after I managed to tweak it for my needs!
   Thanks again!
 * However, I would like to display a message dependant on location and I would 
   really like to use your plugin for this, there is no point in trying to insert
   more localization code, so I’ve been trying to use it.
 * Can you tell me if there is any simple shortcodes that ONLY detects the location?
   I’m looking to do something like this within my posts [if_uk echo=Hello] [if_us
   echo=yo] [if_eu echo=hello europe].
 * Thanks again buddy.
 * [http://wordpress.org/extend/plugins/amazon-link/](http://wordpress.org/extend/plugins/amazon-link/)

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198201)
 * The plugin can do this, its probably not the most efficient way to do it but 
   it should work fine:
 * Create a template with a single keyword in e.g. have a template named ‘text’ 
   containing just ‘`%TEXT%`‘.
 * Then put a shortcode in your post along the lines of:
 * `[amazon template=text&text[us]=yo&text[uk]=hello&text[fr]=bonjour&text[de]=hello
   europe]`
 * Hope that helps,
 * Paul
 *  Thread Starter [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198270)
 * Fantastic, what an excellent plugin indeed. =]
 * I did run into one other little hiccup also that I wasn’t able to resolve. When
   a product doesn’t exist in one amazon, it obviously goes to amazon’s 404, is 
   there a way to send visitors from the amazon that is broken to another site. (
   I would manually check amazon.com and .co.uk, and if 404 then I’d manually want
   to send relevant users to different website)
 * I.e use shortcode to set links
 * [FR]=ASINNUMBER&[US]=ASINNUMBER&[UK]www.otherwebsite.com/product
 * ?
 * Thanks again Paul, you are the greatest.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198271)
 * I’m currently updating the plugin to provide support for non-Amazon links, so
   in the future you could put in something like:
 * `[amazon asin[fr]=0123456789&asin[us]=9876543210&url[uk]=www.otherwebsite.com/
   product`
 * Its tricky trying to balance all the various ways of generating the URL!
 * Is this what you are after?
 * Paul
 *  Thread Starter [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198272)
 * That is exactly what i’m trying to accomplish!
 * Is it not feasible to simply do a simple if? If = 10 digits, then do amazon code,
   if not then echo the code literally for that localization?
 * Have you got any timescales for this update?
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198273)
 * The development version currently supports this, but it still needs testing, 
   you can download it from here:
 * [http://downloads.wordpress.org/plugin/amazon-link.zip](http://downloads.wordpress.org/plugin/amazon-link.zip)
 * I agree it would be nice to do it as you say and implicitly derive what link 
   type to present based on the content of a single keyword. However I have come
   unstuck doing this sort of implicit ‘type’ recognition before so I tend to prefer
   more explicit arguments.
 * For example the new version supports the following link types:
 * Product Link (Based on ASIN)
    Review Link (Based on ASIN) Search Link (Based 
   on Keywords) Reference Link (Based on a Unique ‘Reference’) URL Link (A direct
   URL with no translation).
 * As you can see distinguishing between a ‘relative link’ at `NewFiction` and a
   reference of `NewFiction`, a search link of `New Fiction` and an 10 digit ASIN
   of ‘NE4F1CT10N’ is not quite as simple as it first appears!
 * e.g. It might work fine on your site where you are careful, but someone else 
   not aware of the various ways to create links might come unstuck.
 * Paul
 *  Thread Starter [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198306)
 * Fantastic, I will test that version soon.
 * Another small side note that I forgot to ask you too, is I contacted Amazon and
   they say that if you show live prices through the API and they are more than 
   1 hour old, then you have to put a time stamp saying when the price is from. 
   How old/often does your plugin retrieve the prices?
 * Thanks Paul
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198307)
 * Hi,
 * If the cache is not enabled then they are live prices, if the cache is enabled
   then their age depends upon the ‘Cache Data Age’ setting.
 * I guess that is for the ‘Offer’ price rather than the List price though?
 * I could add the ‘timestamp’ of the cache data as a template item – the preferred
   data format must be one of the standard WordPress settings.
 * Cheers,
 * Paul
 *  Thread Starter [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198308)
 * I will simply leave cache off, much simpler and doesn’t seem to have an effect
   on anything! (I only have one live price per page).
 * Well, Amazon simply told me “live price” so to ensure that you are 100% not breaking
   any rules, i’d assume they mean any price.
 * Another little thing I found was that you set it so that each user can add their
   own affiliate links in their wordpress user profiles. Can you tell me where this
   is coded in please? I have some friends writing on my site, and would much prefer
   if they didn’t have that option. Thanks.
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198309)
 * Hi,
 * In the file amazon.php in the function admin_menu()
 * The last 4 lines add the user_options:
 *     ```
       add_action('show_user_profile', array($this, 'show_user_options') );        // Display User Options
                add_action('edit_user_profile', array($this, 'show_user_options') );        // Display User Options
                add_action('personal_options_update', array($this, 'update_user_options')); // Update User Options
                add_action('edit_user_profile_update', array($this, 'update_user_options'));// Update User Options
       ```
   
 * Just comment them out / remove them.
 * Paul
 *  Thread Starter [kelecap](https://wordpress.org/support/users/capbell/)
 * (@capbell)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198327)
 * Brilliant! 🙂
 * Here’s another idea I ran into – Have you ever looked at adding links to images?
   Not amazon images, but uploaded media images and have them clickable to an Amazon
   ASIN with localisation?
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198328)
 * You can do this manually using the plugin already if you know the URL of the 
   image, e.g. using the standard ‘image’ template:
 * `[amazon template=image&asin=0123456789&image=http://www.mydomain.com/wp-content/
   uploads/2012/12/my_image.jpg]`
 * What did you have in mind? Add a button to the WordPress Media window that automatically
   generated a shortcode using that Media item? Or something else?
 * Paul
 *  [lizsup](https://wordpress.org/support/users/lizsup/)
 * (@lizsup)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198371)
 * I have successfully used this method to include a link from my local image, but
   the tooltip that should display the alt text returns “Undefined.” Where/how do
   I fix this?
 * Blog is at uxideas.supinski.com — it is implemented on the “100 ideas” post.
 * Thanks!
 *  Plugin Author [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * (@paulstuttard)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198372)
 * Hi,
 * Depends upon the template you are using, usually the alt text for the image is
   provided by the `%TITLE%` keyword, so in your shortcode if you are not using 
   live data you need to provide the title. Just add: `&title=my title` to the end
   of your shortcode arguments.
 * In the above example:
 * `[amazon template=image&asin=0123456789&image=http://www.mydomain.com/wp-content/
   uploads/2012/12/my_image.jpg&title=my title]`
 * Hope that helps,
 * Paul

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Using localisation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/amazon-link_070606.svg)
 * [Amazon Link](https://wordpress.org/plugins/amazon-link/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amazon-link/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amazon-link/)
 * [Active Topics](https://wordpress.org/support/plugin/amazon-link/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amazon-link/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amazon-link/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [paulstuttard](https://wordpress.org/support/users/paulstuttard/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/using-localisation/#post-3198372)
 * Status: not resolved