Skip to content
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

Allow a custom i18n domain to be used for the "Add ${subitem_title}" link of a SequenceWidget #85

Merged
merged 1 commit into from Mar 30, 2012

Conversation

dbaty
Copy link

@dbaty dbaty commented Mar 30, 2012

I can provide my own message for "SequenceWidget.add_subitem_text_template". This message is displayed as the "Add ${subitem_title}" link for a sequence schema.

The problem is that this message is inevitably processed under the "deform" i18n domain, as shown in this excerpt of 'SequenceWidget.serialize()' :

# '_' is defined in deform.i18n as TranslationStringFactory('deform')
add_subitem_text = _(self.add_subitem_text_template, mapping=add_template_mapping)

The attached commit fixes this bug and allows to provide a TranslationString that has a custom i18n domain. For example, I can now do this:

_ = TranslationStringFactory('my_app')
msg = _('Click here to add a ${subitem_title}')
widget = SequenceWidget(add_subitem_text_template=msg)

…nceWidget.serialize()'. This makes it possible to provide a TranslationString with a custom domain (not 'deform') for 'SequenceWidget.add_subitem_text_template'.
@dnouri dnouri merged commit 5f01c94 into Pylons:master Mar 30, 2012
@dnouri
Copy link
Member

dnouri commented Mar 30, 2012

Thanks

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

Successfully merging this pull request may close these issues.

None yet

2 participants