Partial pick: Updated the entire base.html template from the override one

Some of the changes are not interesting for us.
Other changes were undone in:

- evernote/pootle@373fbfb9
- evernote/pootle@933b03f1
- evernote/pootle@6bb67a86

and to avoid picking extra commits we just pick here the commits that are
not undone and that are insteresting for us.

Conflicts:
	pootle/templates/layout.html
Under Windows, locale names are different and setlocale() with regular locale names will fail; so just set the default locale and quit early. This will avoid polluting the logs with numerous 'Failed to set locale' debug messages

Conflicts:
	pootle/middleware/setlocale.py
Cleaner and flattier buttton shadows
Removed extra charset declaration
Fix number formatting crash under Windows
Cleanup: coding style fix
Reuse existing code

Picking this required extensive changes due to the huge differences between
Evernote code and our code in this specific view.

Conflicts:
	pootle/apps/pootle_translationproject/views.py
Ignore empty path parts
Revert to previous behaviour
Added creation_time field to Unit

Pick note: Changed name of the migration to keep the numbering.
Check for permissions by using the decorator
Point to the editor URL

Conflicts:
	pootle/apps/pootle_statistics/models.py
Unified units query

Conflicts:
	pootle/apps/pootle_store/models.py
Singularize permission checking

Views only check a single permission at a time.

Conflicts:
	pootle/core/decorators.py
Cleanup: removed a bunch of unused imports

Added some additional unused imports when picking.

Conflicts:
	pootle/apps/pootle_language/views.py
	pootle/apps/pootle_project/views.py
	pootle/apps/pootle_store/models.py
	pootle/urls.py
	tests/fixtures/models/project.py
Cleanup: removed dead code

Conflicts:
	pootle/apps/pootle_language/views.py
	pootle/apps/pootle_project/views.py