Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I added the Register Member partial view snippet and was able to register user using beta 3.
I looked at the view to see about translating the labels and I'm not sure how to proceed.
The view uses label-for:
<label asp-for="@registerModel.Email" class="form-label"></label>
I looked at the Email property and saw that there is display attribute : [Display(Name = "Email")]
Is there an Umbraco way to override the hard-coded attribute or will I need to put a value into the label myself? eg:
<label asp-for="@registerModel.Email" class="form-label">@myEmailTranslation</label>
If so, is there a simpler path to get translations than what I've tried
@inject Umbraco.Cms.Core.Services.ILocalizationService localization; @{ var dItemRoot = localization.GetDictionaryItemByKey("RegisterModel"); var dItems = localization.GetDictionaryItemChildren(dItemRoot.Key).ToDictionary(x=>x.ItemKey); var currentLangauge = 1;//?? var dItem = dItems["Email"].GetTranslatedValue(currentLangauge); }
I eventually found Umbraco helper's GetDictionaryValue to get the translation value
@inject Umbraco.Cms.Web.Common.UmbracoHelper myhelper @myhelper.GetDictionaryValue(the Key)
However I've come back to this issue because I still haven't found an answer for the localization of the register and login forms.
I followed this guide to add the 2 forms: https://our.umbraco.com/Documentation/Tutorials/Members-Registration-And-Logins/
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 9 : How do I localize register models and/or use translations efficiently
I added the Register Member partial view snippet and was able to register user using beta 3.
I looked at the view to see about translating the labels and I'm not sure how to proceed.
The view uses label-for:
I looked at the Email property and saw that there is display attribute : [Display(Name = "Email")]
Is there an Umbraco way to override the hard-coded attribute or will I need to put a value into the label myself? eg:
If so, is there a simpler path to get translations than what I've tried
I eventually found Umbraco helper's GetDictionaryValue to get the translation value
However I've come back to this issue because I still haven't found an answer for the localization of the register and login forms.
I followed this guide to add the 2 forms: https://our.umbraco.com/Documentation/Tutorials/Members-Registration-And-Logins/
is working on a reply...