14 Commits

Author SHA1 Message Date
Dalai Felinto
303a33c3bf Internationalization: Backend support to localization based on user browser
User experience
===============
For users it means we can provide localized web-sites to enrich their
overall experiences.

Although for the Blender Cloud this doesn't make much sense (since the
content is in English), Flamenco and Attract can really benefit from
this.

New configuration settings
==========================
There are two new parameters in config.py:

* DEFAULT_LOCALE='en_US'
* SUPPORT_ENGLISH=True

They are both properly documented in the `config.py` file.

Technicall details
==================
We are using the 'Accept-Languages' header to match the
available translations with the user supported languages.

If an extension has a `translations` folder, it's used for translations.
However the main application (e.g., Blender Cloud) is the one that
determines the supported languages based on its `languages` folder.

How to mark strings for translation
===================================
See the documentation in README.md.

But as an example, 404.pug and pillar/__init__.py::handle_sdk_resource_invalid
have marked up strings that will be extracted once you install pillar,
or run any of the translations commangs.

Remember to **gulp** after you update the template files.

How to setup translations
=========================
You will need to create translation for the main project, and for each
extension that you want to see translated. I added a new entry-point to
the installation of Pillar.

So all you need is to use the `translations`
script to initialize, update and compile your translations.

Pending tasks
=============
Aside from marking more strings for extraction and start the translation
effort it would be interesting to replace the pretty_date routine with
momentjs.

Acknowledgement
===============
Many thanks for Sybren Stüvel for the suggestions and throughout code
review. Thanks also to Francesco Siddi for the original documentation
and suggesting me to tackle this. And Kudos for Pablo Vazquez for the
motivational support and for the upcoming "strings mark up" task force!

The core of the implementation is based on Miguel Grinberg i18n chapter
of his great 'The Mega Flask Tutorial'.

Reviewers: sybren

Differential Revision: https://developer.blender.org/D2826
2017-09-09 00:26:18 +02:00
2c5dc34ea2 Introducing Pillar Framework
Refactor of pillar-server and pillar-web into a single python package. This
simplifies the overall architecture of pillar applications.

Special thanks @sybren and @venomgfx
2016-08-19 09:19:06 +02:00
79661c6a32 Added script for backing up the live MongoDB.
Assumes you have an SSH tunnel to cloudapi.blender.org with
localhost:27018 forwarded to localhost-at-other-side:27017, like:

	ssh cloudapi.blender.org -L 27018:localhost:27017
2016-06-08 11:55:22 +02:00
c13ba86323 Ignore .coverage files/dirs everywhere. 2016-05-27 16:21:23 +02:00
75738efc0d Added "runserver_profile" management command. 2016-05-23 15:17:16 +02:00
9e2664fe20 Ignore google_app.json, as it should never be committed. 2016-05-02 11:13:19 +02:00
974f135e63 Measure unit test coverage.
Coverage is reported with py.test, and also "Run unit tests in ... with
coverage" is now supported in PyCharm.
2016-04-25 16:43:09 +02:00
465b145609 More flexible, less error-prone configuration system.
WARNING: make a backup copy of your local config.py before pulling
this change, as Git will overwrite it without warning.

The configuration defaults to deployment settings, allowing overrides.
Overrides are read from config_local.py and from the file pointed to
by the PILLAR_CONFIG env var.
2016-04-04 14:59:11 +02:00
ebcb6bc5f8 Added setup.py to allow automated testing.
Also moved the tests directory to top-level, as they shouldn't be part
of the pillar directory.
2016-03-25 11:46:01 +01:00
1830d04400 Renaming the project to Pillar. 2015-08-31 18:22:50 +02:00
385ab838d5 Updated .gitignore file
Now ignoring uploads in the storage folder.
2015-04-24 15:09:28 +02:00
Eibriel
4148f6977a Adding .ropeproject to gitignore 2015-04-16 15:02:53 -03:00
Eibriel
025202df3f Initial Cleanup 2015-03-11 16:03:19 +01:00
e42fb2ebc0 First commit for a Flask-based Attract 2014-04-20 12:09:16 +02:00