nestjs-i18n
nestjs-i18n copied to clipboard
feat: Add i18n-context-service to inject custom contexts
Currently I am working on a project that has a custom request scope. Similair how this package provides rpc, graphql & http out of the box. This will allow the user to add custom contexts and functions to get the context of said custom context.
I do need some help with the I18nLang
decorator, since I have no clue how I could inject the service into a paramDecorator
.
Same for the tests, any suggestions are welcome.
@toonvanstrijp Have you had any time to look at this yet?
@jurienhamaker I'll take a look at it right now ;)
Coverage decreased (-0.8%) to 90.755% when pulling ec910c94da61b31a82e54233972c91d788c54032 on jurienhamaker:feature/custom-context into 8b998ab3da0aee8451adfd3f8d63f7db376231a0 on toonvanstrijp:main.
@jurienhamaker looks good so far, the only thing that I'm not sure about yet is how to make the I18nLang
decorator work.
@jurienhamaker @jurienhamaker alright I have a potential solution. In the i18n-language.interceptor.ts
we get the context object and put the i18nService
and i18nLang
on there. But we can also set things on the nestjs context
so: context.i18nCustomContexts
(not the ctx
one). Then inside the parameterDecorator
we can access them by doing context.i18nCustomContexts
.
@toonvanstrijp Any updates?
https://github.com/toonvanstrijp/nestjs-i18n/issues/489 https://github.com/toonvanstrijp/nestjs-i18n/issues/479 related
@toonvanstrijp can you look on this one on your free time. Since this is older and almost mergeable I would like your input. This will help close few issue
Hey @toonvanstrijp, can you check this pull request please!? 🙏
Or you @rubiin?
plz fix the merge conflicts
can you fix the conflicts and accept the changes to update the version? or can I do this in your pr?
@BARTlab go ahead