Skip to content

stealjs/steal-conditional-substitution-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

steal-conditional string substitution demo

Example app using steal-conditional's string substitution syntax to perform internationalization

The file structure of this demo looks like this:

├── index.html
├── index.js
├── lang.js
├── locale/
│   ├── ar.js
│   ├── en.js
│   ├── es.js
│   ├── hi.js
│   └── zh.js
└── package.json

index.js is the main module and it uses the steal-conditional syntax to load a translation file; lang.js is the condition module used to determine which of the translation files (the files inside the locale folder) should be loaded when the demo is executed in the browser.

In order to run the demo in your browser follow the steps below:

  1. Clone this repo
  2. Run npm install
  3. Run npm start
  4. Open index.html in your browser

google chrome

Building the application

  1. Run npm build
  2. Edit index.html to load steal.production.js
  3. Open in your browser