handlebars-i18n 1.3.1 → 1.4.0
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 +8 -4
- package/.github/workflows/schedule.yml +10 -10
- package/CHANGELOG.md +8 -0
- package/package.json +13 -13
- package/readme.md +12 -5
- package/test/handlebars-i18n.test.js +1 -1
- package/.idea/.name +0 -1
- package/.idea/handlebars-i18n.iml +0 -8
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/misc.xml +0 -14
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
package/.github/workflows/ci.yml
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
name: CI
|
|
2
2
|
|
|
3
|
-
on:
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
release:
|
|
7
|
+
types: [published]
|
|
4
8
|
|
|
5
9
|
env:
|
|
6
10
|
IMAGE_ID: ${{ github.repository }}
|
|
@@ -17,16 +21,16 @@ jobs:
|
|
|
17
21
|
npm i
|
|
18
22
|
npm run test
|
|
19
23
|
semantic-release:
|
|
20
|
-
if: github.
|
|
24
|
+
if: github.ref == 'refs/heads/master'
|
|
21
25
|
name: Semantic Release
|
|
22
26
|
runs-on: ubuntu-latest
|
|
23
27
|
needs: build
|
|
24
28
|
steps:
|
|
25
|
-
- uses: actions/checkout@v2.
|
|
29
|
+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
|
|
26
30
|
with:
|
|
27
31
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
28
32
|
- name: Semantic Release
|
|
29
|
-
uses: cycjimmy/semantic-release-action@v2.
|
|
33
|
+
uses: cycjimmy/semantic-release-action@5982a02995853159735cb838992248c4f0f16166 # renovate: tag=v2.7.0
|
|
30
34
|
with:
|
|
31
35
|
extra_plugins: |
|
|
32
36
|
@semantic-release/changelog
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
name: Scheduled
|
|
1
|
+
name: 'Release: Scheduled'
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
schedule:
|
|
5
|
-
- cron:
|
|
5
|
+
- cron: '0 0 * * 1' # Every Monday at 00:00 AM UTC on the default branch
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
8
|
analyze-tags:
|
|
@@ -11,12 +11,12 @@ jobs:
|
|
|
11
11
|
previous-tag: ${{ steps.previoustag.outputs.tag }}
|
|
12
12
|
timestamp-diff: ${{ steps.diff.outputs.timestamp-diff }}
|
|
13
13
|
steps:
|
|
14
|
-
- uses: actions/checkout@v2.
|
|
14
|
+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
|
|
15
15
|
with:
|
|
16
16
|
fetch-depth: 0
|
|
17
17
|
- name: Get previous tag
|
|
18
18
|
id: previoustag
|
|
19
|
-
uses:
|
|
19
|
+
uses: WyriHaximus/github-action-get-previous-tag@v1.1.0
|
|
20
20
|
- name: Get seconds from previous tag to now
|
|
21
21
|
id: diff
|
|
22
22
|
shell: bash
|
|
@@ -30,20 +30,20 @@ jobs:
|
|
|
30
30
|
needs: analyze-tags
|
|
31
31
|
if: needs.analyze-tags.outputs.timestamp-diff > 604800 # 604800 equal one week.
|
|
32
32
|
steps:
|
|
33
|
-
- uses: actions/checkout@v2.
|
|
33
|
+
- uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # renovate: tag=v2.4.0
|
|
34
34
|
with:
|
|
35
35
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
36
36
|
- name: Get next minor version
|
|
37
37
|
id: semvers
|
|
38
|
-
uses:
|
|
38
|
+
uses: WyriHaximus/github-action-next-semvers@v1
|
|
39
39
|
with:
|
|
40
40
|
version: ${{ needs.analyze-tags.outputs.previous-tag }}
|
|
41
41
|
- name: manifest Version
|
|
42
|
-
uses: deef0000dragon1/json-edit-action
|
|
42
|
+
uses: deef0000dragon1/json-edit-action@cb3f7455e89d659879ab7e4a55cbc9b10c36a713 # renovate: tag=v1
|
|
43
43
|
env:
|
|
44
44
|
KEY: scheduleVersion
|
|
45
45
|
VALUE: ${{ steps.semvers.outputs.patch }}
|
|
46
|
-
FILE: package.json
|
|
47
|
-
- uses: stefanzweifel/git-auto-commit-action@v4.
|
|
46
|
+
FILE: ${{ inputs.PACKAGE_JSON_PATH || 'package.json' }}
|
|
47
|
+
- uses: stefanzweifel/git-auto-commit-action@5804e42f86b1891093b151b6c4e78e759c746c4d # renovate: tag=v4.13.1
|
|
48
48
|
with:
|
|
49
|
-
commit_message: 'fix(release): schedule release'
|
|
49
|
+
commit_message: 'fix(release): schedule release'
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
# [1.4.0](https://github.com/fwalzel/handlebars-i18n/compare/1.3.1...1.4.0) (2022-03-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **deps:** upgrade gulp-uglify-es to v3 ([9c918a5](https://github.com/fwalzel/handlebars-i18n/commit/9c918a5b2bb9d6575c106abff5b57922e208f9ac))
|
|
7
|
+
* **deps:** upgrade mocha to v9 ([2de5e75](https://github.com/fwalzel/handlebars-i18n/commit/2de5e75862467e32a2f5ce65ba520520844d3b53))
|
|
8
|
+
|
|
1
9
|
## [1.3.1](https://github.com/fwalzel/handlebars-i18n/compare/1.3.0...1.3.1) (2021-09-22)
|
|
2
10
|
|
|
3
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "handlebars-i18n",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "handlebars-i18n adds internationlization to handlebars.js using i18next and Intl",
|
|
5
5
|
"main": "dist/handlebars-i18n.js",
|
|
6
6
|
"scripts": {
|
|
@@ -35,28 +35,28 @@
|
|
|
35
35
|
"license": "MIT",
|
|
36
36
|
"homepage": "https://github.com/fwalzel/handlebars-i18n.git#readme",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"handlebars": "^4.7.
|
|
39
|
-
"i18next": "^
|
|
38
|
+
"handlebars": "^4.7.7",
|
|
39
|
+
"i18next": "^21.6.14",
|
|
40
40
|
"intl": "^1.2.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@commitlint/cli": "
|
|
44
|
-
"@commitlint/config-conventional": "
|
|
45
|
-
"chai": "4.3.
|
|
46
|
-
"coveralls": "3.1.
|
|
43
|
+
"@commitlint/cli": "16.2.3",
|
|
44
|
+
"@commitlint/config-conventional": "16.2.1",
|
|
45
|
+
"chai": "4.3.6",
|
|
46
|
+
"coveralls": "3.1.1",
|
|
47
47
|
"gulp": "4.0.2",
|
|
48
48
|
"gulp-rename": "2.0.0",
|
|
49
49
|
"gulp-uglify": "3.0.2",
|
|
50
|
-
"gulp-uglify-es": "
|
|
50
|
+
"gulp-uglify-es": "3.0.0",
|
|
51
|
+
"husky": "7.0.4",
|
|
51
52
|
"istanbul": "0.4.5",
|
|
52
|
-
"mocha": "
|
|
53
|
+
"mocha": "9.2.2",
|
|
53
54
|
"nyc": "15.1.0"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"handlebars": "
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"intl": "^1.2.5"
|
|
57
|
+
"handlebars": "4.7.7",
|
|
58
|
+
"i18next": "21.6.14",
|
|
59
|
+
"intl": "1.2.5"
|
|
60
60
|
},
|
|
61
61
|
"husky": {
|
|
62
62
|
"hooks": {
|
package/readme.md
CHANGED
|
@@ -18,10 +18,17 @@ MIT License
|
|
|
18
18
|
|
|
19
19
|
## Install
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
If you use version npm >= 7:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
$ npm i handlebars-i18n
|
|
23
25
|
```
|
|
24
26
|
|
|
27
|
+
For older versions do:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
$ npm i handlebars-i18n handlebars@4.7.6 i18next@20.2.1 intl@1.2.5
|
|
31
|
+
```
|
|
25
32
|
|
|
26
33
|
## Usage
|
|
27
34
|
|
|
@@ -125,7 +132,7 @@ Finally use in template:
|
|
|
125
132
|
|
|
126
133
|
## Run tests
|
|
127
134
|
|
|
128
|
-
```
|
|
135
|
+
```bash
|
|
129
136
|
$ npm test
|
|
130
137
|
```
|
|
131
138
|
|
|
@@ -365,7 +372,7 @@ HandlebarsI18n.reset();
|
|
|
365
372
|
|
|
366
373
|
## Using custom instances of Handlebars
|
|
367
374
|
|
|
368
|
-
Sometimes you may want to use a Handlebars Object you have already modified before, or you may want to use
|
|
375
|
+
Sometimes you may want to use a Handlebars Object you have already modified before, or you may want to use multiple discrete instances of Handlebars. In this case you can pass you custom Handlebars instance to the init function to use it instead of the generic Handlebars object like so:
|
|
369
376
|
|
|
370
377
|
```javascript
|
|
371
378
|
const HandlebarsModified = require('handlebars');
|
|
@@ -373,7 +380,7 @@ HandlebarsModified.registerHelper('foo', function() { return 'what you want' });
|
|
|
373
380
|
HandlebarsI18n.init(HandlebarsModified);
|
|
374
381
|
```
|
|
375
382
|
|
|
376
|
-
HandlebarsI18n will have
|
|
383
|
+
HandlebarsI18n will have your previously defined method **foo()** by now.
|
|
377
384
|
|
|
378
385
|
|
|
379
386
|
## Note
|
|
@@ -114,7 +114,7 @@ describe('handlebars-i18n Test', function() {
|
|
|
114
114
|
// -- Tests for function __ -- //
|
|
115
115
|
|
|
116
116
|
it('expecting __ to throw error when called with no parameter', function() {
|
|
117
|
-
expect(function() { hI18n.helpers.__() }).to.throw(
|
|
117
|
+
expect(function() { hI18n.helpers.__() }).to.throw();
|
|
118
118
|
});
|
|
119
119
|
|
|
120
120
|
it('function __ should return a SafeString object with property "string" where "string" returns the first argument given to __', function() {
|
package/.idea/.name
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
handlebars-i18n
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<module type="WEB_MODULE" version="4">
|
|
3
|
-
<component name="NewModuleRootManager">
|
|
4
|
-
<content url="file://$MODULE_DIR$" />
|
|
5
|
-
<orderEntry type="inheritedJdk" />
|
|
6
|
-
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
-
</component>
|
|
8
|
-
</module>
|
package/.idea/misc.xml
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
|
4
|
-
<OptionsSetting value="true" id="Add" />
|
|
5
|
-
<OptionsSetting value="true" id="Remove" />
|
|
6
|
-
<OptionsSetting value="true" id="Checkout" />
|
|
7
|
-
<OptionsSetting value="true" id="Update" />
|
|
8
|
-
<OptionsSetting value="true" id="Status" />
|
|
9
|
-
<OptionsSetting value="true" id="Edit" />
|
|
10
|
-
<ConfirmationsSetting value="0" id="Add" />
|
|
11
|
-
<ConfirmationsSetting value="0" id="Remove" />
|
|
12
|
-
</component>
|
|
13
|
-
<component name="ProjectRootManager" version="2" />
|
|
14
|
-
</project>
|
package/.idea/modules.xml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<project version="4">
|
|
3
|
-
<component name="ProjectModuleManager">
|
|
4
|
-
<modules>
|
|
5
|
-
<module fileurl="file://$PROJECT_DIR$/.idea/handlebars-i18n.iml" filepath="$PROJECT_DIR$/.idea/handlebars-i18n.iml" />
|
|
6
|
-
</modules>
|
|
7
|
-
</component>
|
|
8
|
-
</project>
|
package/.idea/vcs.xml
DELETED
package/.idea/watcherTasks.xml
DELETED