docs(mcp): enlace traducible por idioma en set_record_translations
Path absoluto con prefijo (/en/...); CocoEnlace regenera las filas al cambiar el enlace base. Actualizados tool description, ACAI_ENDPOINTS y docs 04/09/11b.
This commit is contained in:
@@ -384,7 +384,7 @@ Notas: `prefix === "www"` es el idioma base (URLs sin prefijo, `urlPrefix === ""
|
||||
}
|
||||
```
|
||||
**Respuesta**: `{ success: true, updated: number, deleted: number }`
|
||||
**Errores**: `{ error: { message: string, code: string } }` — p.ej. si se intenta traducir `enlace` (prohibido: lo mantiene CocoEnlace).
|
||||
**Errores**: `{ error: { message: string, code: string } }` — p.ej. campos de sistema (`num`, `builder`, `controlador`). `enlace` SÍ es traducible: debe ser un path absoluto (se normaliza la barra inicial); al cambiar el enlace base, CocoEnlace regenera las traducciones.
|
||||
|
||||
Notas:
|
||||
- Solo campos traducibles: `textfield`, `textbox`, `wysiwyg`, `codigo`, `multitext` (el multitext se traduce como el JSON serializado completo en una fila).
|
||||
|
||||
@@ -17,7 +17,7 @@ Four usage scenarios:
|
||||
|
||||
Rules:
|
||||
- An EMPTY STRING ('') as a value DELETES that translation (falls back to base language at runtime).
|
||||
- The 'enlace' field is NEVER translated by hand — the CocoEnlace engine maintains it; the PHP rejects it.
|
||||
- 'enlace' IS translatable: absolute path with the language prefix (e.g. '/en/contact/'). Note: when the base 'enlace' changes, CocoEnlace regenerates per-language rows and may overwrite it.
|
||||
- multitext fields are translated as the full serialized JSON string in a single row (translate the whole JSON value, not individual items).
|
||||
- prefix is the language code from list_web_languages (e.g. 'en'); do NOT write to prefix 'www' (base language is edited via normal record fields, not translations).
|
||||
|
||||
@@ -30,7 +30,7 @@ Params:
|
||||
tableName: z.string().describe("Table name without 'cms_' prefix (e.g. 'apartados', 'builder_custom', 'textos_generales')"),
|
||||
recordNum: z.number().describe("Record 'num' primary key to translate"),
|
||||
prefix: z.string().describe("Target language prefix from list_web_languages (e.g. 'en'). Never 'www' (base language)."),
|
||||
fields: z.record(z.string()).describe("Map { fieldName: translatedValue }. Empty string '' deletes the translation. 'enlace' is forbidden."),
|
||||
fields: z.record(z.string()).describe("Map { fieldName: translatedValue }. Empty string '' deletes the translation. 'enlace' must be an absolute path (e.g. '/en/contact/')."),
|
||||
}),
|
||||
{ readOnlyHint: false, destructiveHint: false },
|
||||
withAuth(async ({ tableName, recordNum, prefix, fields }, extra) => {
|
||||
|
||||
Reference in New Issue
Block a user