#14586: Make interpolate JS function not require the named parameter.
--------------------------------------+------------------------------------
Reporter: Amin Mirzaee | Owner: nobody
Type: Cleanup/optimization | Status: closed
Component: Internationalization | Version: 1.2
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Baptiste Mispelon):
* status: new => closed
* resolution: => invalid
Comment:
My js knowledge is not super strong but I think what this ticket is asking
already works.
In javascript, function parameters are always optional (and default to
`undefined`).
The documentation already shows example where `named` is not required:
https://docs.djangoproject.com/en/4.0/topics/i18n/translation/#interpolate
There are also tests using `interpolate` without `named`:
https://github.com/django/django/blob/806efe912b846c1fde250c9321d8334b7517cd56/tests/view_tests/templates/jsi18n.html#L23
--
Ticket URL: <https://code.djangoproject.com/ticket/14586#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/066.ed5795207eef08dc00922ad3bb1ef6e0%40djangoproject.com.