This example focuses on the Globalize Compiler and the Globalize runtime modules. It assumes knowledge of Globalize usage basics.
1. Install Globalize dependencies and Globalize Compiler
This example uses npm
to download Globalize dependencies (i.e., CLDR data and
the Cldrjs library) and the Globalize Compiler.
npm install
- Start a server by running
python -m SimpleHTTPServer
or other alternative servers such as http-server, nginx, apache. - Point your browser at
http://localhost:8000/development.html
. Note that the formatters are created dynamically. Therefore, Cldrjs and CLDR data are required. - Understand the demo by reading the source code. We have comments there for you.
- Compile the application formatters by running
npm run build
. Seepackage.json
to understand the actual shell command that is used. For more information about the compiler, see the Globalize Compiler documentation. - Point your browser at
./production.html
. Note that we don't need Cldrjs nor CLDR data in production here. - Understand the demo by reading the source code. We have comments there for you.