The demo contains one single file:
.
└── index.html
Before running it, execute the requirements below.
1. Dependencies
The demo requires Globalize and its 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 Globalize releases tab.
- Download the latest package.
- Unzip it.
- Rename the extracted directory
globalize
and move it alongsideindex.html
andREADME.md
. - Click at cldrjs releases tab.
- Download the latest package.
- Unzip it.
- Rename the extracted directory
cldrjs
and move it alongsideindex.html
andREADME.md
.
Then, you'll get this:
.
├── cldrjs
│ └── dist
│ ├── cldr.js
│ ├── ...
│ └── cldr
│ ├── event.js
│ ├── supplemental.js
│ └── ...
├── globalize
│ └── dist
│ ├── globalize.js
│ ├── ...
│ └── globalize
│ ├── currency.js
│ ├── date.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.