Skip to content

Commit cf9212f

Browse files
authored
Merge pull request #88 from fabscale/fn/update-dev-dependencies
Update dev dependencies
2 parents a446221 + 5012765 commit cf9212f

File tree

10 files changed

+687
-457
lines changed

10 files changed

+687
-457
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"eslint-plugin-prettier": "~4.0.0",
1919
"prettier": "~2.4.1",
2020
"release-it": "~14.11.5",
21-
"release-it-lerna-changelog": "~3.1.0",
21+
"release-it-lerna-changelog": "~4.0.1",
2222
"release-it-yarn-workspaces": "~2.0.1"
2323
},
2424
"engines": {
@@ -40,7 +40,7 @@
4040
"npm": false
4141
},
4242
"volta": {
43-
"node": "14.16.1",
44-
"yarn": "1.22.10"
43+
"node": "16.13.0",
44+
"yarn": "1.22.17"
4545
}
4646
}

packages/ember-l10n/addon/utils/plural-factory.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
const PLURAL_FORMS = ['zero', 'one', 'two', 'few', 'many', 'other'];
22

3+
const ALIAS_LOCALES = {
4+
fr: 'pt',
5+
};
6+
37
export class PluralFactory {
48
locale;
59
pluralRules;
610
pluralForms;
711

812
constructor(locale) {
913
this.locale = locale;
10-
this.pluralRules = new Intl.PluralRules(locale);
14+
15+
let aliasLocale = ALIAS_LOCALES[locale];
16+
17+
this.pluralRules = new Intl.PluralRules(aliasLocale || locale);
1118

1219
// We want to ensure a stable sorting
1320
// As this could be in any order, but gettext will try to keep a stable ordering from few->many

packages/ember-l10n/package.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
"devDependencies": {
4444
"@ember-gettext/gettext-parser": "0.6.0",
4545
"@ember/optional-features": "~2.0.0",
46-
"@ember/test-helpers": "~2.4.2",
47-
"@embroider/test-setup": "~0.45.0",
46+
"@ember/test-helpers": "~2.5.0",
47+
"@embroider/test-setup": "~0.47.1",
4848
"broccoli-asset-rev": "~3.0.0",
4949
"ember-auto-import": "~2.2.0",
5050
"ember-cli": "~3.28.0",
@@ -56,20 +56,20 @@
5656
"ember-export-application-global": "~2.0.1",
5757
"ember-load-initializers": "~2.1.2",
5858
"ember-maybe-import-regenerator": "~1.0.0",
59-
"ember-page-title": "~6.2.2",
59+
"ember-page-title": "~7.0.0",
6060
"ember-qunit": "~5.1.4",
6161
"ember-resolver": "~8.0.2",
6262
"ember-source": "~3.28.0",
6363
"ember-source-channel-url": "~3.0.0",
64-
"ember-template-lint": "~3.8.0",
64+
"ember-template-lint": "~3.11.0",
6565
"ember-try": "~1.4.0",
6666
"eslint-plugin-ember": "~10.5.4",
67-
"eslint-plugin-qunit": "^6.2.0",
67+
"eslint-plugin-qunit": "^7.0.0",
6868
"loader.js": "~4.7.0",
6969
"npm-run-all": "~4.1.5",
7070
"qunit": "~2.17.2",
7171
"qunit-dom": "~2.0.0",
72-
"webpack": "~5.56.1"
72+
"webpack": "~5.61.0"
7373
},
7474
"engines": {
7575
"node": "12.* || 14.* || >= 16"

packages/ember-l10n/tests/acceptance/l10n-test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ module('Acceptance | l10n', function (hooks) {
99
test('it works', async function (assert) {
1010
await visit('/');
1111

12-
assert.equal(currentURL(), '/');
12+
assert.strictEqual(currentURL(), '/');
1313

1414
let l10n = this.owner.lookup('service:l10n');
1515

16-
assert.equal(l10n.locale, 'en', 'locale is en initially');
16+
assert.strictEqual(l10n.locale, 'en', 'locale is en initially');
1717
assert.dom(document.documentElement).hasAttribute('lang', 'en');
1818
assert.dom('[data-test-message]').hasText('Hello world!');
1919

2020
await click('[data-test-locale-de]');
2121

22-
assert.equal(l10n.locale, 'de', 'locale is de');
22+
assert.strictEqual(l10n.locale, 'de', 'locale is de');
2323
assert.dom(document.documentElement).hasAttribute('lang', 'de');
2424
assert.dom('[data-test-message]').hasText('Hallo Welt!');
2525
});

packages/ember-l10n/tests/unit/services/l10n-test.js

+60-51
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ module('Unit | Service | l10n', function (hooks) {
1616
test('it works without a locale loaded', async function (assert) {
1717
let l10n = this.owner.lookup('service:l10n');
1818

19-
assert.equal(l10n.locale, 'en', 'locale is correct');
19+
assert.strictEqual(l10n.locale, 'en', 'locale is correct');
2020

21-
assert.equal(l10n.t('test thingy'), 'test thingy');
22-
assert.equal(
21+
assert.strictEqual(l10n.t('test thingy'), 'test thingy');
22+
assert.strictEqual(
2323
l10n.t('My name is {{name}}.', { name: 'john doe' }),
2424
'My name is john doe.'
2525
);
26-
assert.equal(
26+
assert.strictEqual(
2727
l10n.n(
2828
'My name is {{name}} {{count}}.',
2929
'my names are {{name}} {{count}}.',
@@ -44,14 +44,14 @@ module('Unit | Service | l10n', function (hooks) {
4444

4545
await l10n.setLocale('en');
4646

47-
assert.equal(l10n.locale, 'en', 'locale is correct');
47+
assert.strictEqual(l10n.locale, 'en', 'locale is correct');
4848

49-
assert.equal(l10n.t('test thingy'), 'test thingy');
50-
assert.equal(
49+
assert.strictEqual(l10n.t('test thingy'), 'test thingy');
50+
assert.strictEqual(
5151
l10n.t('My name is {{name}}.', { name: 'john doe' }),
5252
'My name is john doe.'
5353
);
54-
assert.equal(
54+
assert.strictEqual(
5555
l10n.n(
5656
'My name is {{name}} {{count}}.',
5757
'my names are {{name}} {{count}}.',
@@ -63,14 +63,14 @@ module('Unit | Service | l10n', function (hooks) {
6363

6464
await l10n.setLocale('de');
6565

66-
assert.equal(l10n.locale, 'de', 'locale is correct');
66+
assert.strictEqual(l10n.locale, 'de', 'locale is correct');
6767

68-
assert.equal(l10n.t('test thingy'), 'test thingy');
69-
assert.equal(
68+
assert.strictEqual(l10n.t('test thingy'), 'test thingy');
69+
assert.strictEqual(
7070
l10n.t('My name is {{name}}.', { name: 'john doe' }),
7171
'Mein Name ist john doe.'
7272
);
73-
assert.equal(
73+
assert.strictEqual(
7474
l10n.n(
7575
'My name is {{name}} {{count}}.',
7676
'my names are {{name}} {{count}}.',
@@ -83,9 +83,9 @@ module('Unit | Service | l10n', function (hooks) {
8383
// Change back
8484
await l10n.setLocale('en');
8585

86-
assert.equal(l10n.locale, 'en', 'locale is correct');
86+
assert.strictEqual(l10n.locale, 'en', 'locale is correct');
8787

88-
assert.equal(
88+
assert.strictEqual(
8989
l10n.t('My name is {{name}}.', { name: 'john doe' }),
9090
'My name is john doe.'
9191
);
@@ -96,18 +96,18 @@ module('Unit | Service | l10n', function (hooks) {
9696

9797
let promise = l10n.setLocale('ko');
9898

99-
assert.equal(l10n.locale, 'en', 'locale is not yet updated');
99+
assert.strictEqual(l10n.locale, 'en', 'locale is not yet updated');
100100

101-
assert.equal(
101+
assert.strictEqual(
102102
l10n.t('My name is {{name}}.', { name: 'john doe' }),
103103
'My name is john doe.'
104104
);
105105

106106
await promise;
107107

108-
assert.equal(l10n.locale, 'ko', 'locale is updated');
108+
assert.strictEqual(l10n.locale, 'ko', 'locale is updated');
109109

110-
assert.equal(
110+
assert.strictEqual(
111111
l10n.t('My name is {{name}}.', { name: 'john doe' }),
112112
'내 이름은 john doe.'
113113
);
@@ -125,14 +125,14 @@ module('Unit | Service | l10n', function (hooks) {
125125
await l10n.setLocale('de');
126126
} catch (error) {
127127
assert.step('error is thrown');
128-
assert.equal(
128+
assert.strictEqual(
129129
error.message,
130130
'Assertion Failed: ember-l10n: Cannot find locale file path for locale "de"',
131131
'error is correct'
132132
);
133133
}
134134

135-
assert.equal(l10n.locale, 'en', 'locale is not updated');
135+
assert.strictEqual(l10n.locale, 'en', 'locale is not updated');
136136

137137
assert.verifySteps(['error is thrown']);
138138
});
@@ -151,14 +151,14 @@ module('Unit | Service | l10n', function (hooks) {
151151
await l10n.setLocale('de');
152152
} catch (error) {
153153
assert.step('error is thrown');
154-
assert.equal(
154+
assert.strictEqual(
155155
error.message,
156156
'TEST error cannot load /assets/locales/de.json',
157157
'error is correct'
158158
);
159159
}
160160

161-
assert.equal(l10n.locale, 'en', 'locale is not updated');
161+
assert.strictEqual(l10n.locale, 'en', 'locale is not updated');
162162

163163
assert.verifySteps(['error is thrown']);
164164
});
@@ -173,9 +173,9 @@ module('Unit | Service | l10n', function (hooks) {
173173
});
174174
mockLocale(l10n, { 'test thingy': 'test 2' }, 'test context');
175175

176-
assert.equal(l10n.t('test thingy'), 'test 1');
177-
assert.equal(l10n.t('test thingy', {}, 'test context'), 'test 2');
178-
assert.equal(
176+
assert.strictEqual(l10n.t('test thingy'), 'test 1');
177+
assert.strictEqual(l10n.t('test thingy', {}, 'test context'), 'test 2');
178+
assert.strictEqual(
179179
l10n.t('My name is {{name}}.', { name: 'john doe' }),
180180
'Mein Name ist john doe.'
181181
);
@@ -190,9 +190,9 @@ module('Unit | Service | l10n', function (hooks) {
190190
});
191191
mockLocale(l10n, { 'test thingy': 'test 2' }, 'test context');
192192

193-
assert.equal(l10n.tVar('test thingy'), 'test 1');
194-
assert.equal(l10n.tVar('test thingy', {}, 'test context'), 'test 2');
195-
assert.equal(
193+
assert.strictEqual(l10n.tVar('test thingy'), 'test 1');
194+
assert.strictEqual(l10n.tVar('test thingy', {}, 'test context'), 'test 2');
195+
assert.strictEqual(
196196
l10n.tVar('My name is {{name}}.', { name: 'john doe' }),
197197
'Mein Name ist john doe.'
198198
);
@@ -218,7 +218,7 @@ module('Unit | Service | l10n', function (hooks) {
218218
'test context'
219219
);
220220

221-
assert.equal(
221+
assert.strictEqual(
222222
l10n.n(
223223
'My name is {{name}} {{count}}.',
224224
'my names are {{name}} {{count}}.',
@@ -228,7 +228,7 @@ module('Unit | Service | l10n', function (hooks) {
228228
'Mein Name ist john doe 1.'
229229
);
230230

231-
assert.equal(
231+
assert.strictEqual(
232232
l10n.n(
233233
'My name is {{name}} {{count}}.',
234234
'my names are {{name}} {{count}}.',
@@ -260,7 +260,7 @@ module('Unit | Service | l10n', function (hooks) {
260260
'test context'
261261
);
262262

263-
assert.equal(
263+
assert.strictEqual(
264264
l10n.nVar(
265265
'My name is {{name}} {{count}}.',
266266
'my names are {{name}} {{count}}.',
@@ -270,7 +270,7 @@ module('Unit | Service | l10n', function (hooks) {
270270
'Mein Name ist john doe 1.'
271271
);
272272

273-
assert.equal(
273+
assert.strictEqual(
274274
l10n.nVar(
275275
'My name is {{name}} {{count}}.',
276276
'my names are {{name}} {{count}}.',
@@ -297,17 +297,17 @@ module('Unit | Service | l10n', function (hooks) {
297297
{ locale: 'de' }
298298
);
299299

300-
assert.equal(
300+
assert.strictEqual(
301301
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 0),
302302
'Ich habe 0 Punkte.'
303303
);
304304

305-
assert.equal(
305+
assert.strictEqual(
306306
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 1),
307307
'Ich habe 1 Punkt.'
308308
);
309309

310-
assert.equal(
310+
assert.strictEqual(
311311
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 2),
312312
'Ich habe 2 Punkte.'
313313
);
@@ -325,17 +325,17 @@ module('Unit | Service | l10n', function (hooks) {
325325
{ locale: 'de' }
326326
);
327327

328-
assert.equal(
328+
assert.strictEqual(
329329
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 0),
330330
'I have 0 points.'
331331
);
332332

333-
assert.equal(
333+
assert.strictEqual(
334334
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 1),
335335
'I have 1 point.'
336336
);
337337

338-
assert.equal(
338+
assert.strictEqual(
339339
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 2),
340340
'I have 2 points.'
341341
);
@@ -353,17 +353,17 @@ module('Unit | Service | l10n', function (hooks) {
353353
{ locale: 'ko' }
354354
);
355355

356-
assert.equal(
356+
assert.strictEqual(
357357
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 0),
358358
'XXX YYY 0.'
359359
);
360360

361-
assert.equal(
361+
assert.strictEqual(
362362
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 1),
363363
'XXX YYY 1.'
364364
);
365365

366-
assert.equal(
366+
assert.strictEqual(
367367
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 2),
368368
'XXX YYY 2.'
369369
);
@@ -381,17 +381,17 @@ module('Unit | Service | l10n', function (hooks) {
381381
{ locale: 'ko' }
382382
);
383383

384-
assert.equal(
384+
assert.strictEqual(
385385
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 0),
386386
'I have 0 points.'
387387
);
388388

389-
assert.equal(
389+
assert.strictEqual(
390390
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 1),
391391
'I have 1 point.'
392392
);
393393

394-
assert.equal(
394+
assert.strictEqual(
395395
l10n.n('I have {{count}} point.', 'I have {{count}} points.', 2),
396396
'I have 2 points.'
397397
);
@@ -409,13 +409,22 @@ module('Unit | Service | l10n', function (hooks) {
409409
{ locale: 'ar-eg' }
410410
);
411411

412-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 0), 'zero');
413-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 1), 'one');
414-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 2), 'two');
415-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 4), 'few');
416-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 8), 'few');
417-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 15), 'many');
418-
assert.equal(l10n.n('{{count}} item', '{{count}} items', 100), 'other');
412+
assert.strictEqual(
413+
l10n.n('{{count}} item', '{{count}} items', 0),
414+
'zero'
415+
);
416+
assert.strictEqual(l10n.n('{{count}} item', '{{count}} items', 1), 'one');
417+
assert.strictEqual(l10n.n('{{count}} item', '{{count}} items', 2), 'two');
418+
assert.strictEqual(l10n.n('{{count}} item', '{{count}} items', 4), 'few');
419+
assert.strictEqual(l10n.n('{{count}} item', '{{count}} items', 8), 'few');
420+
assert.strictEqual(
421+
l10n.n('{{count}} item', '{{count}} items', 15),
422+
'many'
423+
);
424+
assert.strictEqual(
425+
l10n.n('{{count}} item', '{{count}} items', 100),
426+
'other'
427+
);
419428
});
420429

421430
test('it asserts if trying to use missing plural form (de)', async function (assert) {

0 commit comments

Comments
 (0)