docs: translation module (#14271)

* docs: translation module

* fix link in JS SDK

* add translations user guides [WIP]

* updates

* fix broken link

* remove mentions of default locale

* change header

* updates

* updated user guides

* handle todos

* fix build error

* fix lint errors
This commit is contained in:
Shahed Nasser
2025-12-17 13:07:43 +02:00
committed by GitHub
parent 1743ed7f04
commit c1a5390fc6
133 changed files with 21304 additions and 1661 deletions

View File

@@ -0,0 +1,11 @@
{
"$schema": "http://json.schemastore.org/tsconfig",
"extends": [
"../../../../packages/modules/translation/tsconfig.json"
],
"include": ["../../../../packages/modules/translation/src"],
"exclude": [
"../../../../packages/modules/translation/dist",
"../../../../packages/modules/translation/node_modules"
]
}

View File

@@ -6,7 +6,6 @@ import { modules } from "./references.js"
import {
customModuleServiceNames,
customModuleTitles,
dmlModules,
} from "./references-details.js"
import { AllowedProjectDocumentsOption, FormattingOptionsType } from "types"
import { kebabToCamel, kebabToPascal, kebabToSnake, kebabToTitle } from "utils"
@@ -39,9 +38,6 @@ modules.forEach((module) => {
allowedProjectDocuments[module] = {
...commonAllowedDocuments,
}
})
dmlModules.forEach((module) => {
allowedProjectDocuments[`${module}-models`] = {
...commonAllowedDocuments,
}
@@ -104,7 +100,6 @@ const mergerOptions: Partial<TypeDocOptions> = {
)
? customModuleServiceNames[moduleName]
: `I${kebabToPascal(moduleName)}ModuleService`
const isDmlModule = dmlModules.includes(moduleName)
const customModuleConfig: FormattingOptionsType = {}
@@ -175,23 +170,15 @@ You should only use the methods in this reference when implementing complex cust
slug: `/references/${moduleName}/models/{{alias}}`,
sidebar_label: "{{alias}}",
},
reflectionDescription: !isDmlModule
? `This documentation provides a reference to the {{alias}} {{kind}}. This belongs to the ${titleModuleName} Module.`
: `This documentation provides a reference to the {{alias}} data model. It belongs to the ${titleModuleName} Module.`,
reflectionDescription: `This documentation provides a reference to the {{alias}} data model. It belongs to the ${titleModuleName} Module.`,
reflectionTitle: {
kind: false,
typeParameters: false,
suffix: `- ${titleModuleName} Module Data Models Reference`,
},
reflectionGroups: isDmlModule
? {
Variables: true,
}
: {
Constructors: false,
Functions: false,
Methods: false,
},
reflectionGroups: {
Variables: true,
},
internalType: "model-ref",
},
[`^modules/${snakeCaseModuleName}_models`]: {
@@ -203,11 +190,9 @@ You should only use the methods in this reference when implementing complex cust
reflectionTitle: {
fullReplacement: `${titleModuleName} Module Data Models Reference`,
},
reflectionGroupRename: isDmlModule
? {
Variables: "Data Models",
}
: {},
reflectionGroupRename: {
Variables: "Data Models",
},
internalType: "model-ref",
},
} as FormattingOptionsType)

View File

@@ -33,25 +33,3 @@ export const customModulesOptions: Record<string, Partial<TypeDocOptions>> = {
),
},
}
// a list of modules that now support DML
export const dmlModules = [
"currency",
"region",
"product",
"user",
"auth",
"pricing",
"cart",
"sales-channel",
"api-key",
"store",
"customer",
"inventory-next",
"payment",
"promotion",
"stock-location-next",
"tax",
"fulfillment",
"order",
]

View File

@@ -16,6 +16,7 @@ export const modules = [
"stock-location-next",
"store",
"tax",
"translation",
"user",
]