We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 144443b commit b2e334aCopy full SHA for b2e334a
djangocms_frontend/contrib/link/forms.py
@@ -173,3 +173,16 @@ class Meta:
173
)
174
attributes = AttributesFormField()
175
tag_type = TagTypeFormField()
176
+
177
+ def __init__(self, *args, **kwargs):
178
+ """
179
+ Initialize the form with the language of the plugin edited for the link field widgets.
180
181
+ super().__init__(*args, **kwargs)
182
+ language = None
183
+ if "instance" in kwargs:
184
+ language = getattr(kwargs["instance"], "language", None)
185
+ elif "initial" in kwargs and "plugin_language" in kwargs["initial"]:
186
+ language = kwargs["initial"]["plugin_language"]
187
+ for widget in self.fields["link"].widget.widgets:
188
+ widget.language = language
0 commit comments