Copied to clipboard

Flag this post as spam?

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


  • Trent Grandey 22 posts 143 karma points
    Jul 11, 2017 @ 19:59
    Trent Grandey
    0

    Language Files - What overrides what?

    I have 3 language files that I am working with. I'm only using en-US. That is my browser's setting and it is the default setting in the web.

    /Config/Lang/en-US.user.xml /Umbraco/Config/Lang/en.xml /Umbraco/Config/Lang/en-US.xml

    I'm targeting one alias for the purposes of this post. (I've removed the other placeholders from this example, but they exist in the actual files)

    <language>
      <area alias="placeholders">
        <key alias="usernameHint">Your username</key>
      </area>
    </language>
    

    If I put a different value in each file, which should win?

    Currently, if I have a different value in all 3, "/Umbraco/Config/Lang/en.xml" wins. I thought that "/Config/Lang/en-US.users.xml" would override all others.

    If I remove it from "/Umbraco/Config/Lang/en.xml", it will read the value from the "/Config/Lang/en-US.users.xml".

    If I remove it from "/Umbraco/Config/Lang/en.xml" AND "/Config/Lang/en-US.users.xml", it will read the value from the "/Umbraco/Config/Lang/en-US.xml" file.

    I'm confused. Again, I would expect "/Config/Lang/en-US.user.xml" to override the other 2 files.

    Am I wrong?

    Thanks for the help!

    Trent Umbraco version 7.6.3 assembly: 1.0.6361.21154

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Jul 11, 2017 @ 21:46
    Chriztian Steinmeier
    0

    Hi Trent,

    Very interesting!

    It would be very nice to investigate this and find out if there's a bug, or if it's just the docs that are misleading...

    As you, I would expect the ~/Config/Lang/{language}.user.xml file to "win" for any alias specified in it.

    Just to be clear: You write .users.xml but the docs states .user.xml - yours is just a typo, right?

    Another thing that could be in play, could be that the .user.xml files might have to match the language code exactly? (In your example you're trying to override a setting in /Umbraco/Config/Lang/en-US.xml with a setting in /Config/Lang/en.user.xml or am I reading it wrong?)

    /Chriztian

  • Trent Grandey 22 posts 143 karma points
    Jul 12, 2017 @ 12:01
    Trent Grandey
    0

    Hi Chriztian,

    The users.xml was in fact a typo. And The filename in the /Config/Lang folder is en-US.user.xml.

    To me, the fact that if I remove the setting from one file and it then reads from another, that tells me that the files are all correctly named. If I couldn't get it to ever read from one particular file, then I would think I had a file out of place or named wrong or had my XML misformed.

    I think I may have to dig into the Core and see if I can tell anything. It is really not a big issue, but it just doesn't make sense to me.

    Thanks for your reply!

    Trent

  • Nicholas Westby 2054 posts 7103 karma points c-trib
    Jul 11, 2017 @ 21:53
    Nicholas Westby
    0

    I have 3 language files that I am working with. I'm only using en-US. That is my browser's setting and it is the default setting in the web.

    What language is your Umbraco user set to? I think the default is "English (United Kingdom)":

    Default Language

  • Trent Grandey 22 posts 143 karma points
    Jul 12, 2017 @ 12:02
    Trent Grandey
    0

    Hi Nicholas,

    For all users, I had changed that to English (United States) upon install.

    Thanks for your reply!

    Trent

Please Sign in or register to post replies

Write your reply to:

Draft