question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

autoFields and i18n

See original GitHub issue

how can i use autoFields with translations? i’m using now pascalprecht.translate. for now i solve it in json:

property: 'password',        
    placeholder : $translate.instant('PASS'),
    label : '',
    type : 'password',
    addons : [{icon : 'fa fa-lock'}],
    attr: { 
      required: true, 
      ngMinlength:5 },
    msgs: {
      match: $translate.instant('PASSWORDSNOTMATCH')
      },

and translation does not change on language change. but my goal is to override defaultMsgs with $autofieldsProvider.settings.validation

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sclausencommented, Mar 7, 2016

Maybe, angular-translate could be included by default. One approach is how its done in JanStevens/angular-growl-2

0reactions
JustMaiercommented, Apr 29, 2015

Currently you can do it at the controller level via options passed to autofields.

###Javascript

scope.options = {
    validation: {
        defaultMsgs: {
            //Replaced messages here
        }
    }
}

###HTML

<auto-fields fields="fields" data="data" options="options"></auto-fields>

I understand that this isn’t ideal and I’ll look into a way to expose the global settings at the run block level.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vazco/uniforms
After then, I've got an error something like : <SelectField /> should be in camelCase .. seems like Autofield does not recognize this...
Read more >
Inner workings — django-modeltrans 0.7.3 documentation
When creating an object, translated fields in the constructor are transformed into a value in the i18n field. So the following two calls...
Read more >
How to use Liferay AutoFields - Marco Napolitano
AutoFields is an AlloyUI component which can be used inside a form to dynamically add multiple elements. Liferay uses it in many points: ......
Read more >
i18n in model fields
I am building a website accessible in a few languages and I need to translate some text data fields of models in those...
Read more >
What's the meaning of '_' in python? - django
Please read up on Internationalization (i18n). http://docs.djangoproject.com/en/dev/topics/i18n/. The _ is a commonly-used name for the function that ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found