This project is read-only.
Important
Do not store any private/secret information in the dictionary items in Umbraco, this add-on will expose all dictionary items and their content, so don't put passwords, e-mail addresses etc. into a dictionary item when using this add-on!

Installation

If you're not using the Package Actions Contrib package (http://packageactioncontrib.codeplex.com) for Umbraco, you'll need to add this manually to the web.config file of the site:
<add verb="*" path="/script/dic2js.ashx" type="CreativeMinds.Umbraco.Dictionary2JS.JavascriptLanguageHandler,
 CreativeMinds.Umbraco.Dictionary2JS"/>
Important
If you want to uninstall the package, and does not have the Package Actions Contrib package (http://packageactioncontrib.codeplex.com) for Umbraco installed, remember to delete this line in the web.config file before uninstalling the package.

The usercontrol or the Umbraco macro should be put somewhere in the <head> section of your pages, as the output is a script-tag.

How this works

The output of the included user control looks like this:
<script type="text/javascript" src="/script/dic2js.ashx?culture=en-GB&xslt=dic2js.mootools.xslt"> </script> 


And if you look at the source of this link, you'll get this (using the included xslt for mootools):
var texts = new Hash({
		'LogInErrorHeading': 'Error', 
		'LogInErrorText': 'Logging in failed!'
});


And then anywhere in your javascript, you can get any text using this simple code:
alert(texts['LogInErrorHeading']);

Last edited Aug 25, 2010 at 8:10 AM by privatejson, version 12

Comments

No comments yet.