-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix translation of WTForms strings (simplified again) #13
Conversation
Steps for testing implementation:
|
I'm afraid you didn't update two more forms that are in the project.. profile and feedback |
Thanks for spotting that, I've too many branches... waiting for opportunity to prune :-) |
I'm about to merge that... tested it and it worked nicely..! Do you remember the reference on where you find on how to resolve that? |
Fix translation of WTForms strings
I simplified it a bit: 2e870bd :) check you'll spot something strange... |
Did you try deploying that? Does that still works?! :| |
It is based on http://wtforms.readthedocs.org/en/1.0.5/i18n.html#writing-your-own-translations-provider and on an approach I noted in
I've just deployed my proposed PR version on appspot.com and that worked (with the "Steps for testing implementation:" described above); I've not (yet) checked your further modification. |
Thanks.. It works.. you can simply press the blue button here: http://babel.gae-init.appspot.com/l/el/?next=/feedback/ ;) |
I just confirmed that your further modification works on appspot.com as well. I'm not 100% sure why though? I thought the try-except and return None was a needed safeguard in case any of the removed (previous) if-then-returns; with the try-except being easier to understand (with my understanding that try-except is a good approach in Python; as confirmed in http://stackoverflow.com/a/7604717/2315612). Anyway, your link does simplify my test procedure a lot... too bad my localhost gives me a 418 on http://localhost:8080/l/ru/?next=/feedback/ (too late to figure it out now... need sleep) |
Your test site also shows that it handles unknown locales, like http://babel.gae-init.appspot.com/l/nl/?next=/feedback/ defaults to the |
Ah, now I know why "I'm a teapot" / 418... need to set the "Feedback Email" on the "Admin Config" first. |
Yes the as for the simplified version.. I just skipped checking the |
This resolves the #6 "Strings that are in WTForms are not translated" issue.
Note: this supersedes the previous #12 (including feedback provided there) and #10 pull requests.