fix(mcp): las traducciones de vars de modulo van por NOMBRE de var, no columna fisica
Una sesion real del agente guardo title3/title6/title2 (columnas de builder_custom segun varsMeta.fieldName, como decian las docs) y el front no pintaba nada: el runtime traduce vars con t($record, $var) por nombre de var. Corregidas descripciones de set/get_record_translations, docs 03/09/11b y ACAI_ENDPOINTS; ademas el puente PHP ahora rechaza titleN/ textN sobre builder_custom con error explicativo (guardrail).
This commit is contained in:
@@ -13,7 +13,7 @@ Four usage scenarios:
|
||||
1. Normal records — translate the visible text fields of any content table. tableName without 'cms_', recordNum = the record 'num', fields = { fieldName: translatedText }.
|
||||
2. configuracion / configuracion_tienda — the global settings tables are ordinary records; translate their text fields the same way (locate the row with list_table_records).
|
||||
3. textos_generales — the template literals used by the Twig '| translate' filter are normal records: translate their 'texto' field. Find the right num by 'identificador' with list_table_records first (tableName='textos_generales', fields={ texto: '...' }).
|
||||
4. Module vars — the textual values of a module live in the 'builder_custom' table. Call get_module_config_vars to get varsMeta ({ fieldName, recordNum } per var, and per item for multi vars), then set tableName='builder_custom', recordNum + fields={ <fieldName>: translatedText } from varsMeta.
|
||||
4. Module vars — the textual values of a module live in the 'builder_custom' table. Call get_module_config_vars to get varsMeta and use its recordNum, BUT the field key MUST be the VAR NAME from builder.json (e.g. 'titulo', 'subtitulo', 'enlace_anchor') — NEVER the physical column (title3, text1...): the engine translates module vars by var name and physical columns are rejected. Example: set tableName='builder_custom', recordNum=<varsMeta recordNum>, fields={ titulo: 'Translated title' }.
|
||||
|
||||
Rules:
|
||||
- An EMPTY STRING ('') as a value DELETES that translation (falls back to base language at runtime).
|
||||
|
||||
Reference in New Issue
Block a user