The demo contains one single file:
.
└── index.html
Before running it, execute the requirements below.
1. Dependencies
Globalize's dependencies are listed on Getting Started, and the only one is cldrjs. You are free to fetch it the way you want. But, as an exercise of this demo, we'll download it ourselves. So:
- Click at cldrjs releases tab.
- Download the latest package.
- Unzip it.
- Create a
cldrjs
directory alongsideindex.html
andREADME.md
and move the cldrjsdist/
files into it.
Then, you'll get this:
.
├── cldrjs
│ ├── cldr.js
│ ├── ...
│ └── cldr
│ ├── event.js
│ ├── supplemental.js
│ └── ...
├── index.html
└── README.md
For more information read cldrjs' usage and installation docs.
2. CLDR content
Another typical Globalize requirement is to fetch CLDR content yourself. But, on this demo we made the things a little easier for you: we've embedded static JSON into the demo. So, you don't need to actually fetch it anywhere. For more information about fetching Unicode CLDR JSON data, see How do I get CLDR data?.
No action needed here.
3. Globalize dist
files
This step only applies if you are building the source files. If you have downloaded a ZIP or a TAR.GZ or are using a package manager (such as bower or npm) to install then you can ignore this step.
Install the development external dependencies and build the distribution files.
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. We have comments there for you.