How to change Commererce Builder string resources
All the messages coming out of back end code are defined as string resources in Resource.rex file. There may be needs to change those messages for example if some one is translating AbleCommerce application to some language other then English. Then he/she might want to update those messages as well. In order to changes these resource messages you need to follow following procedure.
- Copy provided Resources.resx file to some temporary location. This is the only file required to change resource messages.
- You can edit the copied file in any text editor like "NOTEPAD". Change some string message inside the Resources.resx file. For example you can change the "OrderPlaced" message. The existing message in xml format is some thing like as below
<data name="OrderPlaced" xml:space="preserve"> <value>The order has been submitted.</value> <comment>Note added to order by system when an order is placed.</comment> </data>
You can change the "value" node text from "The order has been submitted." to "The order has been placed.". After changing save the copied file.
- Now you need to compile a satellite assembly from this modified file, for this create a batch file with following script
set culture=en-US set outputpath=Bin\%culture%\ resgen Resources.resx Resources.resources echo %outputpath% MD %outputpath% al /t:lib /embed:Resources.resources,CommerceBuilder.Properties.Resources.%culture%.resources /culture:%culture% /out:%outputpath%CommerceBuilder.resources.dll
In order to create a batch file just open the notepad, copy paste the above script in a new file and save the file with name like "compile.bat" to same directory where you already placed "Resources.resx" file.
- Next step is to execute this script. Open the "Visual Studio Command Prompt" and change the prompt location to directory where you have saved the script and resource files. (e.g location is "D:/temp/" directory then change the VS command prompt to "D:/temp/". To execute/run the script type the file name and press enter, and it will compile the satellite assembly from "Resources.resx" file.
- You can found the satellite assembly "CommerceBuilder.resources.dll" inside the newly created folder "Bin/en-US". To deploy just replace this dll file with the existing "Website/Bin/en-US/CommerceBuilder.resources.dll" file.
- Now when you are done with deployment, we can test our changes by placing an order and verifying its "NOTE" in administration section "History and Notes". The note should be "The order has been placed.".
You can download Resource.rex file for AbleCommerce 7.0.3 and compile.bat file containing required compilation script from attachments available here.