super3/peercoin.net — pull request #242 by danbartram (2014-02-24 14:46:13+00:00)
Title: Implemented basic locale system with English translations

## Usage
All of the translations/localized strings are stored in ```locale/strings.php``` in the following format:

```php
$locale_strings['en']['market_cap'] = "Market Cap";

// "en" as the two digit language code
// "market_cap" as the text id
// "Market Cap" as the written language version
```

To output the translation/locale version of some text, initialize the ```Locale``` class and call the ```getText()``` method, like so:

```php
getText("market_cap"); ?>
```

### Available Languages
Available languages should be added to the ```locale/languages.php``` file along with their two digit language code, and their native translation.

For example:

```php
$locale_languages = array(
'en'	=>	'English',
'es'	=>	'Español',
'fr'	=>	'Français',
);
```

Once added to the available languages file, they'll instantly get added to the language selection bar (currently only added in the footer).

### How does it know when to translate?
You can trigger the use of a specific locale language by visiting a URL with the GET parameter set for ```?locale=fr```, which will force the ```Locale``` class to set a cookie named ```locale``` and reference later.

If neither a cookie or a GET parameter are supplied, the browser's ```Accept-Language``` header value is used.

### Language Bar - Footer
This is how the current language bar looks in this commit, because of the responsive design issue explained below there isn't a top bar added yet. If you can add one, that'd be great.
![Language Bar](http://i.imgur.com/Cc2lzUF.png)

### Issues
I've not been able to properly place the language bar at the top of the page. I can get it looking right at desktop resolution, but not responsively. I don't want to make the CSS cluttered and "hacky" by adding a lot of media queries unless necessary.

There are no translations for other languages yet, and I've only done incredibly basic translation examples to illustrate how it works, i.e. the big header text has been translated into Spanish and French.