Language Support #7975
Replies: 3 comments 3 replies
-
I'm using i18next-resources-to-backend + webpack For this error says
There will be another problems
|
Beta Was this translation helpful? Give feedback.
-
backend: {
- loadPath: 'http://localhost:3000/api/locales/{{lng}}/{{ns}}.json', // Adjust this path based on your project structure
+ loadPath: '/api/locales/{{lng}}/{{ns}}.json', // Adjust this path based on your project structure
}, this host and port may not work in production(docker) env |
Beta Was this translation helpful? Give feedback.
-
So, may I ask about, i18n is added up to main branch?or is it in consideration |
Beta Was this translation helpful? Give feedback.
-
Hey, I was trying to work on #374
We can easily install i18n in the cvat-ui and configure the components to get the translation file via hooks and props. We have 2 option, either keep the translation file in the frontend or we can make a api call to get the translation file.
Making a api call is preferred as loading all the translation might make the front-end heavy and will take time to load.
I have tried making a endpoint at 'localhost:7000/locales/{lng}/translation.json' and I am able to get the data at this endpoint but for some reasons I am not able to get this at 'localhost:3000/locales/{lng}/translation.json'. I thought it might work just like 'localhost:3000/api/...' . Also I am not able to call 'localhost:7000/locales/{lng}/translation.json' directly from the cvat-ui.
![image](https://private-user-images.githubusercontent.com/99531396/335783782-7c472107-9e43-4305-a573-218299954068.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTUyMTQsIm5iZiI6MTczOTI1NDkxNCwicGF0aCI6Ii85OTUzMTM5Ni8zMzU3ODM3ODItN2M0NzIxMDctOWU0My00MzA1LWE1NzMtMjE4Mjk5OTU0MDY4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDA2MjE1NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNiYTYxZDYyZjEzNjExNTIwOTM0ZWZkM2MwNzUzYTEwMmU4Y2JmYTk0Y2IwZmUzMDQyZTIzNTA2NjQ1ZjczZTImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.hjteUPA_-ii3EshldO7yTmGsxFijZDLg7AuqbJtVgew)
Can you suggest me how to fix this.
And if you have any other alternatives please let me know.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions