display translated text according to http accept header

use the http accept header to work out which language the user is
requesting and display it in that language if available otherwise fall
back to the default
save translated items using http accept

uses http accept to determine the language and then updates/created
translation objects for the saved data
Add a language switcher

At the moment we're limiting this to one of two languages so this also
involves adding an alternative language setting to the instance.

Also, refactor out the code to get the different languages to it's own
method which now checks the session for language and overrides the http
accept set language with that.

Plus template for language switcher, and inclusion thereof in
templates
limit the languages we allow the user to use

Only allow the user to use either the default language or the alt
language for either saving or viewing. If they aren't using either of
those then fall back to the default language.

Also, if the language isn't recognized then fall back to the default
langauge too as otherwise the language saving and display code may break
as it relies on us recognizing all the languages in the tranlsation
objects to determine if a key is a translation object
check default and alt language are valid when saving them

make sure these are languages we recognize and if not display an error
otherwise bits of the language code won't work
cope better with no existing version of field being saved

don't try and access a field on an object that doesn't exist and if
there isn't an existing version then set the default language to the
current version rather than nothing
correctly translate things that are arrays when saving

if something's an array then we need to translate each element
indvidually.
correctly translate arrays for viewing

If it's an array we need to translate each element of the array
individually rather than handing over the whole thing. In order to
do this we need to pass back the id of links etc so we can compare them.
We don't actually want to hang on to this ID though so throw it away
afterwards as we don't use them.
pass items we're not translating straight through when saving

If we're not going to translate something then we still want to save it
so we just keep the value sent
add translation decorator to index page objects
only apply the translatedDecorator for GET requests

if it's a PUT or POST request then we want the translation objects so
that we can update them when we save
don't create a translation object just for default language

we only want to create an translation object if we are saving in an
alternative language. If we're creating an entry for the default
language then we might as well just save the data as is
search translations and return translated version in autocomplete

Need to set up an or with a regex for all the languages we are using
plus the non language version so we match everything and then apply the
decorator to the results
Make sure translations are applied when converting to JSON

set getters to true which makes sure the decorated get is called when
running toJSON and hence the output is translated. Required to make sure
the JS version used in templates for things like adding memberships is
translated
return empty string for initial virtual if no name

rather than exploding with an error which is not helpful.
sort index pages manually so we use the translations

You can't hand custom sort routines in to mongo so just get back the
results and then sort the resulting array using javascript. Do this post
decorating so we sort on the translated values.
update to popit-api featuring multi language changes