Closed AnderUstarroz closed 4 months ago
I have reviewed your changes. You have implemented good changes but there are a few considerations for request.state. I will change the codes in the next version in another way. we must implement a request local proxy to handle the gettext as a global variable throughout the files and packages (without passing the request object to do that.
I have tested the code in pull request and it does work fine.
Thanks for resolving this problem.
I have reviewed your changes. You have implemented good changes but there are a few considerations for request.state. I will change the codes in the next version in another way. we must implement a request local proxy to handle the gettext as a global variable throughout the files and packages (without passing the request object to do that.
Sorry for not answering earlier... I saw that you remove the Singleton from core.py, then Babel.instance won't be needed anymore right? Thanks for taking the time to review the PR and making a new release 👍
Actually... are you sure we can just get rid of the Babel.instance? It seems to be used also in the make_gettext function.
There is a serious issue on current implementation, the same Babel instance is shared globally, which means that the request of one user can change the language of another user request depending on race conditions. This PR takes care of scoping a single Babel instance per request.