intl-template 1.0.0-alpha.5 → 1.0.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/dist/intl.js CHANGED
@@ -1,168 +1,132 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
6
+ var __toCommonJS = (from) => {
7
+ var entry = __moduleCache.get(from), desc;
8
+ if (entry)
9
+ return entry;
10
+ entry = __defProp({}, "__esModule", { value: true });
11
+ if (from && typeof from === "object" || typeof from === "function")
12
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
+ get: () => from[key],
14
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
+ }));
16
+ __moduleCache.set(from, entry);
17
+ return entry;
5
18
  };
6
- var _Translation_templates;
7
- export class Runes extends Array {
8
- toString() {
9
- return this.join("");
19
+ var __export = (target, all) => {
20
+ for (var name in all)
21
+ __defProp(target, name, {
22
+ get: all[name],
23
+ enumerable: true,
24
+ configurable: true,
25
+ set: (newValue) => all[name] = () => newValue
26
+ });
27
+ };
28
+
29
+ // src/intl.js
30
+ var exports_intl = {};
31
+ __export(exports_intl, {
32
+ parseTemplate: () => parseTemplate,
33
+ l10n: () => l10n,
34
+ default: () => intl_default,
35
+ Translation: () => Translation,
36
+ Runes: () => Runes
37
+ });
38
+ module.exports = __toCommonJS(exports_intl);
39
+
40
+ class Runes extends Array {
41
+ toString() {
42
+ return this.join("");
43
+ }
44
+ }
45
+ function parseTemplate(templateString) {
46
+ const order = [];
47
+ const template = [];
48
+ const parts = templateString.split(/({\d*})/);
49
+ parts.forEach((part) => {
50
+ if (part.match(/^{\d*}$/)) {
51
+ if (part === "{}") {
52
+ order.push(order.length);
53
+ } else {
54
+ order.push(parseInt(part.slice(1, -1), 10));
55
+ }
56
+ } else {
57
+ template.push(part);
10
58
  }
59
+ });
60
+ return { template, order };
11
61
  }
12
- /**
13
- * Parses a template string and extracts the template parts and order of slots.
14
- * @param {string} templateString - The template string to parse.
15
- * @returns {{ template: string[], order: number[] }}
16
- */
17
- export function parseTemplate(templateString) {
18
- const order = [];
19
- const template = [];
20
- const parts = templateString.split(/({\d*})/);
21
- parts.forEach((part) => {
22
- if (part.match(/^{\d*}$/)) {
23
- if (part === '{}') {
24
- order.push(order.length);
25
- }
26
- else {
27
- // slot with order, e.g. `{2}abc{1}def{0}`
28
- order.push(parseInt(part.slice(1, -1), 10));
29
- }
62
+
63
+ class Translation {
64
+ mode = "react";
65
+ #templates = new Proxy({}, {
66
+ get(templates, locale) {
67
+ return new Proxy(templates[locale] || {}, {
68
+ set(region, key, value) {
69
+ if (typeof value !== "string") {
70
+ throw new Error("Template must be a string.");
71
+ }
72
+ region[key] = parseTemplate(value);
73
+ return true;
30
74
  }
31
- else {
32
- template.push(part);
33
- }
34
- });
35
- return { template, order };
36
- }
37
- /**
38
- * Represents a Translation object that handles string translation based on locale and templates.
39
- */
40
- export class Translation {
41
- constructor(locale) {
42
- /**
43
- * Templates object that stores the translation templates for each locale.
44
- * @type {Proxy}
45
- */
46
- _Translation_templates.set(this, new Proxy({}, {
47
- get(templates, locale) {
48
- return new Proxy(templates[locale] || {}, {
49
- set(region, key, value) {
50
- if (typeof value !== "string") {
51
- throw new Error("Template must be a string.");
52
- }
53
- region[key] = parseTemplate(value);
54
- return true;
55
- }
56
- });
57
- },
58
- set(templates, locale, regionTemplates) {
59
- templates[locale] = Object.entries(regionTemplates).reduce((region, [key, value]) => {
60
- region[key] = parseTemplate(value);
61
- return region;
62
- }, {});
63
- return true;
64
- }
65
- }));
66
- /**
67
- * Translates a string based on the provided locale and strings.
68
- *
69
- * @param {string} locale - The locale to use for translation.
70
- * @param {TemplateStringsArray | string} strings - The string or array of strings to be translated.
71
- * @param {...any} parts - The dynamic parts to be inserted into the translated string.
72
- * @returns {Runes} - The translated string with dynamic parts inserted.
73
- * @throws {Error} - If the length of the template parts does not match the length of the template.
74
- */
75
- this.translate = (locale, strings, ...parts) => {
76
- var _a, _b, _c;
77
- if (typeof strings === "string") {
78
- strings = strings.split("{}");
79
- }
80
- const key = strings.join("{}");
81
- let translation = (_a = __classPrivateFieldGet(this, _Translation_templates, "f")) === null || _a === void 0 ? void 0 : _a[locale];
82
- if (!translation) {
83
- translation = __classPrivateFieldGet(this, _Translation_templates, "f")[this.defaultLocale];
84
- }
85
- let { template, order } = (translation === null || translation === void 0 ? void 0 : translation[key]) || {};
86
- if (!template) {
87
- if (((_c = (_b = import.meta) === null || _b === void 0 ? void 0 : _b.env) === null || _c === void 0 ? void 0 : _c.MODE) === "development") {
88
- console.warn(`not match translate key, ${key}`, { translation, locale, strings, parts });
89
- }
90
- template = strings.slice();
91
- order = parts.map((_, i) => i);
92
- }
93
- if (parts.length !== template.length - 1) {
94
- throw new Error(`translate template parts length does not match. locale: ${locale}, key: ${key}`);
95
- }
96
- const runes = template.reduce((runes, template, idx) => {
97
- runes.push(template);
98
- const orderIdx = order[idx];
99
- if (orderIdx >= 0) {
100
- const part = parts[orderIdx];
101
- if (typeof part === "function") {
102
- runes.push(part(locale));
103
- }
104
- else {
105
- runes.push(part);
106
- }
107
- }
108
- return runes;
109
- }, new Runes());
110
- return runes;
111
- };
112
- /**
113
- * Use regex extract template and vars
114
- * @param {*} locale
115
- * @param {*} regexString
116
- * @param {*} matchString
117
- * @returns {Runes}
118
- */
119
- this.translateByRegEx = (locale, regexString, matchString) => {
120
- const { parts, strings } = regexTemplate(regexString, matchString);
121
- return this.translate(locale, strings, ...parts);
122
- };
123
- this.l10n = (strings, ...parts) => {
124
- return translation.translate(this.defaultLocale, strings, ...parts);
125
- };
126
- this.l10nRegExp = (regexString, matchString) => {
127
- return translation.translateByRegEx(this.defaultLocale, regexString, matchString);
128
- };
129
- this.defaultLocale = locale;
75
+ });
76
+ },
77
+ set(templates, locale, regionTemplates) {
78
+ templates[locale] = Object.entries(regionTemplates).reduce((region, [key, value]) => {
79
+ region[key] = parseTemplate(value);
80
+ return region;
81
+ }, {});
82
+ return true;
130
83
  }
131
- get templates() {
132
- return __classPrivateFieldGet(this, _Translation_templates, "f");
84
+ });
85
+ get templates() {
86
+ return this.#templates;
87
+ }
88
+ set templates(value) {
89
+ Object.entries(value).forEach(([locale, regionTemplates]) => {
90
+ this.#templates[locale] = regionTemplates;
91
+ });
92
+ return true;
93
+ }
94
+ translate = (locale, strings, ...parts) => {
95
+ if (typeof strings === "string") {
96
+ strings = strings.split("{}");
133
97
  }
134
- set templates(value) {
135
- Object.entries(value).forEach(([locale, regionTemplates]) => {
136
- __classPrivateFieldGet(this, _Translation_templates, "f")[locale] = regionTemplates;
137
- });
138
- return true;
98
+ const key = strings.join("{}");
99
+ const translation = this.#templates?.[locale];
100
+ let { template, order } = translation?.[key] || {};
101
+ if (!template) {
102
+ if (import.meta?.env?.MODE === "development") {
103
+ console.warn(`not match translate key, ${key}`, { translation, locale, strings, parts });
104
+ }
105
+ template = strings.slice();
106
+ order = parts.map((_, i) => i);
139
107
  }
140
- }
141
- _Translation_templates = new WeakMap();
142
- const translation = new Translation();
143
- export default translation;
144
- export const l10n = translation.l10n;
145
- export const l10nRegExp = translation.l10nRegExp;
146
- /**
147
- * @param {string} regexString
148
- * @param {string} matchString
149
- * @returns {{ strings: Array<string>, parts: Array<string> }}
150
- */
151
- export function regexTemplate(regexString, matchString) {
152
- let parts = [];
153
- const strings = [];
154
- const matches = new RegExp(regexString).exec(matchString);
155
- if (!matches) {
156
- return { parts: [], strings };
108
+ if (parts.length !== template.length - 1) {
109
+ throw new Error(`translate template parts length does not match. locale: ${locale}, key: ${key}`);
157
110
  }
158
- parts = matches.slice(1);
159
- regexString
160
- .split(/(\([^)]+\))/) // split by regex group
161
- .forEach(part => {
162
- if (!part.startsWith("(") || !part.endsWith(")")) {
163
- strings.push(part);
111
+ const runes = template.reduce((runes2, template2, idx) => {
112
+ runes2.push(template2);
113
+ const orderIdx = order[idx];
114
+ if (orderIdx >= 0) {
115
+ const part = parts[orderIdx];
116
+ if (typeof part === "function") {
117
+ runes2.push(part(locale));
118
+ } else {
119
+ runes2.push(part);
164
120
  }
165
- });
166
- return { strings, parts };
121
+ }
122
+ return runes2;
123
+ }, new Runes);
124
+ if (this.mode !== "react") {
125
+ return runes.toString();
126
+ }
127
+ return runes;
128
+ };
167
129
  }
168
- //# sourceMappingURL=intl.js.map
130
+ var translation = new Translation;
131
+ var intl_default = translation;
132
+ var l10n = translation.translate.bind(null, globalThis?.navigator?.language);
package/package.json CHANGED
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "intl-template",
3
- "version": "1.0.0-alpha.5",
3
+ "version": "1.0.0",
4
4
  "description": "l10n tagged template literals",
5
5
  "type": "module",
6
6
  "main": "dist/intl.js",
7
7
  "module": "src/intl.js",
8
8
  "repository": "github:performonkey/intl-template",
9
9
  "scripts": {
10
- "build": "tsc",
11
- "test": "node --test"
10
+ "build": "bun build src/intl.js --outdir=dist --format=cjs"
12
11
  },
13
12
  "keywords": [
14
13
  "i18n",
@@ -16,8 +15,5 @@
16
15
  "tagged template literals"
17
16
  ],
18
17
  "author": "p10y",
19
- "license": "ISC",
20
- "devDependencies": {
21
- "typescript": "^5.0.0"
22
- }
23
- }
18
+ "license": "ISC"
19
+ }
package/src/intl.js CHANGED
@@ -33,9 +33,8 @@ export function parseTemplate(templateString) {
33
33
  * Represents a Translation object that handles string translation based on locale and templates.
34
34
  */
35
35
  export class Translation {
36
- constructor(locale) {
37
- this.defaultLocale = locale
38
- }
36
+ /** @type {"" | "react"} */
37
+ mode = "react"
39
38
 
40
39
  /**
41
40
  * Templates object that stores the translation templates for each locale.
@@ -93,10 +92,7 @@ export class Translation {
93
92
  }
94
93
 
95
94
  const key = strings.join("{}")
96
- let translation = this.#templates?.[locale]
97
- if (!translation) {
98
- translation = this.#templates[this.defaultLocale]
99
- }
95
+ const translation = this.#templates?.[locale]
100
96
  let { template, order } = translation?.[key] || {}
101
97
  if (!template) {
102
98
  if (import.meta?.env?.MODE === "development") {
@@ -126,27 +122,11 @@ export class Translation {
126
122
  return runes
127
123
  }, new Runes())
128
124
 
129
- return runes
130
- }
131
-
132
- /**
133
- * Use regex extract template and vars
134
- * @param {*} locale
135
- * @param {*} regexString
136
- * @param {*} matchString
137
- * @returns {Runes}
138
- */
139
- translateByRegEx = (locale, regexString, matchString) => {
140
- const { parts, strings } = regexTemplate(regexString, matchString)
141
- return this.translate(locale, strings, ...parts);
142
- }
143
-
144
- l10n = (strings, ...parts) => {
145
- return translation.translate(this.defaultLocale, strings, ...parts)
146
- }
125
+ if (this.mode !== "react") {
126
+ return runes.toString()
127
+ }
147
128
 
148
- l10nRegExp = (regexString, matchString) => {
149
- return translation.translateByRegEx(this.defaultLocale, regexString, matchString)
129
+ return runes
150
130
  }
151
131
  }
152
132
 
@@ -154,32 +134,4 @@ const translation = new Translation()
154
134
 
155
135
  export default translation
156
136
 
157
- export const l10n = translation.l10n
158
-
159
- export const l10nRegExp = translation.l10nRegExp
160
-
161
- /**
162
- * @param {string} regexString
163
- * @param {string} matchString
164
- * @returns {{ strings: Array<string>, parts: Array<string> }}
165
- */
166
- export function regexTemplate(regexString, matchString) {
167
- let parts = [];
168
- const strings = [];
169
-
170
- const matches = new RegExp(regexString).exec(matchString)
171
- if (!matches) {
172
- return { parts: [], strings }
173
- }
174
-
175
- parts = matches.slice(1)
176
- regexString
177
- .split(/(\([^)]+\))/) // split by regex group
178
- .forEach(part => {
179
- if (!part.startsWith("(") || !part.endsWith(")")) {
180
- strings.push(part)
181
- }
182
- })
183
-
184
- return { strings, parts };
185
- }
137
+ export const l10n = translation.translate.bind(null, globalThis?.navigator?.language);
package/src/intl.test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import assert from "node:assert"
2
2
  import test from "node:test"
3
- import { Translation, Runes, regexTemplate } from "./intl.js"
3
+ import { Translation, Runes } from "./intl.js"
4
4
 
5
5
  test("template", async (t) => {
6
6
  await t.test("multiple locale template parse", () => {
@@ -124,27 +124,6 @@ test("translation.translate", async (t) => {
124
124
  })
125
125
  })
126
126
 
127
- test("translation.regexTranslate", async (t) => {
128
- await t.test("regexTranslate", () => {
129
- const translation = new Translation("zh-CN")
130
- translation.templates["zh-CN"] = {
131
- "abc {} def {}": "甲乙丙 {1} {0} 丁戊卯",
132
- }
133
-
134
- assert.equal(
135
- translation.regexTranslate("zh-CN", "abc (\\d+) def (\\d+)", "abc 123 def 345").toString(),
136
- "甲乙丙 345 123 丁戊卯"
137
- )
138
- })
139
- })
140
-
141
- test("regexTemplate", async (t) => {
142
- assert.deepEqual(
143
- regexTemplate("(\\d+) def (\\d+)", "123 def 345"),
144
- { strings: ["", " def ", ""], parts: ['123', '345'] }
145
- )
146
- })
147
-
148
127
  test("Runes", async (t) => {
149
128
  assert.equal(
150
129
  new Runes('a', ' b ', 1, 2).toString(),
package/dist/intl.d.ts DELETED
@@ -1,57 +0,0 @@
1
- /**
2
- * Parses a template string and extracts the template parts and order of slots.
3
- * @param {string} templateString - The template string to parse.
4
- * @returns {{ template: string[], order: number[] }}
5
- */
6
- export function parseTemplate(templateString: string): {
7
- template: string[];
8
- order: number[];
9
- };
10
- /**
11
- * @param {string} regexString
12
- * @param {string} matchString
13
- * @returns {{ strings: Array<string>, parts: Array<string> }}
14
- */
15
- export function regexTemplate(regexString: string, matchString: string): {
16
- strings: Array<string>;
17
- parts: Array<string>;
18
- };
19
- export class Runes extends Array<any> {
20
- constructor(arrayLength?: number | undefined);
21
- constructor(arrayLength: number);
22
- constructor(...items: any[]);
23
- }
24
- /**
25
- * Represents a Translation object that handles string translation based on locale and templates.
26
- */
27
- export class Translation {
28
- constructor(locale: any);
29
- defaultLocale: any;
30
- set templates(value: ProxyConstructor);
31
- get templates(): ProxyConstructor;
32
- /**
33
- * Translates a string based on the provided locale and strings.
34
- *
35
- * @param {string} locale - The locale to use for translation.
36
- * @param {TemplateStringsArray | string} strings - The string or array of strings to be translated.
37
- * @param {...any} parts - The dynamic parts to be inserted into the translated string.
38
- * @returns {Runes} - The translated string with dynamic parts inserted.
39
- * @throws {Error} - If the length of the template parts does not match the length of the template.
40
- */
41
- translate: (locale: string, strings: TemplateStringsArray | string, ...parts: any[]) => Runes;
42
- /**
43
- * Use regex extract template and vars
44
- * @param {*} locale
45
- * @param {*} regexString
46
- * @param {*} matchString
47
- * @returns {Runes}
48
- */
49
- translateByRegEx: (locale: any, regexString: any, matchString: any) => Runes;
50
- l10n: (strings: any, ...parts: any[]) => Runes;
51
- l10nRegExp: (regexString: any, matchString: any) => Runes;
52
- #private;
53
- }
54
- export default translation;
55
- export function l10n(strings: any, ...parts: any[]): Runes;
56
- export function l10nRegExp(regexString: any, matchString: any): Runes;
57
- declare const translation: Translation;
package/dist/intl.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"intl.js","sourceRoot":"","sources":["../src/intl.js"],"names":[],"mappings":";;;;;;AAAA,MAAM,OAAO,KAAM,SAAQ,KAAK;IAC/B,QAAQ;QACP,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACrB,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,cAAc;IAC3C,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,MAAM,QAAQ,GAAG,EAAE,CAAC;IACpB,MAAM,KAAK,GAAG,cAAc,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAC7C,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,E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;SAC5C,OAAO,CAAC,IAAI,CAAC,EAAE;QACf,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACnB,CAAC;IACF,CAAC,CAAC,CAAA;IAEH,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC3B,CAAC"}
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "allowJs": true,
4
- "target": "es2015",
5
- "lib": [
6
- "ESNext",
7
- "DOM"
8
- ],
9
- "module": "ESNext",
10
- "declaration": true,
11
- "sourceMap": true,
12
- "outDir": "./dist",
13
- "esModuleInterop": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "strict": true,
16
- "skipLibCheck": true
17
- },
18
- "exclude": ["dist", "src/*.test.js", "jest.config.js"]
19
- }