Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    Feb 04, 2016 @ 17:17
    Nik
    0

    Using Umbraco's Localisation in the back office

    Hey All,

    I'm wondering if you can help.

    Is it possible to use the built in localisation angular service via calls in a custom back office editor to localise error & validation messages?

    Having taking some influence from Archetype currently we (my colleague really) has created their own Localisation service but when our editor loads during the creation of a new datatype the validation process that is call is throwing errors because something (not sure if it's in the Umbraco flow or the angular) stops waiting for promises to resolve, as such null references occur.

    (I'm sure my colleague will see this thread and correct my explanations but that's my understanding so far).

    If so, what's the best way to go about it doing this sort of behaviour? Does anyone have an example that I could look through?

    For Reference Umbraco version 7.3.5

  • Ian 178 posts 752 karma points
    Feb 04, 2016 @ 17:58
    Ian
    0

    For some additional context various methods were evaluated for implementing validation which is currently being applied in the configuration screen of the data type editor.

    After creating a custom validation directive as a first attempt and looking at a thread by warren buckley here the approach eventually adopted uses the same approach as the core umbraco tag manager editor and uses a hidden field with the 'val-property-validator' directive from umbraco applied.

    The problem we're having is returning a result to this line in the validation directive https://github.com/umbraco/Umbraco-CMS/blob/2aa5dfb3ec50f4ddbd23c1fef24d00a6281b3fe9/src/Umbraco.Web.UI.Client/src/common/directives/components/validation/valpropertyvalidator.directive.js#L42 with the errorMsg property populated with the results of an angular service call.

    Can this line be forced to wait until the promise is returned from our angular service or can anyone suggest better means of providing localised error messages as part of the angular/umbraco property editor validation process?

Please Sign in or register to post replies

Write your reply to:

Draft