Comments (18)
btw: regarding s3 cors => https://docs.aws.amazon.com/AmazonS3/latest/user-guide/add-cors-configuration.html#:~:text=To%20add%20a%20CORS%20configuration,and%20then%20choose%20CORS%20configuration.
https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html#how-do-i-enable-cors
from i18next-http-backend.
Please verify your url again...
In your screenshot the request is red
What happens if you insert the url directly in the browser?
from i18next-http-backend.
It loads URL correctly and I see the result
from i18next-http-backend.
Sorry, can't help without more info...
(failed)net::ERR_FAILED is a networking error
from i18next-http-backend.
Right now I set
requestOptions: { method: 'GET', mode: 'no-cors' }
Now I see success but no data is loaded.
from i18next-http-backend.
Sorry, can't help without a reproducable example.
Maybe your cors configuration is not correct
from i18next-http-backend.
Where can I configure CORS for the request?
from i18next-http-backend.
CORS are configured on server side
from i18next-http-backend.
check the console tab, there you will see the browser error, if there is a cors issue
from i18next-http-backend.
@adrai there is no error right now. Could you please give me an example how to load translation from any Public URL?
from i18next-http-backend.
Take this example: https://github.com/i18next/i18next-http-backend/blob/master/example/node/app.js
change the loadPath with: https://api.locize.app/8166472e-7ac6-44e5-a53f-96a6ca165e2b/latest/{{lng}}/{{ns}}
replace t('welcome') with t('localized')
from i18next-http-backend.
maybe @hyprstack had a similar issue with s3?
from i18next-http-backend.
Trying to solve it, but have no idea what is happening. My AWS configuration seems fine
from i18next-http-backend.
Trying to solve it, but have no idea what is happening. My AWS configuration seems fine
Then try to do a simple fetch to your s3 bucket...
fetch('url to your json file')
from i18next-http-backend.
@adrai thank you for your help. Added CORS configuration in AWS. We can close this issue
from i18next-http-backend.
If you like this module donβt forget to star this repo. Make a tweet, share the word or have a look at our https://locize.com to support the devs of this project.
There are many ways to help this project π
from i18next-http-backend.
Have you tried adding the lng
and ns
arguments to your loadPath method? I noticed you don't have them in the function definition.
loadPath(lng, ns) { return '<S3_BUCKET>.eu-central-1.amazonaws.com/{{lng}}/{{ns}}.json'; },
from i18next-http-backend.
Have you tried adding the
lng
andns
arguments to your loadPath method?
Yes, it's used in the tests... => https://github.com/i18next/i18next-http-backend/blob/master/test/http.spec.js#L96
I noticed you don't have them in the function definition.
should be this: ((lngs: string[], namespaces: string[]) => string)
=> https://github.com/i18next/i18next-http-backend/blob/master/index.d.ts#L3
from i18next-http-backend.
Related Issues (20)
- Loading namespace translation loads only default language, not fallback language HOT 9
- Wrong link in CHANGELOG file HOT 1
- TypeScript support for tranlation files HOT 9
- i18next::backendConnector: loading namespace translation for language zh failed TypeError: Failed to parse URL from /locales/zh/translation.json HOT 2
- Issues with using allowMultiLoading HOT 19
- Add language to `customHeaders` parameter HOT 7
- Value for reloadInterval? HOT 1
- Failed to load path from API to get translation content HOT 8
- Module not found: Can't resolve 'encoding' in '.../node_modules/node-fetch/lib' HOT 6
- Version 2.2.1 loadpath variable can't be override HOT 14
- loadPath arguments in custom request function HOT 4
- Could not find a declaration file for module 'i18next-http-backend' HOT 2
- browser refuses to load files with credentials in url HOT 4
- Possibility to add timeout to the setup HOT 2
- Initial fetch call on vite serve mode HOT 2
- Module '"i18next-http-backend"' has no exported member 'RequestCallback'. HOT 2
- Translate the REST API content using axios HOT 9
- reloadInterval not working for multiple translation files HOT 6
- No request is sent to load a translation file if a website url includes basic auth credentials HOT 3
- have fetch pluggable HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from i18next-http-backend.