stealjs / steal-conditional-substitution-example

Steal-conditional string substitution syntax demo

Home Page:https://stealjs.com/docs/steal-conditional.html#string-substitution-syntax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Steal-conditional string substitution syntax demo

https://stealjs.com/docs/steal-conditional.html#string-substitution-syntax

License:MIT License


Languages

Language:JavaScript 60.9%Language:HTML 39.1%