damyanbogoev / flask-bookshelf Goto Github PK
View Code? Open in Web Editor NEWFlask Series
Flask Series
I have some example
but I am not sure if I correctly using some details, I need to have app without babel and international urls with lang_codes and logic for switching language and saving lang_code in cookie with blueprint or without it
I didn't entirely follow the tutorial but did find the Localisation part very helpful, hence I implemented the solution in my own app.
One issue I encountered with this implementation is that if I had a url like this "www.example.com/path-that-does-not-exit/" then instead of seeing a 404, I got a babel error.
The error was due to the fact that the localeselector in babel got the 'path-that-does-not-exit' as locale. To fix this, I did the following here,
flask-bookshelf/bookshelf/__init__.py
Lines 44 to 48 in c1549bc
def get_locale():
if g.get('lang_code') not in app.config['SUPPORTED_LANGUAGES'].keys():
return app.config['BABEL_DEFAULT_LOCALE']
else:
return g.get('lang_code', app.config['BABEL_DEFAULT_LOCALE'])```
Thank you for the tutorial. It was immensely helpful. I would love to see a section on setting up Celery for background tasks.
will close this later
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.