Aurelia: i18n: Fetch backend doesn't have typescript bindings

Created on 17 Apr 2020  路  12Comments  路  Source: aurelia/aurelia

unless I did something wrong, adding the fetch backend as documented doesn't work if using typescript as it has no types.

https://docs.aurelia.io/app-basics/internationalization#i-18-next-backend-plugin

I created a downstream bug, but would be nice to see this fixed someway or another before release https://github.com/perrin4869/i18next-fetch-backend/issues/43

All 12 comments

@xenoterracide When you say "doesn't work", is TS generating any compilation error or it does not work at all in runtime?

If it is TS compilation error, then the right course of action would be to submit a PR for the package in https://github.com/DefinitelyTyped/DefinitelyTyped.

Also there is this http backend as well with type definitions. https://github.com/i18next/i18next-http-backend
This should also work for fetching the resources.

it doesn't compile, honestly DefinitelyTyped is an option, but I think of that as a last resort these days, if you can't get the author to bundle them, themselves. Either way, I think someone (maybe me) should get around to this before GA (personal opinion that the docs should also work with TS)

It seems the Authors are not interested in adding TS support. Refer: https://github.com/perrin4869/i18next-fetch-backend/issues/37

In that case we can do very little other than creating a custom type definition for it. I may give it a try in few days. But currently, my hands are full.

yeah, I'm in no rush, otherwise I might too ;).

Hey guys, I'm not very well versed in typescript toolchain, but if there is a way to include the typings without changing the current workflow (keep rollup and the typings separate from the source code) I am willing to package them together

yes, we can create a typescript definition file, which is separate from the other source code

Cool! If you drop me a PR I'll review quickly and publish a minor upgrade

@xenoterracide Thanks for opening this issue. I tried to have the type defs in place for this in last November, but slipped my mind to bring it to completion :P

Thanks for the PR, hope this is useful to you guys!
Published as 2.3.0, please confirm that everything is working as expected.

@xenoterracide This should be fixed with #859, combined with https://github.com/perrin4869/i18next-fetch-backend/pull/44. The new dev version is out, you can give it a try.

I will just as soon as I'm done with #837

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HamedFathi picture HamedFathi  路  5Comments

jwx picture jwx  路  13Comments

HamedFathi picture HamedFathi  路  13Comments

bigopon picture bigopon  路  7Comments

LarsKemmann picture LarsKemmann  路  11Comments