@medusajs/translation 2.12.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.
@@ -0,0 +1,36 @@
1
+ import TranslationModuleService from "./services/translation-module";
2
+ export declare const TRANSLATION_MODULE = "translation";
3
+ declare const _default: import("@medusajs/types").ModuleExports<typeof TranslationModuleService> & {
4
+ linkable: {
5
+ readonly locale: {
6
+ code: {
7
+ serviceName: "translation";
8
+ field: "locale";
9
+ linkable: "locale_code";
10
+ primaryKey: "code";
11
+ };
12
+ toJSON: () => {
13
+ serviceName: "translation";
14
+ field: "locale";
15
+ linkable: "locale_code";
16
+ primaryKey: "code";
17
+ };
18
+ };
19
+ readonly translation: {
20
+ id: {
21
+ serviceName: "translation";
22
+ field: "translation";
23
+ linkable: "translation_id";
24
+ primaryKey: "id";
25
+ };
26
+ toJSON: () => {
27
+ serviceName: "translation";
28
+ field: "translation";
29
+ linkable: "translation_id";
30
+ primaryKey: "id";
31
+ };
32
+ };
33
+ };
34
+ };
35
+ export default _default;
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,wBAAwB,MAAM,8BAA8B,CAAA;AAInE,eAAO,MAAM,kBAAkB,gBAAgB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/C,wBAGE"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TRANSLATION_MODULE = void 0;
7
+ const translation_module_1 = __importDefault(require("./services/translation-module"));
8
+ const defaults_1 = __importDefault(require("./loaders/defaults"));
9
+ const utils_1 = require("@medusajs/framework/utils");
10
+ exports.TRANSLATION_MODULE = "translation";
11
+ exports.default = (0, utils_1.Module)(exports.TRANSLATION_MODULE, {
12
+ service: translation_module_1.default,
13
+ loaders: [defaults_1.default],
14
+ });
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAAmE;AACnE,kEAA6C;AAC7C,qDAAkD;AAErC,QAAA,kBAAkB,GAAG,aAAa,CAAA;AAE/C,kBAAe,IAAA,cAAM,EAAC,0BAAkB,EAAE;IACxC,OAAO,EAAE,4BAAwB;IACjC,OAAO,EAAE,CAAC,kBAAY,CAAC;CACxB,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { LoaderOptions } from "@medusajs/framework/types";
2
+ declare const _default: ({ container }: LoaderOptions) => Promise<void>;
3
+ export default _default;
4
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/loaders/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAGd,MAAM,2BAA2B,CAAA;yBA6DZ,eAAe,aAAa,KAAG,OAAO,CAAC,IAAI,CAAC;AAAlE,wBAcC"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ /**
5
+ * BCP 47 Language Tags
6
+ * Common language-region codes following the IETF BCP 47 standard.
7
+ * Format: language[-script][-region]
8
+ * Examples: "en-US" (English, United States), "zh-Hans-CN" (Chinese Simplified, China)
9
+ */
10
+ const defaultLocales = [
11
+ { code: "en-US", name: "English (United States)" },
12
+ { code: "en-GB", name: "English (United Kingdom)" },
13
+ { code: "en-AU", name: "English (Australia)" },
14
+ { code: "en-CA", name: "English (Canada)" },
15
+ { code: "es-ES", name: "Spanish (Spain)" },
16
+ { code: "es-MX", name: "Spanish (Mexico)" },
17
+ { code: "es-AR", name: "Spanish (Argentina)" },
18
+ { code: "fr-FR", name: "French (France)" },
19
+ { code: "fr-CA", name: "French (Canada)" },
20
+ { code: "fr-BE", name: "French (Belgium)" },
21
+ { code: "de-DE", name: "German (Germany)" },
22
+ { code: "de-AT", name: "German (Austria)" },
23
+ { code: "de-CH", name: "German (Switzerland)" },
24
+ { code: "it-IT", name: "Italian (Italy)" },
25
+ { code: "pt-BR", name: "Portuguese (Brazil)" },
26
+ { code: "pt-PT", name: "Portuguese (Portugal)" },
27
+ { code: "nl-NL", name: "Dutch (Netherlands)" },
28
+ { code: "nl-BE", name: "Dutch (Belgium)" },
29
+ { code: "da-DK", name: "Danish (Denmark)" },
30
+ { code: "sv-SE", name: "Swedish (Sweden)" },
31
+ { code: "nb-NO", name: "Norwegian Bokmål (Norway)" },
32
+ { code: "fi-FI", name: "Finnish (Finland)" },
33
+ { code: "pl-PL", name: "Polish (Poland)" },
34
+ { code: "cs-CZ", name: "Czech (Czech Republic)" },
35
+ { code: "sk-SK", name: "Slovak (Slovakia)" },
36
+ { code: "hu-HU", name: "Hungarian (Hungary)" },
37
+ { code: "ro-RO", name: "Romanian (Romania)" },
38
+ { code: "bg-BG", name: "Bulgarian (Bulgaria)" },
39
+ { code: "el-GR", name: "Greek (Greece)" },
40
+ { code: "tr-TR", name: "Turkish (Turkey)" },
41
+ { code: "ru-RU", name: "Russian (Russia)" },
42
+ { code: "uk-UA", name: "Ukrainian (Ukraine)" },
43
+ { code: "ar-SA", name: "Arabic (Saudi Arabia)" },
44
+ { code: "ar-AE", name: "Arabic (United Arab Emirates)" },
45
+ { code: "ar-EG", name: "Arabic (Egypt)" },
46
+ { code: "he-IL", name: "Hebrew (Israel)" },
47
+ { code: "hi-IN", name: "Hindi (India)" },
48
+ { code: "bn-BD", name: "Bengali (Bangladesh)" },
49
+ { code: "th-TH", name: "Thai (Thailand)" },
50
+ { code: "vi-VN", name: "Vietnamese (Vietnam)" },
51
+ { code: "id-ID", name: "Indonesian (Indonesia)" },
52
+ { code: "ms-MY", name: "Malay (Malaysia)" },
53
+ { code: "tl-PH", name: "Tagalog (Philippines)" },
54
+ { code: "zh-CN", name: "Chinese Simplified (China)" },
55
+ { code: "zh-TW", name: "Chinese Traditional (Taiwan)" },
56
+ { code: "zh-HK", name: "Chinese Traditional (Hong Kong)" },
57
+ { code: "ja-JP", name: "Japanese (Japan)" },
58
+ { code: "ko-KR", name: "Korean (South Korea)" },
59
+ ];
60
+ exports.default = async ({ container }) => {
61
+ const logger = container.resolve(utils_1.ContainerRegistrationKeys.LOGGER) ?? console;
62
+ const localeService_ = container.resolve("localeService");
63
+ try {
64
+ const resp = await localeService_.upsert(defaultLocales);
65
+ logger.debug(`Loaded ${resp.length} locales`);
66
+ }
67
+ catch (error) {
68
+ logger.warn(`Failed to load locales, skipping loader. Original error: ${error.message}`);
69
+ }
70
+ };
71
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/loaders/defaults.ts"],"names":[],"mappings":";;AAKA,qDAAqE;AAGrE;;;;;GAKG;AACH,MAAM,cAAc,GAAG;IACrB,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,yBAAyB,EAAE;IAClD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,0BAA0B,EAAE;IACnD,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC9C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC3C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAC1C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE;IAC3C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE;IAC9C,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE;IAC1C,EAAE,IAAI,EAAE,OAAO,EAAE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,EAAE,IAAI,EAAE,sBAAsB,EAAE;CAChD,CAAA;AAED,kBAAe,KAAK,EAAE,EAAE,SAAS,EAAiB,EAAiB,EAAE;IACnE,MAAM,MAAM,GACV,SAAS,CAAC,OAAO,CAAS,iCAAyB,CAAC,MAAM,CAAC,IAAI,OAAO,CAAA;IACxE,MAAM,cAAc,GAClB,SAAS,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;IAEpC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;QACxD,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI,CAAC,MAAM,UAAU,CAAC,CAAA;IAC/C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CACT,4DAA4D,KAAK,CAAC,OAAO,EAAE,CAC5E,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from "@medusajs/framework/mikro-orm/migrations";
2
+ export declare class Migration20251205155734 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20251205155734.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251205155734.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251205155734.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAEpE,qBAAa,uBAAwB,SAAQ,SAAS;IACrC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAKrC"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20251205155734 = void 0;
4
+ const migrations_1 = require("@medusajs/framework/mikro-orm/migrations");
5
+ class Migration20251205155734 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`alter table if exists "translation" drop constraint if exists "translation_entity_id_locale_code_unique";`);
8
+ this.addSql(`create table if not exists "locale" ("code" text not null, "name" text not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "locale_pkey" primary key ("code"));`);
9
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_locale_deleted_at" ON "locale" ("deleted_at") WHERE deleted_at IS NULL;`);
10
+ this.addSql(`create table if not exists "translation" ("id" text not null, "entity_id" text not null, "entity_type" text not null, "locale_code" text not null, "translations" jsonb not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "translation_pkey" primary key ("id"));`);
11
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_translation_deleted_at" ON "translation" ("deleted_at") WHERE deleted_at IS NULL;`);
12
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_translation_entity_id_locale_code_unique" ON "translation" ("entity_id", "locale_code") WHERE deleted_at IS NULL;`);
13
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_translation_entity_id_entity_type" ON "translation" ("entity_id", "entity_type") WHERE deleted_at IS NULL;`);
14
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_translation_locale_code" ON "translation" ("locale_code") WHERE deleted_at IS NULL;`);
15
+ }
16
+ async down() {
17
+ this.addSql(`drop table if exists "locale" cascade;`);
18
+ this.addSql(`drop table if exists "translation" cascade;`);
19
+ }
20
+ }
21
+ exports.Migration20251205155734 = Migration20251205155734;
22
+ //# sourceMappingURL=Migration20251205155734.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251205155734.js","sourceRoot":"","sources":["../../src/migrations/Migration20251205155734.ts"],"names":[],"mappings":";;;AAAA,yEAAoE;AAEpE,MAAa,uBAAwB,SAAQ,sBAAS;IAC3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CACT,2GAA2G,CAC5G,CAAA;QACD,IAAI,CAAC,MAAM,CACT,mQAAmQ,CACpQ,CAAA;QACD,IAAI,CAAC,MAAM,CACT,yGAAyG,CAC1G,CAAA;QAED,IAAI,CAAC,MAAM,CACT,uWAAuW,CACxW,CAAA;QACD,IAAI,CAAC,MAAM,CACT,mHAAmH,CACpH,CAAA;QACD,IAAI,CAAC,MAAM,CACT,0JAA0J,CAC3J,CAAA;QACD,IAAI,CAAC,MAAM,CACT,4IAA4I,CAC7I,CAAA;QACD,IAAI,CAAC,MAAM,CACT,qHAAqH,CACtH,CAAA;IACH,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAA;QAErD,IAAI,CAAC,MAAM,CAAC,6CAA6C,CAAC,CAAA;IAC5D,CAAC;CACF;AAlCD,0DAkCC"}
@@ -0,0 +1,6 @@
1
+ import { Migration } from '@mikro-orm/migrations';
2
+ export declare class Migration20251205200245 extends Migration {
3
+ up(): Promise<void>;
4
+ down(): Promise<void>;
5
+ }
6
+ //# sourceMappingURL=Migration20251205200245.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251205200245.d.ts","sourceRoot":"","sources":["../../src/migrations/Migration20251205200245.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,qBAAa,uBAAwB,SAAQ,SAAS;IAErC,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC;IAWnB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAUrC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Migration20251205200245 = void 0;
4
+ const migrations_1 = require("@mikro-orm/migrations");
5
+ class Migration20251205200245 extends migrations_1.Migration {
6
+ async up() {
7
+ this.addSql(`alter table if exists "translation" drop constraint if exists "translation_reference_id_locale_code_unique";`);
8
+ this.addSql(`drop index if exists "IDX_translation_entity_id_locale_code_unique";`);
9
+ this.addSql(`drop index if exists "IDX_translation_entity_id_entity_type";`);
10
+ this.addSql(`alter table if exists "translation" drop column if exists "entity_id", drop column if exists "entity_type";`);
11
+ this.addSql(`alter table if exists "translation" add column if not exists "reference_id" text not null, add column if not exists "reference" text not null;`);
12
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_translation_reference_id_locale_code_unique" ON "translation" ("reference_id", "locale_code") WHERE deleted_at IS NULL;`);
13
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_translation_reference_id_reference" ON "translation" ("reference_id", "reference") WHERE deleted_at IS NULL;`);
14
+ }
15
+ async down() {
16
+ this.addSql(`drop index if exists "IDX_translation_reference_id_locale_code_unique";`);
17
+ this.addSql(`drop index if exists "IDX_translation_reference_id_reference";`);
18
+ this.addSql(`alter table if exists "translation" drop column if exists "reference_id", drop column if exists "reference";`);
19
+ this.addSql(`alter table if exists "translation" add column if not exists "entity_id" text not null, add column if not exists "entity_type" text not null;`);
20
+ this.addSql(`CREATE UNIQUE INDEX IF NOT EXISTS "IDX_translation_entity_id_locale_code_unique" ON "translation" ("entity_id", "locale_code") WHERE deleted_at IS NULL;`);
21
+ this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_translation_entity_id_entity_type" ON "translation" ("entity_id", "entity_type") WHERE deleted_at IS NULL;`);
22
+ }
23
+ }
24
+ exports.Migration20251205200245 = Migration20251205200245;
25
+ //# sourceMappingURL=Migration20251205200245.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Migration20251205200245.js","sourceRoot":"","sources":["../../src/migrations/Migration20251205200245.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAElD,MAAa,uBAAwB,SAAQ,sBAAS;IAE3C,KAAK,CAAC,EAAE;QACf,IAAI,CAAC,MAAM,CAAC,8GAA8G,CAAC,CAAC;QAC5H,IAAI,CAAC,MAAM,CAAC,sEAAsE,CAAC,CAAC;QACpF,IAAI,CAAC,MAAM,CAAC,+DAA+D,CAAC,CAAC;QAC7E,IAAI,CAAC,MAAM,CAAC,6GAA6G,CAAC,CAAC;QAE3H,IAAI,CAAC,MAAM,CAAC,gJAAgJ,CAAC,CAAC;QAC9J,IAAI,CAAC,MAAM,CAAC,gKAAgK,CAAC,CAAC;QAC9K,IAAI,CAAC,MAAM,CAAC,8IAA8I,CAAC,CAAC;IAC9J,CAAC;IAEQ,KAAK,CAAC,IAAI;QACjB,IAAI,CAAC,MAAM,CAAC,yEAAyE,CAAC,CAAC;QACvF,IAAI,CAAC,MAAM,CAAC,gEAAgE,CAAC,CAAC;QAC9E,IAAI,CAAC,MAAM,CAAC,8GAA8G,CAAC,CAAC;QAE5H,IAAI,CAAC,MAAM,CAAC,+IAA+I,CAAC,CAAC;QAC7J,IAAI,CAAC,MAAM,CAAC,0JAA0J,CAAC,CAAC;QACxK,IAAI,CAAC,MAAM,CAAC,4IAA4I,CAAC,CAAC;IAC5J,CAAC;CAEF;AAvBD,0DAuBC"}
@@ -0,0 +1,6 @@
1
+ declare const Locale: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ code: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").TextProperty>;
3
+ name: import("@medusajs/framework/utils").TextProperty;
4
+ }>, "locale">;
5
+ export default Locale;
6
+ //# sourceMappingURL=locale.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,MAAM;;;aAGV,CAAA;AAEF,eAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const Locale = utils_1.model.define("locale", {
5
+ code: utils_1.model.text().searchable().primaryKey(), // BCP 47 language tag, e.g., "en-US", "da-DK"
6
+ name: utils_1.model.text().searchable(), // Human-readable name, e.g., "English (US)", "Danish"
7
+ });
8
+ exports.default = Locale;
9
+ //# sourceMappingURL=locale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/models/locale.ts"],"names":[],"mappings":";;AAAA,qDAAiD;AAEjD,MAAM,MAAM,GAAG,aAAK,CAAC,MAAM,CAAC,QAAQ,EAAE;IACpC,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,CAAC,UAAU,EAAE,EAAE,8CAA8C;IAC5F,IAAI,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,sDAAsD;CACxF,CAAC,CAAA;AAEF,kBAAe,MAAM,CAAA"}
@@ -0,0 +1,9 @@
1
+ declare const Translation: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
2
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
3
+ reference_id: import("@medusajs/framework/utils").TextProperty;
4
+ reference: import("@medusajs/framework/utils").TextProperty;
5
+ locale_code: import("@medusajs/framework/utils").TextProperty;
6
+ translations: import("@medusajs/framework/utils").JSONProperty;
7
+ }>, "translation">;
8
+ export default Translation;
9
+ //# sourceMappingURL=translation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation.d.ts","sourceRoot":"","sources":["../../src/models/translation.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,WAAW;;;;;;kBAmBb,CAAA;AAEJ,eAAe,WAAW,CAAA"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const utils_1 = require("@medusajs/framework/utils");
4
+ const Translation = utils_1.model
5
+ .define("translation", {
6
+ id: utils_1.model.id({ prefix: "trans" }).primaryKey(),
7
+ reference_id: utils_1.model.text().searchable(),
8
+ reference: utils_1.model.text().searchable(), // e.g., "product", "product_variant", "product_category"
9
+ locale_code: utils_1.model.text().searchable(), // BCP 47 language tag, e.g., "en-US", "da-DK"
10
+ translations: utils_1.model.json(), // JSON object containing translated fields, e.g., { "title": "...", "description": "..." }
11
+ })
12
+ .indexes([
13
+ {
14
+ on: ["reference_id", "locale_code"],
15
+ unique: true,
16
+ },
17
+ {
18
+ on: ["reference_id", "reference"],
19
+ },
20
+ {
21
+ on: ["locale_code"],
22
+ },
23
+ ]);
24
+ exports.default = Translation;
25
+ //# sourceMappingURL=translation.js.map
@@ -0,0 +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,EAAE,yDAAyD;IAC/F,WAAW,EAAE,aAAK,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,8CAA8C;IACtF,YAAY,EAAE,aAAK,CAAC,IAAI,EAAE,EAAE,2FAA2F;CACxH,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,CAAC;KAClC;IACD;QACE,EAAE,EAAE,CAAC,aAAa,CAAC;KACpB;CACF,CAAC,CAAA;AAEJ,kBAAe,WAAW,CAAA"}
@@ -0,0 +1,34 @@
1
+ import { Context, CreateLocaleDTO, CreateTranslationDTO, DAL, FilterableTranslationProps, FindConfig, ITranslationModuleService, LocaleDTO, ModulesSdkTypes, TranslationTypes } from "@medusajs/framework/types";
2
+ import Locale from "../models/locale";
3
+ import Translation from "../models/translation";
4
+ type InjectedDependencies = {
5
+ baseRepository: DAL.RepositoryService;
6
+ translationService: ModulesSdkTypes.IMedusaInternalService<typeof Translation>;
7
+ localeService: ModulesSdkTypes.IMedusaInternalService<typeof Locale>;
8
+ };
9
+ declare const TranslationModuleService_base: import("@medusajs/framework/utils").MedusaServiceReturnType<import("@medusajs/framework/utils").ModelConfigurationsToConfigTemplate<{
10
+ readonly Locale: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
11
+ code: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").TextProperty>;
12
+ name: import("@medusajs/framework/utils").TextProperty;
13
+ }>, "locale">;
14
+ readonly Translation: import("@medusajs/framework/utils").DmlEntity<import("@medusajs/framework/utils").DMLEntitySchemaBuilder<{
15
+ id: import("@medusajs/framework/utils").PrimaryKeyModifier<string, import("@medusajs/framework/utils").IdProperty>;
16
+ reference_id: import("@medusajs/framework/utils").TextProperty;
17
+ reference: import("@medusajs/framework/utils").TextProperty;
18
+ locale_code: import("@medusajs/framework/utils").TextProperty;
19
+ translations: import("@medusajs/framework/utils").JSONProperty;
20
+ }>, "translation">;
21
+ }>>;
22
+ export default class TranslationModuleService extends TranslationModuleService_base implements ITranslationModuleService {
23
+ protected baseRepository_: DAL.RepositoryService;
24
+ protected translationService_: ModulesSdkTypes.IMedusaInternalService<typeof Translation>;
25
+ protected localeService_: ModulesSdkTypes.IMedusaInternalService<typeof Locale>;
26
+ constructor({ baseRepository, translationService, localeService, }: InjectedDependencies);
27
+ static prepareFilters(filters: FilterableTranslationProps): FilterableTranslationProps;
28
+ listTranslations(filters?: FilterableTranslationProps, config?: FindConfig<TranslationTypes.TranslationDTO>, sharedContext?: Context): Promise<TranslationTypes.TranslationDTO[]>;
29
+ listAndCountTranslations(filters?: FilterableTranslationProps, config?: FindConfig<TranslationTypes.TranslationDTO>, sharedContext?: Context): Promise<[TranslationTypes.TranslationDTO[], number]>;
30
+ createLocales(data: CreateLocaleDTO[], sharedContext?: Context): Promise<LocaleDTO[]>;
31
+ createTranslations(data: CreateTranslationDTO[], sharedContext?: Context): Promise<TranslationTypes.TranslationDTO[]>;
32
+ }
33
+ export {};
34
+ //# sourceMappingURL=translation-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation-module.d.ts","sourceRoot":"","sources":["../../src/services/translation-module.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,GAAG,EACH,0BAA0B,EAC1B,UAAU,EACV,yBAAyB,EACzB,SAAS,EACT,eAAe,EACf,gBAAgB,EACjB,MAAM,2BAA2B,CAAA;AAOlC,OAAO,MAAM,MAAM,gBAAgB,CAAA;AACnC,OAAO,WAAW,MAAM,qBAAqB,CAAA;AAE7C,KAAK,oBAAoB,GAAG;IAC1B,cAAc,EAAE,GAAG,CAAC,iBAAiB,CAAA;IACrC,kBAAkB,EAAE,eAAe,CAAC,sBAAsB,CAAC,OAAO,WAAW,CAAC,CAAA;IAC9E,aAAa,EAAE,eAAe,CAAC,sBAAsB,CAAC,OAAO,MAAM,CAAC,CAAA;CACrE,CAAA;;;;;;;;;;;;;;AAED,MAAM,CAAC,OAAO,OAAO,wBACnB,SAAQ,6BAIR,YAAW,yBAAyB;IAEpC,SAAS,CAAC,eAAe,EAAE,GAAG,CAAC,iBAAiB,CAAA;IAChD,SAAS,CAAC,mBAAmB,EAAE,eAAe,CAAC,sBAAsB,CACnE,OAAO,WAAW,CACnB,CAAA;IACD,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC,sBAAsB,CAC9D,OAAO,MAAM,CACd,CAAA;gBAEW,EACV,cAAc,EACd,kBAAkB,EAClB,aAAa,GACd,EAAE,oBAAoB;IAOvB,MAAM,CAAC,cAAc,CACnB,OAAO,EAAE,0BAA0B,GAClC,0BAA0B;IAevB,gBAAgB,CACpB,OAAO,GAAE,0BAA+B,EACxC,MAAM,GAAE,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAM,EACvC,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;IAgBvC,wBAAwB,CAC5B,OAAO,GAAE,0BAA+B,EACxC,MAAM,GAAE,UAAU,CAAC,gBAAgB,CAAC,cAAc,CAAM,EACvC,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,CAAC,gBAAgB,CAAC,cAAc,EAAE,EAAE,MAAM,CAAC,CAAC;IAmBjD,aAAa,CACjB,IAAI,EAAE,eAAe,EAAE,EACN,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,SAAS,EAAE,CAAC;IAgBjB,kBAAkB,CACtB,IAAI,EAAE,oBAAoB,EAAE,EACX,aAAa,GAAE,OAAY,GAC3C,OAAO,CAAC,gBAAgB,CAAC,cAAc,EAAE,CAAC;CAe9C"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ var __importDefault = (this && this.__importDefault) || function (mod) {
15
+ return (mod && mod.__esModule) ? mod : { "default": mod };
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const core_1 = require("@medusajs/framework/mikro-orm/core");
19
+ const utils_1 = require("@medusajs/framework/utils");
20
+ const locale_1 = __importDefault(require("../models/locale"));
21
+ const translation_1 = __importDefault(require("../models/translation"));
22
+ class TranslationModuleService extends (0, utils_1.MedusaService)({
23
+ Locale: locale_1.default,
24
+ Translation: translation_1.default,
25
+ }) {
26
+ constructor({ baseRepository, translationService, localeService, }) {
27
+ super(...arguments);
28
+ this.baseRepository_ = baseRepository;
29
+ this.translationService_ = translationService;
30
+ this.localeService_ = localeService;
31
+ }
32
+ static prepareFilters(filters) {
33
+ let { q, ...restFilters } = filters;
34
+ if (q) {
35
+ restFilters = {
36
+ ...restFilters,
37
+ [(0, core_1.raw)(`translations::text ILIKE ?`, [`%${q}%`])]: [],
38
+ };
39
+ }
40
+ return restFilters;
41
+ }
42
+ // @ts-expect-error
43
+ async listTranslations(filters = {}, config = {}, sharedContext = {}) {
44
+ const preparedFilters = TranslationModuleService.prepareFilters(filters);
45
+ const results = await this.translationService_.list(preparedFilters, config, sharedContext);
46
+ return await this.baseRepository_.serialize(results);
47
+ }
48
+ // @ts-expect-error
49
+ async listAndCountTranslations(filters = {}, config = {}, sharedContext = {}) {
50
+ const preparedFilters = TranslationModuleService.prepareFilters(filters);
51
+ const [results, count] = await this.translationService_.listAndCount(preparedFilters, config, sharedContext);
52
+ return [
53
+ await this.baseRepository_.serialize(results),
54
+ count,
55
+ ];
56
+ }
57
+ // @ts-expect-error
58
+ async createLocales(data, sharedContext = {}) {
59
+ const normalizedData = data.map((locale) => ({
60
+ ...locale,
61
+ code: (0, utils_1.normalizeLocale)(locale.code),
62
+ }));
63
+ const createdLocales = await this.localeService_.create(normalizedData, sharedContext);
64
+ return await this.baseRepository_.serialize(createdLocales);
65
+ }
66
+ // @ts-expect-error
67
+ async createTranslations(data, sharedContext = {}) {
68
+ const normalizedData = data.map((translation) => ({
69
+ ...translation,
70
+ locale_code: (0, utils_1.normalizeLocale)(translation.locale_code),
71
+ }));
72
+ const createdTranslations = await this.translationService_.create(normalizedData, sharedContext);
73
+ return await this.baseRepository_.serialize(createdTranslations);
74
+ }
75
+ }
76
+ exports.default = TranslationModuleService;
77
+ __decorate([
78
+ (0, utils_1.InjectManager)()
79
+ // @ts-expect-error
80
+ ,
81
+ __param(2, (0, utils_1.MedusaContext)()),
82
+ __metadata("design:type", Function),
83
+ __metadata("design:paramtypes", [Object, Object, Object]),
84
+ __metadata("design:returntype", Promise)
85
+ ], TranslationModuleService.prototype, "listTranslations", null);
86
+ __decorate([
87
+ (0, utils_1.InjectManager)()
88
+ // @ts-expect-error
89
+ ,
90
+ __param(2, (0, utils_1.MedusaContext)()),
91
+ __metadata("design:type", Function),
92
+ __metadata("design:paramtypes", [Object, Object, Object]),
93
+ __metadata("design:returntype", Promise)
94
+ ], TranslationModuleService.prototype, "listAndCountTranslations", null);
95
+ __decorate([
96
+ (0, utils_1.InjectManager)()
97
+ // @ts-expect-error
98
+ ,
99
+ __param(1, (0, utils_1.MedusaContext)()),
100
+ __metadata("design:type", Function),
101
+ __metadata("design:paramtypes", [Array, Object]),
102
+ __metadata("design:returntype", Promise)
103
+ ], TranslationModuleService.prototype, "createLocales", null);
104
+ __decorate([
105
+ (0, utils_1.InjectManager)()
106
+ // @ts-expect-error
107
+ ,
108
+ __param(1, (0, utils_1.MedusaContext)()),
109
+ __metadata("design:type", Function),
110
+ __metadata("design:paramtypes", [Array, Object]),
111
+ __metadata("design:returntype", Promise)
112
+ ], TranslationModuleService.prototype, "createTranslations", null);
113
+ //# sourceMappingURL=translation-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"translation-module.js","sourceRoot":"","sources":["../../src/services/translation-module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,6DAAwD;AAaxD,qDAKkC;AAClC,4DAAmC;AACnC,sEAA6C;AAQ7C,MAAqB,wBACnB,SAAQ,IAAA,qBAAa,EAAC;IACpB,MAAM,EAAN,gBAAM;IACN,WAAW,EAAX,qBAAW;CACZ,CAAC;IAWF,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,aAAa,GAC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AAA,qBAAa,GAAE,CAAA;;;;6DAajB;AAIK;IAFL,IAAA,qBAAa,GAAE;IAChB,mBAAmB;;IAGhB,WAAA,IAAA,qBAAa,GAAE,CAAA;;;;kEAejB"}
@@ -0,0 +1 @@
1
+ {"root":["../src/index.ts","../src/loaders/defaults.ts","../src/migrations/migration20251205155734.ts","../src/migrations/migration20251205200245.ts","../src/models/locale.ts","../src/models/translation.ts","../src/services/translation-module.ts"],"version":"5.9.3"}
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@medusajs/translation",
3
+ "version": "2.12.1",
4
+ "description": "Medusa Translation module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "!dist/**/__tests__",
10
+ "!dist/**/__mocks__",
11
+ "!dist/**/__fixtures__"
12
+ ],
13
+ "engines": {
14
+ "node": ">=20"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/medusajs/medusa",
19
+ "directory": "packages/modules/translation"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "author": "Medusa",
25
+ "license": "MIT",
26
+ "scripts": {
27
+ "watch": "yarn run -T tsc --build --watch",
28
+ "watch:test": "yarn run -T tsc --build tsconfig.spec.json --watch",
29
+ "resolve:aliases": "yarn run -T tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && yarn run -T tsc-alias -p tsconfig.resolved.json && yarn run -T rimraf tsconfig.resolved.json",
30
+ "build": "yarn run -T rimraf dist && yarn run -T tsc --build && npm run resolve:aliases",
31
+ "test": "../../../node_modules/.bin/jest --passWithNoTests --bail --forceExit --testPathPattern=src",
32
+ "test:integration": "../../../node_modules/.bin/jest --passWithNoTests --forceExit --testPathPattern=\"integration-tests/__tests__/.*\\.ts\"",
33
+ "migration:initial": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:create --initial",
34
+ "migration:create": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:create",
35
+ "migration:up": "MIKRO_ORM_CLI_CONFIG=./mikro-orm.config.dev.ts MIKRO_ORM_ALLOW_GLOBAL_CLI=true medusa-mikro-orm migration:up",
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
+ },
38
+ "devDependencies": {
39
+ "@medusajs/framework": "2.12.1",
40
+ "@medusajs/test-utils": "2.12.1"
41
+ },
42
+ "peerDependencies": {
43
+ "@medusajs/framework": "2.12.1"
44
+ }
45
+ }