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

i18n support #169

Open
Gerard-Szulc opened this issue Aug 24, 2020 · 3 comments
Open

i18n support #169

Gerard-Szulc opened this issue Aug 24, 2020 · 3 comments

Comments

@Gerard-Szulc
Copy link
Contributor

I see there is some kind of support of i18n in ncform, but i just dont know how to translate "add" when using arrays, nothing seems to work, just en and zh-cn. I see some implemented translations in array.vue file, just didn't have time to analyse and to fix it.
I tried some solutions from element ui docs and it also didnt work.
Some suggestions?

Also thanks for such a great form creation tool !

@passioncsu
Copy link

passioncsu commented Aug 25, 2020

maybe u can use this configuration item addTxt

image

u can test it in playground
https://ncform.github.io/ncform/ncform-show/playground/index.html?lang=en

{
    "type": "object",
    "properties": {
        "name": {
            "type": "array",
            "items": {
                "type": "string"
            },
            "ui": {
                "widgetConfig": {
                    "requiredDelConfirm": true,
                    "addTxt": "ADD  ONE",
                    "delAllTxt": "DeleteAll",
                    "delConfirmText": {
                        "all": "Are you sure to delete all?",
                        "item": "Are you sure to delete this item?"
                    }
                }
            }
        }
    }
}

@Gerard-Szulc
Copy link
Contributor Author

Gerard-Szulc commented Aug 25, 2020

Thanks, its not a solution that is satisfying, but its working.
i wonder if something like code from screenshot could be achived or just passing whole i18n instance, it would be 100% more appropriate and clean i think.

edit: i know i have custom array, i handled problem with custom array with i18nData with my language property, but its still not the solution for this issue.

image

@dianlight
Copy link

I made a PR #228.
It can be useful in your use-case.

L.

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

No branches or pull requests

3 participants