Copied to clipboard

Flag this post as spam?

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


  • Jannik Anker 48 posts 258 karma points c-trib
    Oct 01, 2014 @ 17:54
    Jannik Anker
    0

    Localization of member login field labels?

    I'm trying to use what I believe to be the standard login "thing" for a members section in Umbraco 7:

    @using (Html.BeginUmbracoForm("HandleLogin"))
    {
    @Html.ValidationSummary("loginModel", true)
    @Html.LabelFor(m => loginModel.Username)
    @Html.TextBoxFor(m => loginModel.Username)
    @Html.ValidationMessageFor(m => loginModel.Username) <br /><br /> @Html.LabelFor(m => loginModel.Password)
    @Html.PasswordFor(m => loginModel.Password)
    @Html.ValidationMessageFor(m => loginModel.Password)
    <button>Login</button><br /> }

    - but it's intended for a Danish language website, and for the life of me I can't figure out how to make the labels say anything but "Username" and "Password". Now, "password" I can live with if I have to, but "Username" I'd very much like to translate.

    Does anyone know how to do that?

    EDIT: Tried to clean up the code block.

  • Dan Lister 416 posts 1974 karma points c-trib
    Oct 02, 2014 @ 11:37
    Dan Lister
    100

    Hi Jannik,

    You could try overriding the label with a dictionary item. You'll need to add the Danish language and username dictionary item within Umbraco's back office.

    @Html.LabelFor(m => loginModel.Username, Umbraco.GetDictionaryValue("Username"))
    

    Thanks, Dan.

  • Jannik Anker 48 posts 258 karma points c-trib
    Oct 02, 2014 @ 14:36
    Jannik Anker
    0

    Hi Dan,

    I'll try that ASAP, looks pretty straight forward though :-) Thanks!

    /Jannik

  • Jannik Anker 48 posts 258 karma points c-trib
    Oct 06, 2014 @ 10:35
    Jannik Anker
    0

    It wooorks :-) Thanks, Dan!

  • Craig Cronin 304 posts 503 karma points
    Jan 13, 2015 @ 09:53
    Craig Cronin
    0

    Thanks Dan/Jannik,

    I'm currently building a bilinqual website and came across the same problem.  I've been looking at custom attributes etc etc.

    The simple solution is always the best.

     

Please Sign in or register to post replies

Write your reply to:

Draft