Copied to clipboard

Flag this post as spam?

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


  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 01, 2013 @ 00:28
    Jan Skovgaard
    0

    Language of multinode tree picker error message

    Hi guys

    Does anyone know how the standard error message of the MNTP can be changed? I'm thinking about the "Mandatory" text.

    Currently the error message displayed to the editor is always in english even though the UI language is changed to something else. In this case danish.

    I've had a look in the en.xml/da.xml but it does not seem to contain anything of use in the mandatory elements.

    Any hints are much appreciated.

    Cheers,
    Jan

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 01, 2013 @ 00:40
    Lee Kelleher
    1

    Hi Jan,

    It can be changed/translated, but it's done using .NET resources.

    I can provide an example tomorrow (I'm off to bed now) :-)

    Cheers, Lee

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 01, 2013 @ 20:16
    Jan Skovgaard
    0

    Hi Lee

    I would love to see an example on how to do it :)

    Thanks!

    /Jan

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 04, 2013 @ 11:11
    Lee Kelleher
    100

    Hi Jan,

    (Apologies - I didn't have time on Friday to reply)

    OK, for MNTP all the labels are stored in a .NET resources file (basically an XML file), see here:
    https://github.com/umbraco/Umbraco-CMS/blob/6.2.0/src/umbraco.editorControls/MultiNodeTreePicker/MNTPResources.resx#L120

    To make a custom resource file for another language/culture, you'll need to make a copy of MNTP's resources file, edit the appropriate strings/labels/messages and compile it into a custom DLL.

    There is a detailed guide on how to do that here:
    http://www.codeproject.com/Articles/5447/NET-Localization-using-Resource-file
    (You'll only need to do up to step 2.c)

    I know, I know, re-reading that guide, it's not for the faint of heart! :-0

    Good luck with it!

    Cheers,
    - Lee

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 12, 2013 @ 16:03
    Jan Skovgaard
    0

    Thanks a bunch Lee. We will have a look at this - Will let you know if something is not working out.

    Cheers,
    Jan 

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Nov 12, 2013 @ 16:07
    Lee Kelleher
    0

    Yeah, it's not the easiest solution, hope it's not too painful!

  • Emil Christiansen 66 posts 148 karma points
    Jan 20, 2014 @ 14:46
    Emil Christiansen
    0

    Hi Lee

    I have created a new custom dll based on a new resource file where i have changed/translated some of the messages to danish. Unfortunately it doesn't seem to work.

    I have followed the example you provided: http://www.codeproject.com/Articles/5447/NET-Localization-using-Resource-file - but i must admit that i am not 100% sure what is actually going on :) So i have some questions - hoping you could guide me in the right direction:

    First of all i have created a new .resx file using Visual Studio. The file is identical to the MNTPResources.resx - but of course with new translated messages. The name of the file is MyResource.da-DK.resx

    I have then used the Resource Generator with the following command:

    Resgen MyResource.da-DK.resx 

    I have then used the following parameters in the Assembly Linker:

    Al.exe
    /t:lib
    /embed: MyResource.da-DK.resources,
    MyApplication.MyResource.da-DK.resources
    /culture:da-DK
    /out:MyApplication.resources.dll

    The Assembly Linker successfully generates af new dll - but as i said in the beginning, putting it in the bin folder of my Umbraco website doesn't do anything. I am pretty sure i am missing some important things in the naming conventions and embed parameter - but the question is what :) ? 

    What should the name of the generated dll file be and could i name the .resx file whatever i want?

    How is the .dll linked to umbraco - that is: how does umbraco 'know' my dll?

    Should the dll just be put into the bin folder or is some kind of culture folders needed?

    Thanks in advance!

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 21, 2014 @ 11:56
    Lee Kelleher
    0

    Hi Emil,

    I believe the generated resource assembly needs to have the same base-name as the main assembly.

    So rather than calling it MyResource, it would need to be umbraco.editorControls.

    I'd suggest naming the /out: parameter as /out: umbraco.editorControls.resources.dll ... then place that assembly inside a culture folder inside your /bin folder, e.g. /bin/da-DK. Then ASP.NET should wire-up the rest.

    Good luck!

    Cheers,
    - Lee

  • Emil Christiansen 66 posts 148 karma points
    Jan 22, 2014 @ 08:32
    Emil Christiansen
    0

    Hi Lee,

    Thanks for your reply...

    Unfortunately something is still wrong - the translated message is not comming through :)

    The steps i have completed:

    1. Copy the content from the MNTPResources.resx file (taken from here) and place it inside a new .resx file called umbraco.editorControls.resx
    2. Change the Val_MinItemsInvalid value from: The highlighted Multi Node Tree Picker property requires a minimum node selection of {0} to: Test Danish Language {0}  
    3. Run the Resource Generator against the .resx file with the following command: Resgen umbraco.editorControls.resx
    4. Run the Assembly Linker against the .resources file with the following command: Al.exe /t:lib /embed:umbraco.editorControls.resources /culture:da-DK /out:umbraco.editorControls.resources.dll
    5. Create a new folder called da-DK in the bin folder
    6. Place the new generated umbraco.editorControls.resources.dll file inside the da-DK folder
    7. Restart site and Recycle application pool
    8. Login into umbraco with admin set to danish language
    9. Publish document with 'empty' MNTP datatype configured to minimum node selection set to 1.
    10. Error message still in english: "The highlighted Multi Node Tree Picker property requires a minimum node selection of 1"
    Any clue what is wrong :) ?
  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    Jan 22, 2014 @ 11:58
    Lee Kelleher
    0

    Hi Emil,

    I'm wondering if it's related to the user's culture when logged into the back-office?
    Is it set to Danish? (Just trying to rule out the obvious)

    Thanks,
    - Lee

  • Emil Christiansen 66 posts 148 karma points
    Jan 22, 2014 @ 12:41
    Emil Christiansen
    0

    Hi Lee,

    Yes, the user i am testing with is set to Danish...

  • Emil Christiansen 66 posts 148 karma points
    Feb 10, 2014 @ 13:12
    Emil Christiansen
    0

    Hi Lee

    Do you have any new suggestions on this one?

    I am a bit stuck :)

    Thanks

    - Emil

Please Sign in or register to post replies

Write your reply to:

Draft