i18next / i18next-xhr-backend

[deprecated] can be replaced with i18next-http-backend
https://github.com/i18next/i18next-http-backend
MIT License
253 stars 75 forks source link

i18next compatibility - MultiReadCallback #357

Closed DevronB closed 3 years ago

DevronB commented 3 years ago

I'm using this library with the latest version of i18next. It seems there is a small compatibility issue with the typing's.

can/should the following changes be made to line up with i18next typings please?

import { BackendModule, ReadCallback, MultiReadCallback } from 'i18next';

readMulti(languages: string[], namespaces: string[], callback: MultiReadCallback): void;

adrai commented 3 years ago

i18next-xhr-backend is deprecated, use i18next-http-backend instead

DevronB commented 3 years ago

Ok thanks, I did try the http-backend but I use requireJs and it had issues with it trying to require the file from lib, like getFetch.cjs

I don’t understand enough to know why, but these files are not bundled with the min file. Am I missing something obvious?

Cheers Devron From: Adriano @.> Sent: Friday, 16 April 2021 2:36 PM To: @.> Cc: @.>; @.> Subject: Re: [i18next/i18next-xhr-backend] i18next compatibility - MultiReadCallback (#357)

i18next-xhr-backend is deprecated, use i18next-http-backendhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fi18next%2Fi18next-http-backend&data=04%7C01%7C%7C23f0f4c54c6d460b438308d900955f01%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541463804652680%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=bbS5tiH1%2B30JLdrQP7k8Ij9baUQ1NrMGu0T2N5jAO5Q%3D&reserved=0 instead

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fi18next%2Fi18next-xhr-backend%2Fissues%2F357%23issuecomment-820908500&data=04%7C01%7C%7C23f0f4c54c6d460b438308d900955f01%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541463804662672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9ce8C9Ld5YDd923%2FYPatKhfghx97CfI%2BRT1Mu5S2d8M%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGRAKEMV5KPEVL7VSSSUC5DTI7AUXANCNFSM43AYTXDA&data=04%7C01%7C%7C23f0f4c54c6d460b438308d900955f01%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541463804662672%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=a2WdgSpkh9beUbitstXAAbNVw73bfFYBowdScdoEDS8%3D&reserved=0.

adrai commented 3 years ago

Would be nice if you could create a setup with requirejs, so we can investigate...

Maybe requireJs needs this output? https://github.com/i18next/i18next-http-backend/blob/master/i18nextHttpBackend.js

Or you need to require it like this: require('i18next-http-backend/cjs')

DevronB commented 3 years ago

Thanks, importing the js file directly resolves the issue.

From: Adriano @.> Sent: Friday, 16 April 2021 2:50 PM To: @.> Cc: @.>; @.> Subject: Re: [i18next/i18next-xhr-backend] i18next compatibility - MultiReadCallback (#357)

Would be nice if you could create a setup with requirejs, so we can investigate...

Maybe requireJs needs this output? https://github.com/i18next/i18next-http-backend/blob/master/i18nextHttpBackend.jshttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fi18next%2Fi18next-http-backend%2Fblob%2Fmaster%2Fi18nextHttpBackend.js&data=04%7C01%7C%7C469318cf1c184571729c08d90097485b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541472014755390%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=izpZyroPrYxnZM7uDnD3vvfpEvc5C2MXJyUapd1mtg0%3D&reserved=0

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fi18next%2Fi18next-xhr-backend%2Fissues%2F357%23issuecomment-820912863&data=04%7C01%7C%7C469318cf1c184571729c08d90097485b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541472014765382%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=hT1rtpe0Eb%2BE%2Banqty7XPu4N4TCX7hugZggE%2BvIbQOQ%3D&reserved=0, or unsubscribehttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAGRAKEPT4EPJMVZ4TUVVTCTTI7CH7ANCNFSM43AYTXDA&data=04%7C01%7C%7C469318cf1c184571729c08d90097485b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637541472014765382%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=V1M1FJ6sNcUE3sny24%2FM3aZm4qgCwM1W4jvzXoN%2BcTw%3D&reserved=0.