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.
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.
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.
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:
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?
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.
Unfortunately something is still wrong - the translated message is not comming through :)
The steps i have completed:
Copy the content from the MNTPResources.resx file (taken from here) and place it inside a new .resx file called umbraco.editorControls.resx
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}
Run the Resource Generator against the .resx file with the following command: Resgen umbraco.editorControls.resx
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
Create a new folder called da-DK in the bin folder
Place the new generated umbraco.editorControls.resources.dll file inside the da-DK folder
Restart site and Recycle application pool
Login into umbraco with admin set to danish language
Publish document with 'empty' MNTP datatype configured to minimum node selection set to 1.
Error message still in english: "The highlighted Multi Node Tree Picker property requires a minimum node selection of 1"
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
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
Hi Lee
I would love to see an example on how to do it :)
Thanks!
/Jan
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
Thanks a bunch Lee. We will have a look at this - Will let you know if something is not working out.
Cheers,
Jan
Yeah, it's not the easiest solution, hope it's not too painful!
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:
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!
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 beumbraco.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
Hi Lee,
Thanks for your reply...
Unfortunately something is still wrong - the translated message is not comming through :)
The steps i have completed:
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
Hi Lee,
Yes, the user i am testing with is set to Danish...
Hi Lee
Do you have any new suggestions on this one?
I am a bit stuck :)
Thanks
- Emil
is working on a reply...