Properties validation message Localization not working

Hello everyone, I have been following the Document Type Localization tutorial in the Umbraco CMS documentation Document Type Localization | CMS | Umbraco Documentation . Everything works fine except for the mandatory field validation message .


I cannot get it to work—it keeps appearing as shown in the screenshot. I wanted to know if anyone else has had a similar problem.
i also tried to put it in curly brackets like description and it appeared wrong matched with the first part and the curly brackets also appeared in the message

l also made sure that nothing is cashed

@moaz152

hi, could u share ur setup.

new clean umbraco project same umbraco-package.json and doctype-en.js as the documentation Document Type Localization | CMS | Umbraco Documentation cleaned the cash and made sure form the network that the right js file is there . all other localization keys are working fine (doctype name groupname backoofice sections etc) excpet the validation messages

you are right,

upon checking our own setup, its not working like u said works for other….

i think its worth reporting: GitHub · Where software is built

meybe we misseed smth or this is a known issue

/Bishal

good to know its not just me . i only found a closed issue form umbraco 14 V14 - Custom validation message doesn't display correctly · Issue #16785 · umbraco/Umbraco-CMS · GitHub nothing else well thank you for your help

Hi @moaz152

Since you posted here, I thought maybe there was a mistake in the Docs or the software, but it works fine for me.

There are two ways to use localizations, either the shortcut apporach using the # or using the umbLocalize component:

{umbLocalize: general_about}
{#general_about}

Both works here on my machine, I’ve added a screenshot to avoid other misunderstandings:


Could you verify if this is only a problem for your custom localizations? as in does it work as expected for the Core once? (You can try the one I used in the above example)

If so, you may navigate to Settings > Extension Insights to verify that your Localizations has been registered.

Good luck

Hello @nielslyngsoe , thank you for the response. I wasn’t talking about the doctype property name or description; I was referring to the validation messages.

Interestingly, I went back and tried the other formats you suggested, and I noticed something: it only works if you add a space before the key. For example, #validation_mandatory will show “validation_mandatory", but (space)#validation_mandatory will show “the value”.

@moaz152 sorry for the mistake, your right that is a different topic. I guess i got distracted by the Documentation link.

Also noteworthy is that the Description uses markdown, but the Validation messages are just a string that runs through localization logic. So forget everything I wrote, it’s not relevant. :frowning:

Interesting discovery regarding the space, but also somehow weird, as the Core code uses ‘#validation_invalidEmpty’, which does not have a space in front.

Is it a server validation message or a front-end one?

@nielslyngsoe backoffice property validation message like in the screen shot the #validation_mandatory will only resolve if i has whitespace before it without white space it will resolve to “validation_mandatory“

@moaz152 sorry I get your perspective now, I though you where building something custom.

So i just tired to replicate in 17.3 (to be released soon)

work with and without a space in front.

Could you try to keep it in lower case?

@nielslyngsoe i just tried it and i gave me exact same behavior
without

image
with whitespace

Okay, thanks. Which version are you on? then I can try to see if I can replicate it on that particular version. :slight_smile:

@nielslyngsoe i tired on both v17.2.2 and 17.2.1

Hi @moaz152

So if we agree that my test is doing exactly what you’re trying to do. Could I ask you to try this in v.17.3?

Otherwise, I would need to know some more details about how to get to the broken scenario.