handlebars-i18n 1.6.4 → 1.7.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.
@@ -20,21 +20,21 @@ jobs:
20
20
  run: |
21
21
  npm i
22
22
  npm run test
23
- semantic-release:
24
- if: github.ref == 'refs/heads/master'
25
- name: Semantic Release
26
- runs-on: ubuntu-latest
27
- needs: build
28
- steps:
29
- - uses: actions/checkout@v3
30
- with:
31
- token: ${{ secrets.GITHUB_TOKEN }}
32
- - name: Semantic Release
33
- uses: cycjimmy/semantic-release-action@v3
34
- with:
35
- extra_plugins: |
36
- @semantic-release/changelog
37
- @semantic-release/git
23
+ # semantic-release:
24
+ # if: github.ref == 'refs/heads/master'
25
+ # name: Semantic Release
26
+ # runs-on: ubuntu-latest
27
+ # needs: build
28
+ # steps:
29
+ # - uses: actions/checkout@v3
30
+ # with:
31
+ # token: ${{ secrets.GITHUB_TOKEN }}
32
+ # - name: Semantic Release
33
+ # uses: cycjimmy/semantic-release-action@v3
34
+ # with:
35
+ # extra_plugins: |
36
+ # @semantic-release/changelog
37
+ # @semantic-release/git
38
38
  env:
39
39
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40
40
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
package/LICENSE CHANGED
@@ -1,6 +1,7 @@
1
1
  MIT License
2
+ for handlebars-i18n
2
3
 
3
- Copyright (c) 2021 Florian Walzel
4
+ Copyright (c) 2020-24 Florian Walzel
4
5
 
5
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
7
  of this software and associated documentation files (the "Software"), to deal
@@ -5,17 +5,178 @@ type Handlebars = typeof handlebars;
5
5
 
6
6
  type CustomFormatName = string;
7
7
 
8
+ type style = "decimal" | "currency" | "percent" | "unit";
9
+
10
+ type localeMatcher = "lookup" | "best fit";
11
+
12
+ type currencyDisplay = "code" | "symbol" | "narrowSymbol" | "name";
13
+
14
+ type currencySign = "standard" | "accounting";
15
+
16
+ type unitDisplay = "short" | "narrow" | "long";
17
+
18
+ type roundingPriority = "auto" | "morePrecision" | "lessPrecision";
19
+
20
+ type roundingMode =
21
+ | "ceil"
22
+ | "floor"
23
+ | "expand"
24
+ | "trunc"
25
+ | "halfCeil"
26
+ | "halfFloor"
27
+ | "halfExpand"
28
+ | "halfTrunc"
29
+ | "halfEven";
30
+
31
+ type trailingZeroDisplay = "auto" | "stripIfInteger";
32
+
33
+ type notation = "standard" | "scientific" | "engineering" | "compact";
34
+
35
+ type compactDisplay = "short" | "long";
36
+
37
+ type useGrouping = "always" | "auto" | "min2" | true | false;
38
+
39
+ type signDisplay = "auto" | "always" | "exceptZero" | "negative" | "never";
40
+
41
+ type numberingSystem =
42
+ | "adlm"
43
+ | "ahom"
44
+ | "arab"
45
+ | "arabext"
46
+ | "armn"
47
+ | "armnlow"
48
+ | "bali"
49
+ | "beng"
50
+ | "bhks"
51
+ | "brah"
52
+ | "cakm"
53
+ | "cham"
54
+ | "cyrl"
55
+ | "deva"
56
+ | "diak"
57
+ | "ethi"
58
+ | "finance"
59
+ | "fullwide"
60
+ | "geor"
61
+ | "gonm"
62
+ | "grek"
63
+ | "greklow"
64
+ | "gujr"
65
+ | "guru"
66
+ | "hanidays"
67
+ | "hanidec"
68
+ | "hans"
69
+ | "hansfin"
70
+ | "hant"
71
+ | "hantfin"
72
+ | "hebr"
73
+ | "hmng"
74
+ | "hmnp"
75
+ | "java"
76
+ | "jpan"
77
+ | "jpanfin"
78
+ | "jpanyear"
79
+ | "kali"
80
+ | "knda"
81
+ | "lana"
82
+ | "lanatham"
83
+ | "laoo"
84
+ | "latn"
85
+ | "lepc"
86
+ | "limb"
87
+ | "mathbold"
88
+ | "mathdbl"
89
+ | "mathmono"
90
+ | "mathsanb"
91
+ | "mathsans"
92
+ | "mlym"
93
+ | "modi"
94
+ | "mong"
95
+ | "mroo"
96
+ | "mtei"
97
+ | "mymr"
98
+ | "mymrshan"
99
+ | "mymrtlng"
100
+ | "native"
101
+ | "newa"
102
+ | "nkoo"
103
+ | "olck"
104
+ | "orya"
105
+ | "osma"
106
+ | "rohg"
107
+ | "roman"
108
+ | "romanlow"
109
+ | "saur"
110
+ | "segment"
111
+ | "shrd"
112
+ | "sind"
113
+ | "sinh"
114
+ | "sora"
115
+ | "sund"
116
+ | "takr"
117
+ | "talu"
118
+ | "taml"
119
+ | "tamldec"
120
+ | "telu"
121
+ | "thai"
122
+ | "tibt"
123
+ | "tirh"
124
+ | "traditio"
125
+ | "vaii"
126
+ | "wara"
127
+ | "wcho";
128
+
129
+
8
130
  export type NumberFormatConfiguration = [
9
131
  "all" | LocaleCode | LanguageCode,
10
132
  "NumberFormat",
11
- { minimumFractionDigits: number },
133
+ {
134
+ localeMatcher?: localeMatcher,
135
+ style?: style,
136
+ numberingSystem?: numberingSystem,
137
+ unitDisplay?: unitDisplay,
138
+ roundingPriority?: roundingPriority,
139
+ roundingMode?: roundingMode,
140
+ trailingZeroDisplay?: trailingZeroDisplay,
141
+ notation?: notation;
142
+ compactDisplay?: compactDisplay,
143
+ useGrouping?: useGrouping,
144
+ signDisplay?: signDisplay,
145
+ minimumIntegerDigits?: number,
146
+ maximumFractionDigits?: number,
147
+ minimumFractionDigits?: number,
148
+ maximumSignificantDigits?: number,
149
+ minimumSignificantDigits?: number,
150
+ roundingIncrement?: number
151
+ },
12
152
  CustomFormatName?
13
153
  ];
14
154
 
15
155
  export type PriceFormatConfiguration = [
16
156
  "all" | LocaleCode | LanguageCode,
17
157
  "PriceFormat",
18
- { currency: CurrencyCode },
158
+ {
159
+ currency: CurrencyCode
160
+ currencyDisplay?: currencyDisplay,
161
+ currencySign?: currencySign,
162
+ localeMatcher?: localeMatcher,
163
+ style?: style,
164
+ numberingSystem?: numberingSystem,
165
+ unitDisplay?: unitDisplay,
166
+ roundingPriority?: roundingPriority,
167
+ roundingMode?: roundingMode,
168
+ trailingZeroDisplay?: trailingZeroDisplay,
169
+ notation?: notation;
170
+ compactDisplay?: compactDisplay,
171
+ useGrouping?: useGrouping,
172
+ signDisplay?: signDisplay,
173
+ minimumIntegerDigits?: number,
174
+ maximumFractionDigits?: number,
175
+ minimumFractionDigits?: number,
176
+ maximumSignificantDigits?: number,
177
+ minimumSignificantDigits?: number,
178
+ roundingIncrement?: number
179
+ },
19
180
  CustomFormatName?
20
181
  ];
21
182
 
@@ -36,7 +197,24 @@ export type DateTimeFormatConfiguration = [
36
197
  CustomFormatName?
37
198
  ];
38
199
 
39
- type Configuration = NumberFormatConfiguration | PriceFormatConfiguration | DateTimeFormatConfiguration;
200
+
201
+ type DateRelFormatOptions = {
202
+ localeMatcher?: localeMatcher,
203
+ numberingSystem?: numberingSystem,
204
+ numeric?: "always" | "auto",
205
+ style?: "long" | "short" | "narrow",
206
+ unit?: "second" | "minute" | "hour" | "day" | "week" | "month" | "year"
207
+ }
208
+
209
+ export type RelativeTimeFormatConfiguration = [
210
+ "all" | LocaleCode | LanguageCode,
211
+ "RelativeTimeFormat",
212
+ DateRelFormatOptions,
213
+ CustomFormatName?
214
+ ];
215
+
216
+
217
+ type Configuration = NumberFormatConfiguration | PriceFormatConfiguration | DateTimeFormatConfiguration | RelativeTimeFormatConfiguration;
40
218
 
41
219
  export function init(overrideHndlbrs?: Handlebars, overrideI18n?: i18n.i18n): Handlebars;
42
220
  export function reset(): true;
@@ -59,6 +237,12 @@ export function configure(
59
237
  options: DateTimeFormatConfiguration[2],
60
238
  customFormatname: DateTimeFormatConfiguration[3]
61
239
  ): boolean;
240
+ export function configure(
241
+ lang: RelativeTimeFormatConfiguration[0],
242
+ typeOfFormat: RelativeTimeFormatConfiguration[1],
243
+ options: RelativeTimeFormatConfiguration[2],
244
+ customFormatname: RelativeTimeFormatConfiguration[3]
245
+ ): boolean;
62
246
 
63
247
  // #region TimeZone type
64
248
  export type TimeZone =