0

In my application i am trying to use localization featrure and for that I am using angular-translate.js . When I am trying to configure the translation using a static JSON file , I am getting the error couldnot

Failed to load resource: the server responded with a status of 404 (Not Found) http://mydomain.com/JsonFiles/locale-en.json

I have written the below code for using translation feature from a JSON file.

$translateProvider.useStaticFilesLoader({
    prefix: 'JsonFiles/locale-',
    suffix: '.json'
});

But it is giving error . Please tell me where I have made the mistake.

Thanks Utpal

Utpal
  • 805
  • 4
  • 15
  • 44
  • What don't you undrstand in the message? It can't find the json file at the URL http://mydomain.com/JsonFiles/locale-en.json. So, make sure it's there. – JB Nizet Feb 03 '14 at 14:11
  • @JB Nizet in my project folder I have added the file but the error is still showing.Even the demo application which I have downloaded from plunker giving same error.Please suggest what I have made wrong. – Utpal Feb 03 '14 at 16:22
  • It depends on what your web server is, how it is configured, where the files are located. It doesn't have much to do with AngularJS – JB Nizet Feb 03 '14 at 16:28
  • @JB Nizet I am not yet hosted it any webserver and I am developing it in my local development area. Currently it is running in my local domain.Is there any way to run this in my local development area.Because as per the example given in the plunker it should run – Utpal Feb 03 '14 at 16:33
  • 1
    Of course. You are running a web server on your local mahine to serve the files over HTTP. The nature and configuration of that local web server is what matters. – JB Nizet Feb 03 '14 at 16:45
  • @JB Nizet then what are the option to configure the webserver . I am running my project using visual studio and I guess it is using the IIS as default webserver. – Utpal Feb 03 '14 at 16:51
  • I don't know anything about IIS. – JB Nizet Feb 03 '14 at 22:20

1 Answers1

1

If it still relevant... I had this problem with IIS web server, by default it doesn't support *.json extension. See this question: How to allow download of .json file with ASP.NET

Community
  • 1
  • 1