It is impossible to use message translation in a model callbacks
- Vorherrschende Sprache
- JavaScript
- Sterne
- 2k
- Forks
- 238
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Code example:
```
User.beforeUpdate = (next) ->
@errors.add 'password', t('passport.failure.invalid_password_format')
next()
```
I get:
```
this.errors.add('password', t('passport.failure.invalid_password_forma
^
ReferenceError: t is not defined
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Look at the model callback code in jugglingdb, likely in lib/model.js or similar, to see how callbacks are executed and what scope they have. Check if the translation function 't' is available in that scope or needs to be imported. Examine how other parts of the codebase handle translations, possibly in a localization module. The fix involves making the translation function accessible within callback contexts.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, nodejs
- Bereich
- backend, databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 45/100