November Happy Hour will be moved to Thursday December 5th.

Not getting the plugin title to choose localized string from language xml

Vote:
 

I've followed this guide to make my plugin name localized http://sdk.episerver.com/library/cms5/html/T_EPiServer_PlugIn_GuiPlugInAttribute.htm.
But it doesn't work, it just return my display name. This is my code

[GuiPlugIn(
        Area = PlugInArea.AdminMenu,
        Url = "/Modules/Plugins/DictionaryPlugin",
        LanguagePath = "/",
        DisplayName = "Title",
        Description = "Description")]

    
My episerverframework.config says (this works with all other localized strings)

<localization fallbackBehavior="Echo, MissingMessage, FallbackCulture"
    fallbackCulture="en-US">
    <providers>
      <add virtualPath="~/Resources/LanguageFiles" name="languageFiles"
        type="EPiServer.Framework.Localization.XmlResources.FileXmlLocalizationProvider, EPiServer.Framework" />
    </providers>
  </localization>

    
It's in this folder I've added my language files in one of them this is part of the content

<?xml version="1.0" encoding="utf-8"?>
<languages>
  <language name="English" id="en">

    <Title>Dictionary</Title>
    <Description>Description</Description>


  </language>
  <language name="Svenska" id="sv">

    <Title>Språkuppslag</Title>
    <Description>Beskrivning</Description>

  </language>
</languages>

    
What do I need to change to make it work?
Thanks!

 

#74885
Sep 11, 2013 11:07
Vote:
 

Hello Andreas.

The name of the key in the language file should be "displayname", not "title"

#74945
Sep 12, 2013 8:35
Vote:
 

Hi Sergii,

I changed my code to 

[GuiPlugIn(
        Area = PlugInArea.AdminMenu,
        Url = "/Modules/Plugins/DictionaryPlugin",
        LanguagePath = "/",
        DisplayName = "displayname",
        Description = "description")]

    

<?xml version="1.0" encoding="utf-8"?>
<languages>
  <language name="English" id="en">

    <displayname>Dictionary</displayname>
    <description>Description</description>

  </language>
  <language name="Svenska" id="sv">

    <displayname>Språkuppslag</displayname>
    <description>Beskrivning</description>

  </language>
</languages>

    

But it still renders the display name, not the localized value.
Thanks for your help!

#74946
Sep 12, 2013 8:40
Vote:
 

Try to set LanguagePath property of GuiPlugIn attribute to an emtpy string. Internally LanguagePath value is concatenated with "/displayname", so the extra slash might be the reason for the issue.

#74948
Sep 12, 2013 9:16
Vote:
 

Perfect, thankyou!

#74949
Sep 12, 2013 9:36
Vote:
 

Maybe someone could fix the documentation so that the example value of a LanguagePath doesn't contain the ending slash: "/myshop/plugin/ShopPluginTree";-)

#142392
Edited, Dec 10, 2015 12:34
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.