@prezly/theme-kit-intl 10.5.0 → 10.5.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/build/formatting/messages/lib.cjs +0 -2
- package/build/formatting/messages/lib.mjs +0 -1
- package/build/formatting/messages/lib.test.cjs +2 -5
- package/build/formatting/messages/lib.test.mjs +2 -4
- package/build/locales/Locale.test.cjs +0 -3
- package/build/locales/Locale.test.mjs +0 -3
- package/package.json +8 -7
|
@@ -11,8 +11,6 @@ exports.tokenizeMessage = tokenizeMessage;
|
|
|
11
11
|
var _index = require("../../locales/index.cjs");
|
|
12
12
|
var _index2 = require("../../utils/index.cjs");
|
|
13
13
|
var _types = require("./types.cjs");
|
|
14
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
15
|
-
|
|
16
14
|
var getPluralRules = exports.getPluralRules = (0, _index2.withCache)(locale => new Intl.PluralRules(_index.Locale.from(locale).isoCode));
|
|
17
15
|
function formatMessageFragment(locale, _ref, dictionary) {
|
|
18
16
|
var _ref2, _dictionary$id;
|
|
@@ -2,10 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _index = require("../../locales/index.cjs");
|
|
4
4
|
var _lib = require("./lib.cjs");
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
6
|
-
|
|
7
5
|
var I18N = {
|
|
8
|
-
|
|
6
|
+
'hello.world': [{
|
|
9
7
|
type: 0,
|
|
10
8
|
value: '¡Hola, '
|
|
11
9
|
}, {
|
|
@@ -15,13 +13,12 @@ var I18N = {
|
|
|
15
13
|
type: 0,
|
|
16
14
|
value: '!'
|
|
17
15
|
}],
|
|
18
|
-
|
|
16
|
+
'images.count': [{
|
|
19
17
|
type: 0,
|
|
20
18
|
value: 'Images: '
|
|
21
19
|
}, {
|
|
22
20
|
offset: 0,
|
|
23
21
|
options: {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
25
22
|
'=0': {
|
|
26
23
|
value: [{
|
|
27
24
|
type: 0,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-use-before-define */
|
|
2
1
|
import { Locale, supportedLocales } from "../../locales/index.mjs";
|
|
3
2
|
import { formatMessageFragment, formatMessageString, getPluralRules, parseMessage, tokenizeMessage } from "./lib.mjs";
|
|
4
3
|
var I18N = {
|
|
5
|
-
|
|
4
|
+
'hello.world': [{
|
|
6
5
|
type: 0,
|
|
7
6
|
value: '¡Hola, '
|
|
8
7
|
}, {
|
|
@@ -12,13 +11,12 @@ var I18N = {
|
|
|
12
11
|
type: 0,
|
|
13
12
|
value: '!'
|
|
14
13
|
}],
|
|
15
|
-
|
|
14
|
+
'images.count': [{
|
|
16
15
|
type: 0,
|
|
17
16
|
value: 'Images: '
|
|
18
17
|
}, {
|
|
19
18
|
offset: 0,
|
|
20
19
|
options: {
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
22
20
|
'=0': {
|
|
23
21
|
value: [{
|
|
24
22
|
type: 0,
|
|
@@ -71,11 +71,8 @@ describe('Locale', () => {
|
|
|
71
71
|
expect(_Locale.Locale.from('EN_US').region).toBe('US');
|
|
72
72
|
});
|
|
73
73
|
it('should check if two locales are equal', () => {
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
75
74
|
var en_US = _Locale.Locale.from('en-US');
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
77
75
|
var en_US2 = _Locale.Locale.from('en-US');
|
|
78
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
79
76
|
var de_DE = _Locale.Locale.from('de-DE');
|
|
80
77
|
expect(_Locale.Locale.isEqual(en_US, en_US2)).toBe(true);
|
|
81
78
|
expect(_Locale.Locale.isEqual(en_US2, en_US)).toBe(true);
|
|
@@ -69,11 +69,8 @@ describe('Locale', () => {
|
|
|
69
69
|
expect(Locale.from('EN_US').region).toBe('US');
|
|
70
70
|
});
|
|
71
71
|
it('should check if two locales are equal', () => {
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
73
72
|
var en_US = Locale.from('en-US');
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
75
73
|
var en_US2 = Locale.from('en-US');
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
77
74
|
var de_DE = Locale.from('de-DE');
|
|
78
75
|
expect(Locale.isEqual(en_US, en_US2)).toBe(true);
|
|
79
76
|
expect(Locale.isEqual(en_US2, en_US)).toBe(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-intl",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.1",
|
|
4
4
|
"description": "Translations for Prezly themes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.mjs",
|
|
@@ -28,17 +28,18 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"clean": "rimraf build/* *.tsbuildinfo",
|
|
31
|
-
"prebuild": "pnpm clean && pnpm build:locales && pnpm
|
|
31
|
+
"prebuild": "pnpm clean && pnpm build:locales && pnpm format",
|
|
32
32
|
"build": "pnpm intl:compile && pnpm build:types && pnpm build:esm && pnpm build:cjs",
|
|
33
|
-
"build:locales": "node ./build-locales.cjs > src/locales/supportedLocales.ts &&
|
|
33
|
+
"build:locales": "node ./build-locales.cjs > src/locales/supportedLocales.ts && biome format --write ./src/locales/supportedLocales.ts",
|
|
34
34
|
"build:types": "tsc --project .",
|
|
35
35
|
"build:esm": "babel --config-file=../../babel.esm.json src/ --extensions=.ts --out-dir=build/ --out-file-extension=.mjs",
|
|
36
36
|
"build:cjs": "babel --config-file=../../babel.cjs.json src/ --extensions=.ts --out-dir=build/ --out-file-extension=.cjs",
|
|
37
37
|
"watch": "tsc --watch --preserveWatchOutput --project .",
|
|
38
|
-
"lint": "
|
|
38
|
+
"lint": "biome lint ./src/",
|
|
39
|
+
"lint:fix": "biome lint --write ./src/",
|
|
40
|
+
"format": "biome format ./src/",
|
|
41
|
+
"format:fix": "biome format --write ./src/",
|
|
39
42
|
"typecheck": "tsc --noEmit --emitDeclarationOnly false --project .",
|
|
40
|
-
"prettier:check": "prettier --check './src/**/*.{ts,js}'",
|
|
41
|
-
"prettier:fix": "prettier --write './src/**/*.{ts,js}'",
|
|
42
43
|
"test": "pnpm test:unit && pnpm test:build",
|
|
43
44
|
"test:unit": "jest",
|
|
44
45
|
"test:build": "pnpm test:build:i18n && pnpm test:build:i18n:dist && pnpm test:build:cjs && pnpm test:build:esm && pnpm test:build:types",
|
|
@@ -73,5 +74,5 @@
|
|
|
73
74
|
"publishConfig": {
|
|
74
75
|
"access": "public"
|
|
75
76
|
},
|
|
76
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "92943e87b4ec5a60d9b04c63f2404075d6864420"
|
|
77
78
|
}
|