handlebars-i18n 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +23 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "handlebars-i18n",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "handlebars-i18n adds internationalization to handlebars.js using i18next and Intl.",
5
5
  "main": "dist/handlebars-i18n.js",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -8,13 +8,14 @@ the web browser. Supports Typescript.
8
8
  Handlebars-i18n is listed amongst i18next’s [framework helpers](https://www.i18next.com/overview/supported-frameworks).
9
9
 
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
11
- ![Node.js Version](https://img.shields.io/badge/Node.js-14.x-green)
11
+ ![Node.js version](https://img.shields.io/badge/node-%3E%3D14-brightgreen)
12
12
  [![Build](https://github.com/fwalzel/handlebars-i18n/actions/workflows/node.js.yml/badge.svg)](https://github.com/fwalzel/handlebars-i18n/actions/workflows/node.js.yml/badge.svg)
13
13
  [![Coverage Status](https://coveralls.io/repos/github/Aller-Couleur/handlebars-i18n/badge.svg?branch=master)](https://coveralls.io/github/Aller-Couleur/handlebars-i18n?branch=master)
14
14
  [![Code Climate](https://codeclimate.com/github/Aller-Couleur/handlebars-i18n/badges/gpa.svg)](https://codeclimate.com/github/Aller-Couleur/handlebars-i18n)
15
15
  [![Known Vulnerabilities](https://snyk.io/test/github/Aller-Couleur/handlebars-i18n/badge.svg)](https://snyk.io/test/github/Aller-Couleur/handlebars-i18n/badge.svg)
16
16
  ![npm](https://img.shields.io/npm/dt/handlebars-i18n)
17
17
  ![npm](https://img.shields.io/npm/dm/handlebars-i18n)
18
+ ![GitHub stars](https://img.shields.io/github/stars/fwalzel/handlebars-i18n?style=social)
18
19
 
19
20
  ## License
20
21
 
@@ -28,20 +29,27 @@ If you use handlebars-i18n in a professional context, you could
28
29
 
29
30
  ## Install
30
31
 
31
- ```bash
32
+ ```sh
32
33
  npm i handlebars-i18n
33
34
  ```
34
35
 
35
- ## Usage
36
+ ## Import
36
37
 
37
- Usage within node environment:
38
+ Import as commonJS within node environment:
38
39
 
39
40
  ```javascript
40
41
  const HandlebarsI18n = require("handlebars-i18n");
41
42
  HandlebarsI18n.init();
42
43
  ```
43
44
 
44
- Usage in web browser:
45
+ With ES6 import syntax:
46
+
47
+ ```typescript
48
+ import * as HandlebarsI18n from "handlebars-i18n";
49
+ HandlebarsI18n.init();
50
+ ```
51
+
52
+ Usage in web browser (old school):
45
53
 
46
54
  ```javascript
47
55
  <script src="handlebars.js"></script>
@@ -53,12 +61,9 @@ Usage in web browser:
53
61
  </script>
54
62
  ```
55
63
 
56
- With ES6 import syntax:
57
-
58
- ```typescript
59
- import * as HandlebarsI18n from "handlebars-i18n";
60
-
61
- HandlebarsI18n.init();
64
+ Via jsDelivr CDN:
65
+ ```javascript
66
+ <script src="https://cdn.jsdelivr.net/npm/handlebars-i18n@1.8.0/dist/handlebars-i18n.min.js"></script>
62
67
  ```
63
68
 
64
69
  ## Quick example
@@ -143,17 +148,17 @@ Finally use in template:
143
148
 
144
149
  :point_right: See the *examples folder* in the repo for more use cases and details.
145
150
 
146
- - Open `examples/browser-example/index.html` in your Web browser to see an implementation with a simple UI
147
- - Run `$ npm run example:js` in the console to get a very basic node example logged
148
- - Run `$ npm run example:ts` to compile and log a typescript example
151
+ - Open `examples/browser-example/index.html` in your Web browser to see an implementation with a simple UI.
152
+ - Run `npm run example:js` in the console to get a very basic node example logged.
153
+ - Run `npm run example:ts` to compile and log a typescript example.
149
154
 
150
155
  ## Additional CLI Helper for Handlebars-i18n available :metal:
151
156
 
152
157
  Handlebars-i18n has its own command line
153
158
  interface [handlebars-i18n-cli](https://www.npmjs.com/package/handlebars-i18n-cli).
154
159
 
155
- ```bash
156
- $ npm i handlebars-i18n-cli --save-dev
160
+ ```sh
161
+ npm i handlebars-i18n-cli --save-dev
157
162
  ```
158
163
 
159
164
  Automatically extract translation strings from handlebars templates and generate i18next conform json files from it.
@@ -514,8 +519,8 @@ HandlebarsI18n.init(null, i18nextCustom);
514
519
 
515
520
  ## Run tests
516
521
 
517
- ```bash
518
- $ npm test
522
+ ```sh
523
+ npm test
519
524
  ```
520
525
 
521
526
  ## Merci à vous