Formalchemy localization

35 views
Skip to first unread message

Denis Rykov

unread,
May 2, 2012, 3:49:35 PM5/2/12
to forma...@googlegroups.com
Hi! Could anyone share code of http://docs.formalchemy.org/demo/set_language or anything similar?
Thanks.

Gaël Pasgrimaud

unread,
May 2, 2012, 3:59:31 PM5/2/12
to forma...@googlegroups.com
You can find it here:

https://github.com/FormAlchemy/pyramid_formalchemy/blob/master/pyramid_formalchemy/views.py#L43

It's already configured in the includeme:

https://github.com/FormAlchemy/pyramid_formalchemy/blob/master/pyramid_formalchemy/__init__.py#L19
> --
> You received this message because you are subscribed to the Google Groups
> "FormAlchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/formalchemy/-/_R9cqKVJTeAJ.
> To post to this group, send email to forma...@googlegroups.com.
> To unsubscribe from this group, send email to
> formalchemy...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/formalchemy?hl=en.

Denis Rykov

unread,
May 3, 2012, 12:07:15 AM5/3/12
to forma...@googlegroups.com
Thanks! How I can add link for changing language to my page (I'm using fa.jquery)?

Gaël Pasgrimaud

unread,
May 3, 2012, 3:42:23 AM5/3/12
to forma...@googlegroups.com
First you need to set correct values in your ini file:

https://github.com/FormAlchemy/formalchemy_project/blob/master/production.ini#L50

Then make the actions available:

https://github.com/FormAlchemy/pyramid_formalchemy/blob/master/pyramid_formalchemy/resources.py#L40

And use it in your template:

https://github.com/FormAlchemy/fa.jquery/blob/master/fa/jquery/templates/admin/master.pt#L51



>
> --
> You received this message because you are subscribed to the Google Groups
> "FormAlchemy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/formalchemy/-/8A1GxF4gqTwJ.

Denis Rykov

unread,
May 4, 2012, 12:09:14 AM5/4/12
to forma...@googlegroups.com
Great! It works and pyramid_formlchemy strings is changed when I change language.
But it not affected to my model names and field labels. I've translated them as described here: http://docs.pylonsproject.org/projects/pyramid/en/1.0-branch/narr/i18n.html
and added config.add_translation_dirs('myapp:locale/') to __init__.py but no effect when I change language.

Denis Rykov

unread,
May 4, 2012, 1:41:34 AM5/4/12
to forma...@googlegroups.com
I've solved this issue with TranslationStringFactory.
Reply all
Reply to author
Forward
0 new messages