Skip to content

Inject I18N #352

Open
Open
@andrelec1

Description

@andrelec1

I have a api that return a array for generate my form ...
Exemple :

[
    {
        "label": "form.login",
        "placeholder": "form.login",
        "model": "login",
        "readonly": false,
        "required": true,
        "disabled": false,
        "featured": "",
        "hint": "",
        "min": "",
        "maxlength": null,
        "default": "",
        "type": "input",
        "inputType": "text"
    },
    {
        "label": "form.password",
        "placeholder": "form.password",
        "model": "password",
        "readonly": false,
        "required": true,
        "disabled": false,
        "featured": "",
        "hint": "",
        "min": "",
        "maxlength": null,
        "default": "",
        "type": "input",
        "inputType": "password"
    },
    {
        "label": "form.remember_me",
        "placeholder": "",
        "model": "rememberMe",
        "readonly": false,
        "required": true,
        "disabled": false,
        "featured": "",
        "hint": "",
        "min": "",
        "maxlength": null,
        "default": "",
        "type": "input",
        "inputType": "checkbox"
    }
]

At this point i do a simple this.schema.fields = res.data; ...
But in this json i don't have the translation i juste have a "translation key"

So, for the moment i think i need a mixin function for parse all my json and replace translate key befors sending to the form_generator ...

But i think is usefull if i can inject I18n directly in the generator ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions