We assume you know what AMD and bower is.
The demo is composed of the following files:
.
├── index.html
└── main.js
Before running it, execute the requirements below.
1. Install Globalize
Let's use bower to download Globalize. For more information on regard of installation, please read Getting Started.
bower install globalize#1.x
Ah! Let's also use bower to fetch some other dependencies of this demo, eg. require.js and its json plugin.
bower install requirejs requirejs-plugins requirejs-text
Then, you'll get this:
.
├── bower_components/
│ ├── globalize/
│ │ └── dist/
│ │ ├── globalize
│ │ │ ├── date.js
│ │ │ └── ...
│ │ └── globalize.js
│ └── ...
├── index.html
└── main.js
2. Install Dependencies
No action needed, because bower has already handled that for us.
3. CLDR content
Download the latest Unicode CLDR JSON
ZIP and unzip it into
cldr/
. For more information read Getting Started.
wget http://www.unicode.org/Public/cldr/latest/json.zip
unzip json.zip -d cldr
Then, you'll get this:
.
├── bower_components/
│ ├── globalize/
│ │ └── dist/
│ │ ├── globalize
│ │ │ ├── date.js
│ │ │ └── ...
│ │ └── globalize.js
│ └── ...
├── cldr/
│ ├── main/
│ │ └── ...
│ └── supplemental/
│ └── ...
├── index.html
└── main.js
Once you've completed the requirements above:
- Point your browser at
./index.html
. - Open your JavaScript console to see the demo output.
- Understand the demo by reading the source code (both index.html and main.js). We have comments there for you.