def translatable_modelformset_factory(language, model, form=TranslatableModelForm,
                                      formfield_callback=None, formset=BaseModelFormSet,
                                      extra=1, can_delete=False, can_order=False,
                                      max_num=None, fields=None, exclude=None, **kwargs):

    # This Django API changes often, handle args we know and raise for others
    form_kwargs, formset_kwargs = {}, {}
    for key in ('widgets', 'localized_fields', 'labels', 'help_texts', 'error_messages'):
        if key in kwargs:
            form_kwargs[key] = kwargs.pop(key)
    for key in ('validate_max',):
        if key in kwargs:
            formset_kwargs[key] = kwargs.pop(key)
    if kwargs:
        raise TypeError('Unknown arguments %r for translatable_modelformset_factory. '
                        'If it is legit, it is probably new in Django. Please open '
                        'a ticket so we can add it.' % tuple(kwargs.keys()))

    form = translatable_modelform_factory(
        language, model, form=form, fields=fields, exclude=exclude,
        formfield_callback=formfield_callback, **form_kwargs
    )
    FormSet = formset_factory(form, formset, extra=extra, max_num=max_num,
                              can_order=can_order, can_delete=can_delete, **formset_kwargs)
    FormSet.model = model
    return FormSet
dataset/ETHPy150Open KristianOellegaard/django-hvad/hvad/forms.py/translatable_modelformset_factory/original