Copied to clipboard

Flag this post as spam?

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


  • Rasmus Østergård 19 posts 81 karma points c-trib
    Jan 04, 2010 @ 11:21
    Rasmus Østergård
    0

    How to localize the text of an IAction in a context menu

    In my own UmbracoTree I've added actions that implments the IAction interface.

    The text of the action in the context menu in the tree is the value of IAction.Alias property surrounded by "[" and "]"

    As far as I can tell it's because Umbraco tries to translate the alias using the language xml file in /config/lang dir.

    I'm deploying to multiple sites using a package.

    What is the best way to create a localized text on my context menu? 

     

     

  • Richard Soeteman 4049 posts 12922 karma points MVP 2x
    Jan 04, 2010 @ 11:48
    Richard Soeteman
    0

    Hi,

    I'm affraid you have to use the Language file to store the context menu items text in. Because a user can update his/her Umbraco install you can't update the language file(s) when you install the package(an update will override it). So i'm using the following:

    When a user starts umbImport, I'm checking for a few keys, If they don't exists I update the language file for the selected language of the user. Otherwise I do nothing and during install I update all language files.

    It's a bit of a hack but it works for me

    Cheers,

    Richard

  • Rasmus Østergård 19 posts 81 karma points c-trib
    Jan 04, 2010 @ 12:43
    Rasmus Østergård
    0

    Thanks for the swift answer. I had however hoped for a silver bullet.

Please Sign in or register to post replies

Write your reply to:

Draft