aurelia / i18n

A plugin that provides i18n support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

i18next-xhr-backend is deprecated

HIRANO-Satoshi opened this issue · comments

I'm submitting a bug report

  • Library Version:
    aurelia-i18n 4.0.3

Please tell us about your environment:

  • Browser:
    all

Current behavior:

i18next-xhr-backend is deprecated.

The description in the doc no longer works with an error (I forgot).

import Backend from 'i18next-xhr-backend'; 
...
instance.i18next.use(Backend);

Expected/desired behavior:

This works.

import Backend from 'i18next-http-backend';

I think aurelia-i18n's Backend must be updated or removed from the doc.

@HIRANO-Satoshi Thank for reporting it. Would you be interested in submitting a PR?

Sure, if you are OK with removing aurelia-i18n's Backend from the doc and the code.

@HIRANO-Satoshi I think this is purely a doc change. AFAIK the aurelia-i18n-loader uses the loader and not the i18next-xhr-backend. The docs might be a little misleading in that matter. @zewa666 Am I missing something?

the loader does indeed merely call the aurelia-loader to grab resource files, so I'd keep it as is. The larger part is to adjust the docs and samples in there to reflect the new proposed http-backend.

When I tried the internal Backend, I got the same error with i18next-xhr-backend.

Though the internal Backend needs a fix ideally, as I don't have time to fix it, I sent a PR for a doc only solution.

aurelia/documentation#490

It says:

We use i18next-http-backend here. Note that, since i18next-xhr-backend is deprecated, Backend in aurelia-i18n and Backend in i18next--backend are not valid options.

Doc PR merged.

I'm very sorry, I found a typo. I sent another PR.

i18next--backend should be i18next-xhr-backend. so:

We use i18next-http-backend here. Note that, since i18next-xhr-backend is deprecated, Backend in aurelia-i18n and Backend in i18next-xhr-backend are no longer valid options.