Copied to clipboard

Flag this post as spam?

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


  • Peter Duncanson 430 posts 1358 karma points c-trib
    May 03, 2020 @ 21:28
    Peter Duncanson
    0

    What is the "area" element in a language file and what should I set it to?

    Trying to setup a package language file, something I don't do very often and it shows :)

    I have a dashboard accessed via a Tab on the homepage. Its showing the alias of my dashboard in square brackets like so [petesDashboard]

    Following the instructions here:

    https://our.umbraco.com/documentation/Extending/Packages/Language-Files-For-Packages/

    I've created a en-US.xml file in the App_Plugins/petesPackage/lang folder and put in the following xml

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <language alias="en_us" intName="English (US)" localName="English (US)" lcid="" culture="en-US">
      <creator>
        <name>Offroadcode Ltd</name>
        <link>http://offroadcode.com</link>;
      </creator>
      <area alias="general">
        <key alias="petesDashboard">Much wow!</key>
      </area>
    </language>
    

    But its not working! I'm thinking that the area alias is wrong but I can't for the life of me find any docs on what it should be, seems its one of those things you just need to "know" and right now I don't know it :(

    What am I doing wrong?

  • Kevin Jump 1993 posts 12575 karma points MVP 5x c-trib
    May 03, 2020 @ 21:55
    Kevin Jump
    0

    Hi Pete

    For the dashboard label the area name is "dashboardTabs"

  • Mark Drake 80 posts 318 karma points c-trib
    Jul 14, 2021 @ 16:55
    Mark Drake
    0

    I don't like using this word very often, especially on the internet, but I hate areas. They cause too much segmentation and it's hard enough to get the language and venacular down for the Umbraco Backoffice UI, even harder inside of an XML file. I'm never confident I'm providing keys in the right area alias (ugh).

    I don't like them.

    – A Frontend Engineer

  • Mark Drake 80 posts 318 karma points c-trib
    Jul 15, 2021 @ 01:48
    Mark Drake
    0

    I may have missed this in the documentation or comments...

    The way this works is Umbraco reads the value of the key you request and takes the prefix what comes before the first underscore as the area alias, and the remaining text what comes after the first undderscore as the key alias.

    I've now simplified my language files across my packages by essentially namespacing (unique area alias).

    Example:

        <umb-button type="button"
                button-style="link"
                label-key="humble_contentnodeicons_unset"
                action="vm.humbleRemove">/umb-button>
    

    And:

    <area alias="humble">
        <key alias="contentnodeicons_unset">Reset to Document Icon</key>
    </area>
    
Please Sign in or register to post replies

Write your reply to:

Draft