Closed ngawangtrinley closed 2 years ago
Hey ! I think it's a wonderful idea. There is two ways:
I would recommend the first, but given the fact I am still on leave, I'd probably say the second is the fastest.
Ok, we'll start with english and wait for option number one then. I'm sure it'll be useful for other languages too. Enjoy your holiday!
Hi @PonteIneptique, I'm reaching out for your Babel proposal. We've been using the tool with the option number two but it's a bit messy and the option one would help a lot.
Hey @ngawangtrinley, nice to hear from you :) Unfortunately, I am wrapping up my PhD and Babelizing Pyrrha would take me some time I can't give right now and until later this (civil) year. If you want to take this up, I could always look for tutorial online to share with you ?
Sure, I'm interested if you have a good tutorial in mind.
Good luck for your PhD!
Hi and thanks ;) This seems to be the simplest one I could find ? https://medium.datadriveninvestor.com/translating-your-web-app-via-flask-babel-a1561376256c
Hello @PonteIneptique, for pyrrha localization I am refering to this tutorial : https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiii-i18n-and-l10n and after extraction and translation process, i have added the following codes in app/init.py module
babel = Babel(app)
@babel.localeselector
def get_locale():
return 'bo_CN'
and also I made app=Flask(__name__ )
variable global, in order for it to be inherited by babel. It seems to be working fine, but get_locale(): isn't returning the requested language in the browser. Can you please have a look when time permits you in the PR #276
When I apply the above method in a simple flask project, its working fine.
I also tried to inherit create_app function by :
babel = Babel (create_app)
and left the app = Flask(__name__)
as it is. But then other errors are coming up.
Currently being done in #284
Is your feature request related to a problem? Please describe. My linguist colleagues in China are mostly nomads who only speak Tibetan. We need to localize the app for use locally (using the app online isn't an option because of the great firewall of china)
Describe the solution you'd like I hope to localize pyrrha in Tibetan, is there an ideal or easy way to do it?