How to load locale json with translation
How to load locale json with translation
inajaf
Posts: 13Questions: 8Answers: 0
I am trying to use i18n for data tables, but when I put "url": "/dataTables/i18n/de_de.lang"
parameter, it's not working but works with the CDN link. Could it be a folder permission issue? Maybe there is different way to load JSON in language parameter
Answers
Do you get an error in the browser's console regarding loading that file? My guess is a 404 not found error which means you will need to look at the server logs to find out why the file is not found.
Kevin
Yes, it could be a permission issue, or a case-sensitivity issue, or an http server configuration issue, or... Could be a lot of things .
Best bet is to check the server's error log - my guess is there will be a request for a file which results in a 404 return.
Allan
Sorry Kevin - overlapping replies - you are too fast .
On the plus side, we both have the same suggestions!
Allan
@kthorngren is there another way to return JSON data without URL parameter in language?
It needs the URL parameter to load from a file, It would be worth checking your paths. It can either be an external source, like this:
or if internal, like yours, because the path starts with a leading
/
, than means the path is absolute, i.e. from the root of the webserver.If you don't want to use a path, the other option is to place those language options into the configuration, like this example,
Colin