You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Translation does not work for button text when used within a common layout as described in the docs here. The translation does not update as it should when the language is changed.
Switch the language using language selection links at the bottom.
Language updates for the whole page except for the button text.
See the source code of it here on GitHub using common layout for buttons.
Why this happens:
This happens because when BaseInput class of crispy-forms renders it converts the lazy django translation object passed as value to string and stores it back to value overwriting it here, hence the lazy translation object is lost upon the first render of the input element. If we don't overwrite the original value the issue is resolved.
The text was updated successfully, but these errors were encountered:
Description:
Translation does not work for button text when used within a common layout as described in the docs here. The translation does not update as it should when the language is changed.
Steps to reproduce:
See the source code of it here on GitHub using common layout for buttons.
Why this happens:
This happens because when
BaseInput
class of crispy-forms renders it converts the lazy django translation object passed asvalue
to string and stores it back tovalue
overwriting it here, hence the lazy translation object is lost upon the first render of the input element. If we don't overwrite the originalvalue
the issue is resolved.The text was updated successfully, but these errors were encountered: