What we will do is detect which country a visitor to our website is from and vary the content we show accordingly. In this simple recipe we will detect if a visitor is from UK, Spain, or Germany and output a message in the appropriate language. You will be able to easily adapt or extend the code should you wish to cater for more countries or different countries. This will work by using Sourcerer to query a GeoIP database which tells us where the current visitor's IP address is registered.
If you haven't installed Sourcerer then see the recipe, Installing Sourcerer, in this chapter.
Pick an article, product, category, or Joomla! HTML module in which to do this. We will be installing the code in an article but with Sourcerer, as always, it would be trivial to amend the recipe and put the code somewhere to suit you.