formio / angular

JSON powered forms for Angular
https://formio.github.io/angular-demo
MIT License
615 stars 462 forks source link

Ability to use localization file #126

Closed tauinbox closed 5 years ago

tauinbox commented 6 years ago

formio.js FormioForm renderer has an ability to use translation file given via option i18n https://github.com/formio/formio.js/wiki/Form-Renderer#options

That would be great if ng2-formio could pass it to there

StephenOTT commented 6 years ago

The translation support in formio.js does not seem to be exposed through ng2-formio. The parameter for the i18n is not available in the ng2 version.

StephenOTT commented 6 years ago

@travist any examples of this functioning with latest release? We attempted this today, and while the json file of translations were loaded, the t() function did not appear to get called.

travist commented 6 years ago

This is next highest priority on my list. Just fixed issues with the CSS in the latest release. Will look at this next. I am passing the i18n variable along, but not sure why it isn't calling the translations.

StephenOTT commented 6 years ago

@travist in your configuration, did you set it up so the form can change languages without having to reload the form/losing any data that was filled out by the user up to the point of the language change?

baddlan commented 6 years ago

@travist @StephenOTT Exposing the new language property of the internal Formio object, in the component, will make it possible to change languages without reloading the form.

travist commented 6 years ago

Should be able to wrap this up today or tomorrow and get a new version released

kombatsanta commented 6 years ago

Any news on this? Can't find any option to use a translation file

rohitsiddha commented 5 years ago

Is there any update on this. If possible, please share the example

travist commented 5 years ago

This is now implemented. You pass it in using the [options] parameter as options.i18n = {}.

https://github.com/formio/angular-formio/blob/master/src/components/formio/formio.component.ts#L115