handlebars-i18n 1.10.0 → 1.10.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.
- package/.github/workflows/ci.yml +2 -5
- package/.github/workflows/coveralls.yml +3 -3
- package/.github/workflows/node.js.yml +10 -10
- package/package.json +13 -12
- package/readme.md +5 -5
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
name: Test and Coverage
|
|
1
|
+
name: CI Test and Coverage
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
@@ -13,10 +13,10 @@ jobs:
|
|
|
13
13
|
|
|
14
14
|
- uses: actions/checkout@v3
|
|
15
15
|
|
|
16
|
-
- name: Use Node.js
|
|
16
|
+
- name: Use Node.js 22.x
|
|
17
17
|
uses: actions/setup-node@v3
|
|
18
18
|
with:
|
|
19
|
-
node-version:
|
|
19
|
+
node-version: 22.x
|
|
20
20
|
|
|
21
21
|
- name: npm install, make test-coverage
|
|
22
22
|
run: |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
2
2
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
3
3
|
|
|
4
|
-
name:
|
|
4
|
+
name: CI Build 16, 18, 20
|
|
5
5
|
|
|
6
6
|
on:
|
|
7
7
|
push:
|
|
@@ -16,15 +16,15 @@ jobs:
|
|
|
16
16
|
|
|
17
17
|
strategy:
|
|
18
18
|
matrix:
|
|
19
|
-
node-version: [
|
|
19
|
+
node-version: [ 16.x, 18.x, 20.x ]
|
|
20
20
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
21
21
|
|
|
22
22
|
steps:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
- uses: actions/checkout@v3
|
|
24
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
25
|
+
uses: actions/setup-node@v3
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
cache: 'npm'
|
|
29
|
+
- run: npm ci
|
|
30
|
+
- run: npm run build --if-present
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handlebars-i18n",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.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": {
|
|
@@ -42,26 +42,27 @@
|
|
|
42
42
|
"intl": "^1.2.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@commitlint/cli": "
|
|
46
|
-
"@commitlint/config-conventional": "
|
|
45
|
+
"@commitlint/cli": "20.2.0",
|
|
46
|
+
"@commitlint/config-conventional": "20.2.0",
|
|
47
47
|
"@types/intl": "^1.2.2",
|
|
48
|
-
"@types/node": "^24.
|
|
48
|
+
"@types/node": "^24.10.1",
|
|
49
49
|
"c8": "^10.1.3",
|
|
50
|
-
"chai": "
|
|
51
|
-
"coveralls-next": "^
|
|
52
|
-
"
|
|
53
|
-
"gulp
|
|
50
|
+
"chai": "6.2.1",
|
|
51
|
+
"coveralls-next": "^6.0.1",
|
|
52
|
+
"glob": "^13.0.0",
|
|
53
|
+
"gulp": "5.0.1",
|
|
54
|
+
"gulp-rename": "2.1.0",
|
|
54
55
|
"gulp-uglify": "3.0.2",
|
|
55
56
|
"gulp-uglify-es": "3.0.0",
|
|
56
57
|
"html-entities": "^2.6.0",
|
|
57
|
-
"mocha": "
|
|
58
|
+
"mocha": "11.7.5",
|
|
58
59
|
"mocha-lcov-reporter": "^1.3.0",
|
|
59
|
-
"nyc": "
|
|
60
|
-
"typescript": "^
|
|
60
|
+
"nyc": "17.1.0",
|
|
61
|
+
"typescript": "^5.9.3"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"handlebars": "^4.7.8",
|
|
64
|
-
"i18next": "^
|
|
65
|
+
"i18next": "^25.7.1",
|
|
65
66
|
"intl": "^1.2.5",
|
|
66
67
|
"relative-time-format": "^1.1.11"
|
|
67
68
|
},
|
package/readme.md
CHANGED
|
@@ -66,7 +66,7 @@ Usage in web browser (old school):
|
|
|
66
66
|
|
|
67
67
|
Via CDN:
|
|
68
68
|
```javascript
|
|
69
|
-
<script src="https://cdn.jsdelivr.net/npm/handlebars-i18n@1.10.
|
|
69
|
+
<script src="https://cdn.jsdelivr.net/npm/handlebars-i18n@1.10.1/dist/handlebars-i18n.min.js"></script>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## Quick Example
|
|
@@ -349,14 +349,14 @@ Adds a time offset in a given unit to a date, returns the modified date.
|
|
|
349
349
|
|
|
350
350
|
The first argument is a date (see function `_date` for valid date inputs). The second argument is a time amount given
|
|
351
351
|
as number. The option **unit** specifies the time amount. Possible units
|
|
352
|
-
are `
|
|
352
|
+
are `second` | `minute` | `hour` | `day` | `week` | `month` | `quarter` | `year` (default is `hour`).
|
|
353
353
|
Further options as for function `_date` can be applied.
|
|
354
354
|
|
|
355
355
|
---
|
|
356
356
|
|
|
357
357
|
### `_dateDiff`
|
|
358
358
|
|
|
359
|
-
Outputs the
|
|
359
|
+
Outputs the time difference between two given dates in the requested unit.
|
|
360
360
|
|
|
361
361
|
```hbs
|
|
362
362
|
{{_dateDiff "2000-12-17" "2001-12-17" unit="year"}}
|
|
@@ -365,7 +365,7 @@ Outputs the relative time difference between two given dates in the requested un
|
|
|
365
365
|
|
|
366
366
|
The second date argument is subtracted from the first. If the difference is a positive value, a future event statement
|
|
367
367
|
is made. A negative value refers to a past date. (If no second argument is given, the default date is the present moment).
|
|
368
|
-
Allowed date input formats are similar to `_date`, options equal `_dateRel`. Default unit is `
|
|
368
|
+
Allowed date input formats are similar to `_date`, options equal `_dateRel`. Default unit is `hour`.
|
|
369
369
|
|
|
370
370
|
---
|
|
371
371
|
|
|
@@ -386,7 +386,7 @@ Outputs a string with a relative date statement, formatted according to the lang
|
|
|
386
386
|
* output: en → **7 hours ago**
|
|
387
387
|
|
|
388
388
|
A positive number argument leads to a future event statement, a negative refers to a past date. Possible units
|
|
389
|
-
are `
|
|
389
|
+
are `second` | `minute` | `hour` | `day` | `week` | `month` | `quarter` | `year` (default is `hour`).
|
|
390
390
|
For a complete set of options (such as `numberingSystem` or `localeMatcher`)
|
|
391
391
|
see [Intl.RelativeTimeFormat Constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
|
|
392
392
|
Alternatively check this repo’s TS types in [handlebars-i18n.d.ts](./dist/handlebars-i18n.d.ts).
|