I was inspired by the idea of a Steem account faucet because of this post and plan to use it for our local meetups so thanks to
and the
for making it available to the community.
New Features
- Ubuntu install instructions
- Multilingual capabilities
- French translation of the UI
Ubuntu install instructions
With PR#1 I've adapted the install instructions so that it works on Ubuntu as well. Here is how:
## On Ubuntu
1) Download virtualenv and create a new virtualenv.
> sudo apt-get install virtualenv
2) Now the virtualenv can be created.
> virtualenv -p python3.6 agoricco
> source agoricco/bin/activate
3) Your prompt should say (agoricco) now.
4) Clone the project's git repo somewhere.
> git clone git@github.com:agoric-systems/agoric.co.git
5) Next, change into the project's directory.
> cd agoric.co
6) Install the python dependencies.
> pip install -r requirements.txt
7) Change directory again into the `agoricco` package folder and start the flask app.
> cd agoricco
> export FLASK_APP=wsgi.py
> flask run
8) If you need to activate the virtualenv in the future:
> workon agoricco
Multilingual capabilities
The PR#2 is all about translation and making the project multilingual.
How to add another language:
Change the last two letters of this next command with the proper locale letters.
pybabel init -i messages.pot -d translations -l de
pybabel update -i messages.pot -d translations
You then update the .pot file in your proper language directory
pybabel compile -d translations
How to update the translation:
After adding the gettext(u'lorem ipsum') or {{ _('lorem ipsum') }} to your files, run these commands:
pybabel extract -F babel.cfg -o messages.pot .
pybabel update -i messages.pot -d translations
Fix the new strings in all of .pot files inside the translation directory
pybabel compile -d translations
Great references:
- https://pythonhosted.org/Flask-Babel/
- https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiv-i18n-and-l10n
French translation of the UI
I've also translated all of the english UI strings in french. You just need to edit the default_settings.py BABEL_DEFAULT_LOCALE to 'fr' to enable the french interface.
Technology Stack
- Python 3.5 or better
- Flask-Babel
How to contribute?
The code is free to use for commercial purposes. Pull requests to their repo will be reviewed and merged if it makes sense.
You can get in touch with me on the Utopian Discord server
Posted on Utopian.io - Rewarding Open Source Contributors