duanjingyu007 / jquery-i18n-properties

Automatically exported from code.google.com/p/jquery-i18n-properties
0 stars 0 forks source link

Wrong contentType for ajax used #7

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Statement on your project home: "The use of ‘.properties‘ files for 
translation is specially useful when sharing i18n files between Java and 
Javascript projects."

Steps to reproduce:

1. Create a properties file with an IDE, e.g. Netbeans; the properties file 
will be in ISO-8859-1 encoding which conforms to the Java standard! All 
non-Latin-1 characters must be entered by using Unicode escape characters.

2. When you are trying to use jquery-i18n-properties, it will use a false 
encoding, namely 'text/plain;charset=UTF-8' for $.ajax() contentType. This 
leads to a parse exception at the first "=".

3. Everything seems to work when you are using 'text/plain;charset=ISO-8859-1' 
contentType.

What version of the product are you using? On what operating system?
jQuery.i18n.properties-1.0.8, jquery-1.6, Ubuntu-Linux 10.0.4

There should be some information about this (problems when sharing properties 
files with Java), or even better a documented initialization parameter, which 
can be set to the correct contentType.

Original issue reported on code.google.com by grosse_j...@yahoo.de on 28 May 2011 at 4:03

GoogleCodeExporter commented 8 years ago
I've forgot to mention the server: it was glassfish 3.1 and a JSF web project 
where I was testing it (knowing that I can use the full-fledged Java 
Resourcebundles but testing it for JavaScript/DOM-Manipulation in a legacy 
PHP/JavaScript/JSP-Application.

Original comment by grosse_j...@yahoo.de on 28 May 2011 at 6:04

GoogleCodeExporter commented 8 years ago
Must have been another error which caused my problem at first tries (see 2.) - 
looks like this messge was produced by Firebug ore something else.
Now it works!

Original comment by grosse_j...@yahoo.de on 28 May 2011 at 8:56