Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A jQuery Plugin used for extracting html embedded copy strings
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

What is it for?

ResourceBundle is a jQuery Plugin, it is intended to help you separate content from code and localize your applications.

For example if you wish to display a message on your page, you will not have to hardcode the message on the page/javascript itself, instead you will pull your messages from property source that the ResourceBundle will load and parse. Then you will be able to access the resources through the ResourceBundle plugin.

Implementing ResourceBundle

Step 1

Download the file "jquery.resourcebundle.js":

Step 2

Add the file to your HTML

<script src="" type="text/javascript"></script> 

Step 3

Add a <script> tag that will contain your property source that ResourceBundle will be linked to:

<script id="resources" type="text/plain">

Step 4

Add some properties to your resource <script> tag, each property should be in the form of key=value pairs.

<script id="resources" type="text/plain">
message1=Hi this is a message
message2=Another message
template_message=Hello my name is: ${Name} how are you today?

Step 5

You now may load your resource bundle for example:

$(document).ready( function () {
  var resources = $.getResourceBundle("resources");

Step 6

To access your resources you may do:

$(document).ready( function () {
    var resources = $.getResourceBundle("resources");

which would result in an alert with: Another message

Step 7

enjoy! feedback is more than welcomed!

Something went wrong with that request. Please try again.