@medusajs/translation 3.0.0-snapshot-20251215162333 → 3.0.0-snapshot-20251216122339
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/loaders/config.d.ts +1 -5
- package/dist/loaders/config.d.ts.map +1 -1
- package/dist/loaders/config.js +4 -46
- package/dist/loaders/config.js.map +1 -1
- package/dist/migrations/Migration20251215083927.d.ts +1 -1
- package/dist/migrations/Migration20251215083927.d.ts.map +1 -1
- package/dist/migrations/Migration20251215083927.js +1 -1
- package/dist/migrations/Migration20251215083927.js.map +1 -1
- package/dist/models/locale.d.ts +6 -0
- package/dist/models/locale.d.ts.map +1 -1
- package/dist/models/locale.js +8 -2
- package/dist/models/locale.js.map +1 -1
- package/dist/models/translation.d.ts +26 -0
- package/dist/models/translation.d.ts.map +1 -1
- package/dist/models/translation.js +29 -3
- package/dist/models/translation.js.map +1 -1
- package/dist/utils/translatable-fields.d.ts +14 -0
- package/dist/utils/translatable-fields.d.ts.map +1 -1
- package/dist/utils/translatable-fields.js +25 -1
- package/dist/utils/translatable-fields.js.map +1 -1
- package/package.json +4 -4
package/dist/loaders/config.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { LoaderOptions } from "@medusajs/framework/types";
|
|
2
|
-
declare const _default: ({ container
|
|
3
|
-
expandedTranslatableFields: {
|
|
4
|
-
[key: string]: string[];
|
|
5
|
-
};
|
|
6
|
-
}>) => Promise<void>;
|
|
2
|
+
declare const _default: ({ container }: LoaderOptions) => Promise<void>;
|
|
7
3
|
export default _default;
|
|
8
4
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;yBAKnC,eAAe,aAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAAlE,wBAKC"}
|
package/dist/loaders/config.js
CHANGED
|
@@ -1,51 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const translatable_fields_1 = require("../utils/translatable-fields");
|
|
4
|
-
const awilix_1 = require("awilix");
|
|
5
3
|
const constants_1 = require("../utils/constants");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
product: translatable_fields_1.PRODUCT_TRANSLATABLE_FIELDS,
|
|
11
|
-
product_variant: translatable_fields_1.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
|
|
12
|
-
product_type: translatable_fields_1.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
|
|
13
|
-
product_collection: translatable_fields_1.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
|
|
14
|
-
};
|
|
15
|
-
if (product) {
|
|
16
|
-
const translatableFields = new Set([
|
|
17
|
-
...translatable_fields_1.PRODUCT_TRANSLATABLE_FIELDS,
|
|
18
|
-
...product,
|
|
19
|
-
]);
|
|
20
|
-
translatableFieldsConfig.product = Array.from(translatableFields);
|
|
21
|
-
}
|
|
22
|
-
if (productVariant) {
|
|
23
|
-
const translatableFields = new Set([
|
|
24
|
-
...translatable_fields_1.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
|
|
25
|
-
...productVariant,
|
|
26
|
-
]);
|
|
27
|
-
translatableFieldsConfig.product_variant = Array.from(translatableFields);
|
|
28
|
-
}
|
|
29
|
-
if (productType) {
|
|
30
|
-
const translatableFields = new Set([
|
|
31
|
-
...translatable_fields_1.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
|
|
32
|
-
...productType,
|
|
33
|
-
]);
|
|
34
|
-
translatableFieldsConfig.product_type = Array.from(translatableFields);
|
|
35
|
-
}
|
|
36
|
-
if (productCollection) {
|
|
37
|
-
const translatableFields = new Set([
|
|
38
|
-
...translatable_fields_1.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
|
|
39
|
-
...productCollection,
|
|
40
|
-
]);
|
|
41
|
-
translatableFieldsConfig.product_collection = Array.from(translatableFields);
|
|
42
|
-
}
|
|
43
|
-
if (others) {
|
|
44
|
-
Object.entries(others).forEach(([key, value]) => {
|
|
45
|
-
const translatableFields = new Set([...value]);
|
|
46
|
-
translatableFieldsConfig[key] = Array.from(translatableFields);
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
container.register(constants_1.TRANSLATABLE_FIELDS_CONFIG_KEY, (0, awilix_1.asValue)(translatableFieldsConfig));
|
|
4
|
+
const awilix_1 = require("awilix");
|
|
5
|
+
const translatable_fields_1 = require("../utils/translatable-fields");
|
|
6
|
+
exports.default = async ({ container }) => {
|
|
7
|
+
container.register(constants_1.TRANSLATABLE_FIELDS_CONFIG_KEY, (0, awilix_1.asValue)(translatable_fields_1.translatableFieldsConfig));
|
|
50
8
|
};
|
|
51
9
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":";;AACA,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/loaders/config.ts"],"names":[],"mappings":";;AACA,gDAAiE;AACjE,mCAAgC;AAChC,sEAAuE;AAEvE,kBAAe,KAAK,EAAE,EAAE,SAAS,EAAiB,EAAiB,EAAE;IACnE,SAAS,CAAC,QAAQ,CAChB,0CAA8B,EAC9B,IAAA,gBAAO,EAAC,8CAAwB,CAAC,CAClC,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migration20251215083927.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"Migration20251215083927.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAMnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Migration20251215083927 = void 0;
|
|
4
|
-
const migrations_1 = require("@mikro-orm/migrations");
|
|
4
|
+
const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
|
|
5
5
|
class Migration20251215083927 extends migrations_1.Migration {
|
|
6
6
|
async up() {
|
|
7
7
|
this.addSql(`alter table if exists "translation" add column if not exists "translated_field_count" integer not null default 0;`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Migration20251215083927.js","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Migration20251215083927.js","sourceRoot":"","sources":["../../src/migrations/Migration20251215083927.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,mHAAmH,CACpH,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CACT,qFAAqF,CACtF,CAAA;IACH,CAAC;CACF;AAZD,0DAYC"}
|
package/dist/models/locale.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
declare const Locale: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
2
|
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
/**
|
|
4
|
+
* The BCP 47 language tag code of the locale (e.g., "en-US", "da-DK").
|
|
5
|
+
*/
|
|
3
6
|
code: import("@medusajs/framework/utils").TextProperty;
|
|
7
|
+
/**
|
|
8
|
+
* The human-readable name of the locale (e.g., "English (US)", "Danish").
|
|
9
|
+
*/
|
|
4
10
|
name: import("@medusajs/framework/utils").TextProperty;
|
|
5
11
|
}>, "locale">;
|
|
6
12
|
export default Locale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;IAGR;;OAEG;;IAEH;;OAEG;;aAQH,CAAA;AAEJ,eAAe,MAAM,CAAA"}
|
package/dist/models/locale.js
CHANGED
|
@@ -4,8 +4,14 @@ const utils_1 = require("@medusajs/framework/utils");
|
|
|
4
4
|
const Locale = utils_1.model
|
|
5
5
|
.define("locale", {
|
|
6
6
|
id: utils_1.model.id({ prefix: "loc" }).primaryKey(),
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* The BCP 47 language tag code of the locale (e.g., "en-US", "da-DK").
|
|
9
|
+
*/
|
|
10
|
+
code: utils_1.model.text().searchable(),
|
|
11
|
+
/**
|
|
12
|
+
* The human-readable name of the locale (e.g., "English (US)", "Danish").
|
|
13
|
+
*/
|
|
14
|
+
name: utils_1.model.text().searchable(),
|
|
9
15
|
})
|
|
10
16
|
.indexes([
|
|
11
17
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,MAAM,GAAG,aAAK;KACjB,MAAM,CAAC,QAAQ,EAAE;IAChB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE;IAC5C,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,MAAM,GAAG,aAAK;KACjB,MAAM,CAAC,QAAQ,EAAE;IAChB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC,UAAU,EAAE;IAC5C;;OAEG;IACH,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IAC/B;;OAEG;IACH,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;CAChC,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,MAAM,CAAC;QACZ,MAAM,EAAE,IAAI;KACb;CACF,CAAC,CAAA;AAEJ,kBAAe,MAAM,CAAA"}
|
|
@@ -1,9 +1,35 @@
|
|
|
1
1
|
declare const Translation: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
|
|
2
2
|
id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
|
|
3
|
+
/**
|
|
4
|
+
* The ID of the entity that the translation belongs to. For example, the ID of a product or a product variant.
|
|
5
|
+
*/
|
|
3
6
|
reference_id: import("@medusajs/framework/utils").TextProperty;
|
|
7
|
+
/**
|
|
8
|
+
* The name of the table that the translation belongs to. For example, "product" or "product_variant".
|
|
9
|
+
*/
|
|
4
10
|
reference: import("@medusajs/framework/utils").TextProperty;
|
|
11
|
+
/**
|
|
12
|
+
* The BCP 47 language tag code of the locale
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* "en-US"
|
|
16
|
+
*/
|
|
5
17
|
locale_code: import("@medusajs/framework/utils").TextProperty;
|
|
18
|
+
/**
|
|
19
|
+
* The translations of the entity.
|
|
20
|
+
* The object's keys are the field names of the entity, and its value is the translated value.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* {
|
|
24
|
+
* "title": "Product Title",
|
|
25
|
+
* "description": "Product Description",
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
6
28
|
translations: import("@medusajs/framework/utils").JSONProperty;
|
|
29
|
+
/**
|
|
30
|
+
* Precomputed count of translated fields of a resource.
|
|
31
|
+
* Useful for optimization purposes.
|
|
32
|
+
*/
|
|
7
33
|
translated_field_count: import("@medusajs/framework/utils").NumberProperty;
|
|
8
34
|
}>, "translation">;
|
|
9
35
|
export default Translation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;;IAGb;;OAEG;;IAEH;;OAEG;;IAEH;;;;;OAKG;;IAEH;;;;;;;;;OASG;;IAEH;;;OAGG;;kBAoBH,CAAA;AAEJ,eAAe,WAAW,CAAA"}
|
|
@@ -4,11 +4,37 @@ const utils_1 = require("@medusajs/framework/utils");
|
|
|
4
4
|
const Translation = utils_1.model
|
|
5
5
|
.define("translation", {
|
|
6
6
|
id: utils_1.model.id({ prefix: "trans" }).primaryKey(),
|
|
7
|
+
/**
|
|
8
|
+
* The ID of the entity that the translation belongs to. For example, the ID of a product or a product variant.
|
|
9
|
+
*/
|
|
7
10
|
reference_id: utils_1.model.text().searchable(),
|
|
8
|
-
|
|
9
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The name of the table that the translation belongs to. For example, "product" or "product_variant".
|
|
13
|
+
*/
|
|
14
|
+
reference: utils_1.model.text().searchable(),
|
|
15
|
+
/**
|
|
16
|
+
* The BCP 47 language tag code of the locale
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* "en-US"
|
|
20
|
+
*/
|
|
21
|
+
locale_code: utils_1.model.text().searchable(),
|
|
22
|
+
/**
|
|
23
|
+
* The translations of the entity.
|
|
24
|
+
* The object's keys are the field names of the entity, and its value is the translated value.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* {
|
|
28
|
+
* "title": "Product Title",
|
|
29
|
+
* "description": "Product Description",
|
|
30
|
+
* }
|
|
31
|
+
*/
|
|
10
32
|
translations: utils_1.model.json(),
|
|
11
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Precomputed count of translated fields of a resource.
|
|
35
|
+
* Useful for optimization purposes.
|
|
36
|
+
*/
|
|
37
|
+
translated_field_count: utils_1.model.number().default(0),
|
|
12
38
|
})
|
|
13
39
|
.indexes([
|
|
14
40
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,WAAW,GAAG,aAAK;KACtB,MAAM,CAAC,aAAa,EAAE;IACrB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACvC,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"translation.js","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,WAAW,GAAG,aAAK;KACtB,MAAM,CAAC,aAAa,EAAE;IACrB,EAAE,EAAE,aAAK,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,UAAU,EAAE;IAC9C;;OAEG;IACH,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACvC;;OAEG;IACH,SAAS,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACpC;;;;;OAKG;IACH,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE;IACtC;;;;;;;;;OASG;IACH,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE;IAC1B;;;OAGG;IACH,sBAAsB,EAAE,aAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;CAClD,CAAC;KACD,OAAO,CAAC;IACP;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC;QACnC,MAAM,EAAE,IAAI;KACb;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,EAAE,aAAa,CAAC;KACjD;IACD;QACE,EAAE,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC;KACjC;IACD;QACE,EAAE,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;KAClC;IACD;QACE,EAAE,EAAE,CAAC,aAAa,CAAC;KACpB;CACF,CAAC,CAAA;AAEJ,kBAAe,WAAW,CAAA"}
|
|
@@ -2,4 +2,18 @@ export declare const PRODUCT_TRANSLATABLE_FIELDS: string[];
|
|
|
2
2
|
export declare const PRODUCT_VARIANT_TRANSLATABLE_FIELDS: string[];
|
|
3
3
|
export declare const PRODUCT_TYPE_TRANSLATABLE_FIELDS: string[];
|
|
4
4
|
export declare const PRODUCT_COLLECTION_TRANSLATABLE_FIELDS: string[];
|
|
5
|
+
export declare const PRODUCT_CATEGORY_TRANSLATABLE_FIELDS: string[];
|
|
6
|
+
export declare const PRODUCT_TAG_TRANSLATABLE_FIELDS: string[];
|
|
7
|
+
export declare const PRODUCT_OPTION_TRANSLATABLE_FIELDS: string[];
|
|
8
|
+
export declare const PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS: string[];
|
|
9
|
+
export declare const translatableFieldsConfig: {
|
|
10
|
+
product: string[];
|
|
11
|
+
product_variant: string[];
|
|
12
|
+
product_type: string[];
|
|
13
|
+
product_collection: string[];
|
|
14
|
+
product_category: string[];
|
|
15
|
+
product_tag: string[];
|
|
16
|
+
product_option: string[];
|
|
17
|
+
product_option_value: string[];
|
|
18
|
+
};
|
|
5
19
|
//# sourceMappingURL=translatable-fields.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translatable-fields.d.ts","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,UAMvC,CAAA;
|
|
1
|
+
{"version":3,"file":"translatable-fields.d.ts","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,UAMvC,CAAA;AACD,eAAO,MAAM,mCAAmC,UAAwB,CAAA;AACxE,eAAO,MAAM,gCAAgC,UAAY,CAAA;AACzD,eAAO,MAAM,sCAAsC,UAAY,CAAA;AAC/D,eAAO,MAAM,oCAAoC,UAA0B,CAAA;AAC3E,eAAO,MAAM,+BAA+B,UAAY,CAAA;AACxD,eAAO,MAAM,kCAAkC,UAAY,CAAA;AAC3D,eAAO,MAAM,wCAAwC,UAAY,CAAA;AAWjE,eAAO,MAAM,wBAAwB;;;;;;;;;CAcpC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = exports.PRODUCT_TRANSLATABLE_FIELDS = void 0;
|
|
3
|
+
exports.translatableFieldsConfig = exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS = exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TAG_TRANSLATABLE_FIELDS = exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS = exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = exports.PRODUCT_TRANSLATABLE_FIELDS = void 0;
|
|
4
4
|
exports.PRODUCT_TRANSLATABLE_FIELDS = [
|
|
5
5
|
"title",
|
|
6
6
|
"description",
|
|
@@ -11,4 +11,28 @@ exports.PRODUCT_TRANSLATABLE_FIELDS = [
|
|
|
11
11
|
exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS = ["title", "material"];
|
|
12
12
|
exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS = ["value"];
|
|
13
13
|
exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS = ["title"];
|
|
14
|
+
exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS = ["name", "description"];
|
|
15
|
+
exports.PRODUCT_TAG_TRANSLATABLE_FIELDS = ["value"];
|
|
16
|
+
exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS = ["title"];
|
|
17
|
+
exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS = ["value"];
|
|
18
|
+
// export const SHIPPING_OPTION_TRANSLATABLE_FIELDS = ["name"]
|
|
19
|
+
// export const SHIPPING_OPTION_TYPE_TRANSLATABLE_FIELDS = ["label", "description"]
|
|
20
|
+
// export const RETURN_REASON_TRANSLATABLE_FIELDS = [
|
|
21
|
+
// "value",
|
|
22
|
+
// "label",
|
|
23
|
+
// "description",
|
|
24
|
+
// ]
|
|
25
|
+
exports.translatableFieldsConfig = {
|
|
26
|
+
product: exports.PRODUCT_TRANSLATABLE_FIELDS,
|
|
27
|
+
product_variant: exports.PRODUCT_VARIANT_TRANSLATABLE_FIELDS,
|
|
28
|
+
product_type: exports.PRODUCT_TYPE_TRANSLATABLE_FIELDS,
|
|
29
|
+
product_collection: exports.PRODUCT_COLLECTION_TRANSLATABLE_FIELDS,
|
|
30
|
+
product_category: exports.PRODUCT_CATEGORY_TRANSLATABLE_FIELDS,
|
|
31
|
+
product_tag: exports.PRODUCT_TAG_TRANSLATABLE_FIELDS,
|
|
32
|
+
product_option: exports.PRODUCT_OPTION_TRANSLATABLE_FIELDS,
|
|
33
|
+
product_option_value: exports.PRODUCT_OPTION_VALUE_TRANSLATABLE_FIELDS,
|
|
34
|
+
// shipping_option: SHIPPING_OPTION_TRANSLATABLE_FIELDS,
|
|
35
|
+
// shipping_option_type: SHIPPING_OPTION_TYPE_TRANSLATABLE_FIELDS,
|
|
36
|
+
// return_reason: RETURN_REASON_TRANSLATABLE_FIELDS,
|
|
37
|
+
};
|
|
14
38
|
//# sourceMappingURL=translatable-fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translatable-fields.js","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,OAAO;IACP,aAAa;IACb,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAA;
|
|
1
|
+
{"version":3,"file":"translatable-fields.js","sourceRoot":"","sources":["../../src/utils/translatable-fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;IACzC,OAAO;IACP,aAAa;IACb,UAAU;IACV,UAAU;IACV,QAAQ;CACT,CAAA;AACY,QAAA,mCAAmC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;AAC3D,QAAA,gCAAgC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC5C,QAAA,sCAAsC,GAAG,CAAC,OAAO,CAAC,CAAA;AAClD,QAAA,oCAAoC,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;AAC9D,QAAA,+BAA+B,GAAG,CAAC,OAAO,CAAC,CAAA;AAC3C,QAAA,kCAAkC,GAAG,CAAC,OAAO,CAAC,CAAA;AAC9C,QAAA,wCAAwC,GAAG,CAAC,OAAO,CAAC,CAAA;AAEjE,8DAA8D;AAC9D,mFAAmF;AAEnF,qDAAqD;AACrD,aAAa;AACb,aAAa;AACb,mBAAmB;AACnB,IAAI;AAES,QAAA,wBAAwB,GAAG;IACtC,OAAO,EAAE,mCAA2B;IACpC,eAAe,EAAE,2CAAmC;IACpD,YAAY,EAAE,wCAAgC;IAC9C,kBAAkB,EAAE,8CAAsC;IAC1D,gBAAgB,EAAE,4CAAoC;IACtD,WAAW,EAAE,uCAA+B;IAC5C,cAAc,EAAE,0CAAkC;IAClD,oBAAoB,EAAE,gDAAwC;IAE9D,wDAAwD;IACxD,kEAAkE;IAElE,oDAAoD;CACrD,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/translation",
|
|
3
|
-
"version": "3.0.0-snapshot-
|
|
3
|
+
"version": "3.0.0-snapshot-20251216122339",
|
|
4
4
|
"description": "Medusa Translation module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"orm:cache:clear": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm cache:clear"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
40
|
-
"@medusajs/test-utils": "3.0.0-snapshot-
|
|
39
|
+
"@medusajs/framework": "3.0.0-snapshot-20251216122339",
|
|
40
|
+
"@medusajs/test-utils": "3.0.0-snapshot-20251216122339"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@medusajs/framework": "3.0.0-snapshot-
|
|
43
|
+
"@medusajs/framework": "3.0.0-snapshot-20251216122339"
|
|
44
44
|
}
|
|
45
45
|
}
|