Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Allows field labels to be set in config #203

Closed
wants to merge 1 commit into from
Closed

Allows field labels to be set in config #203

wants to merge 1 commit into from

Conversation

maebert
Copy link
Contributor

@maebert maebert commented Jan 3, 2014

This makes it relatively easy to e.g. localise them, by simply in your app config saying

from flask.ext.babel import lazy_gettext as _

SECURITY_LABEL_EMAIL = _("Email Address")
SECURITY_LABEL_PASSWORD = _("Password")

I guess the problem with #155 was that the forms classes were constructed outside an application context. I solved that by creating a proxy object that holds back the actual string realisation until it's needed.

This makes #18 also relatively trivial now.

@mattupstate
Copy link
Collaborator

@maebert This looks great. I've always been a little ignorant when it comes to babel. Please allow me to review this and experiment some with babel now before merging this in.

@maebert
Copy link
Contributor Author

maebert commented Jan 24, 2014

Sure, let me know if I can help in any way.

@mattupstate
Copy link
Collaborator

Perhaps we just need some tests that verify this works, and that translations work properly.

@mvdwaeter
Copy link

Can be merged in right? Works just like SECURITY_MSG_

@hailcaeser
Copy link

Hi, would be keen to use these new features. Am I correct that the build for Python v3.3 but worked fine with others?

@mattupstate
Copy link
Collaborator

@maebert Not sure if you're still interested in this PR but I'll be happy to accept if you can merge the upstream updates.

@felix1m
Copy link

felix1m commented May 7, 2015

i manually applied this patch to the current develop branch since i needed it myself. Can confirm it is working properly. Note: When using non-asci characters no not forget to use u'öäü' in python 2.x. Babel of course already provides unicode strings.

felix1m@da8c391

Should i create a seperate PR for this (since it is not really my work :) )?

@maebert
Copy link
Contributor Author

maebert commented May 17, 2015

@felix1m Feel free to post a PR, it's probably less work than rebasing it!

@felix1m
Copy link

felix1m commented May 17, 2015

see pr #390

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants