Add critical rules: always Tailwind, always translate user text
- Strengthen CLAUDE.md rule 8: Tailwind with no exceptions - Add CLAUDE.md rule 13: all user-visible text must use translation functions (Twig: | translate, PHP: t_var(), JS: CmsApi.t_var()) - Add t_var() reference to hooks-and-api.md and css-js-conventions.md - Update translate entry in quick-reference.md with all 3 contexts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -96,6 +96,12 @@ CmsApi.hook('/hooks/module_id/', { action: 'getData', id: 123 }).then(function(r
|
||||
});
|
||||
```
|
||||
|
||||
### Traducción en JavaScript
|
||||
Todo texto visible al usuario debe usar `CmsApi.t_var()`:
|
||||
```js
|
||||
CmsApi.t_var('Inicia sesión para guardar favoritos');
|
||||
```
|
||||
|
||||
### Cuándo usar Vue 3
|
||||
|
||||
Usar Vue 3 CDN cuando la lógica requiera:
|
||||
|
||||
@@ -193,6 +193,11 @@ CmsApi::delete('productos',
|
||||
- Foreign keys: el nombre es **exactamente** el definido en el schema (`.ini.php`). A veces es `categoria_num`, a veces `categoria`. Siempre consultar el schema antes de asumir
|
||||
- Upload fields: no se manejan via insert/update
|
||||
- Operadores: `=`, `!=`, `>`, `>=`, `<`, `<=`, `LIKE`, `IN`
|
||||
- **Traducción en PHP:** Usar `t_var()` para todo texto visible al usuario:
|
||||
```php
|
||||
return ['error' => t_var('Debes iniciar sesión')];
|
||||
return ['success' => t_var('Datos guardados correctamente')];
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
| `module` | `'module_id' \| module({params})` |
|
||||
| `queryDB` | `'SELECT ...' \| queryDB()` |
|
||||
| `imagec` | `path \| imagec(width)` |
|
||||
| `translate` | `'text' \| translate` |
|
||||
| `translate` | `'text' \| translate` (Twig) / `t_var('text')` (PHP) / `CmsApi.t_var('text')` (JS) |
|
||||
| `json_decode` | `'json_string' \| json_decode` |
|
||||
| `raw` | `variable \| raw` |
|
||||
| `truncate` | `text \| truncate(100)` |
|
||||
|
||||
Reference in New Issue
Block a user