[ 
http://mifosforge.jira.com/browse/MIFOS-4789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=66033#comment-66033
 ] 

Adam Monsen edited comment on MIFOS-4789 at 3/4/11 8:37 PM:
------------------------------------------------------------

I think I've figured this out... I maintain that the stuff (my patch) discussed 
above is valid and needed, but (my bad) there is another kind of unrelated 
issue: Something is wrong with the translations in the *.properties.  I was 
able to see Chinese locally, after applying the attached patch, and switching 
with a applicationConfiguration.custom.properties (thanks Adam) and then 
running the following:

find . -name "*.properties" -exec native2ascii -encoding utf-8 {} {}  \;

in the userInterface/src/main/resources/org/mifos/ui/localizedProperties/ & 
questionnaire/src/main/resources/org/mifos/platform/questionnaire/ui/localizedProperties/
 & 
cashflow/src/main/resources/org/mifos/platform/cashflow/ui/localizedProperties 
& application/src/main/resources/org/mifos/config/localizedResources & 
appdomain/src/main/resources/org/mifos/config/localizedResources directories.

BTW: One must restart the (Workspace Embedded Jetty, works fine) after running 
the above, else only translations in the main body of JSP pages are OK (have 
refreshed automatically) but the left hand menu and top tabs don't refresh - 
what's the deal with that?! 

So it seems that in FTL pages the technically wrong encoding of the properties 
files is compensated by something, but in the JSP pages it doesn't work 
(anymore).  I haven't fully understood how this works, but stumbled upon the 
mifos-appdomain/src/main/resources/org/mifos/config/resources/messageSourceBean.xml
 with its ReloadableResourceBundleMessageSource and fileEncodings=UTF-8 & 
defaultEncoding=UTF-8, I can only speculate that not all translations get 
loaded through that (if loaded from a JSP - seems weird I know, but the test 
above proofs it).

Whatever the reason and exact explanation, my recommendation would be to clean 
that up and avoid UTF-8 encoded Java *.properties files. As this one here is 
getting long, I suggest we track this new sub aspect of this problem in a new 
issue MIFOS-4851 "Translations in UTF-8 encoded Java *.properties files are 
problematic", and link the two.

      was (Author: vorburger):
    I think I've figured this out... I maintain that the stuff (my patch) 
discussed above is valid and needed, but (my bad) there is another kind of 
unrelated issue: Something is wrong with the translations in the *.properties.  
I was able to see Chinese locally, after applying the attached patch, and 
switching with a applicationConfiguration.custom.properties (thanks Adam) and 
then running the following:

find . -name "*.properties" -exec native2ascii -encoding utf-8 {} {}  \;

in the userInterface/src/main/resources/org/mifos/ui/localizedProperties/ & 
questionnaire/src/main/resources/org/mifos/platform/questionnaire/ui/localizedProperties/
 & 
cashflow/src/main/resources/org/mifos/platform/cashflow/ui/localizedProperties 
& application/src/main/resources/org/mifos/config/localizedResources & 
appdomain/src/main/resources/org/mifos/config/localizedResources directories.

BTW: One must restart the (Workspace Embedded Jetty, works fine) after running 
the above, else only translations in the main body of JSP pages are OK (have 
refreshed automatically) but the left hand menu and top tabs don't refresh - 
what's the deal with that?! 

So it seems that in FTL pages the technically wrong encoding of the properties 
files is compensated by something, but in the JSP pages it doesn't work 
(anymore).  I haven't fully understood how this works, but stumbled upon the 
mifos-appdomain/src/main/resources/org/mifos/config/resources/messageSourceBean.xml
 with its ReloadableResourceBundleMessageSource and fileEncodings=UTF-8 & 
defaultEncoding=UTF-8, I can only speculate that not all translations get 
loaded through that (if loaded from a JSP - seems weird I know, but the test 
above proofs it).

Whatever the reason and exact explanation, my recommendation would be to clean 
that up and avoid UTF-8 encoded Java *.properties files. As this one here is 
getting long, I suggest we track this new sub aspect of this problem in a new 
issue MIFOS-485 "Translations in UTF-8 encoded Java *.properties files are 
problematic", and link the two.
  
> can't see Chinese: app server sends non-UTF-8 charset in response headers for 
> old ui (Struts/JSP)
> -------------------------------------------------------------------------------------------------
>
>                 Key: MIFOS-4789
>                 URL: http://mifosforge.jira.com/browse/MIFOS-4789
>             Project: mifos
>          Issue Type: Bug
>          Components: Build and Testing, Internationalization, Localization
>    Affects Versions: Release G
>         Environment: Chinese head/master test server running 
> head-master-archive build #73. Multiple browsers/operating systems.
>            Reporter: Adam Monsen
>            Assignee: Sumit Shah
>            Priority: Critical
>              Labels: chinesetranslation, volunteer
>             Fix For: Release G - Iteration 2, Release G
>
>         Attachments: 
> 0001-FIXED-MIFOS-4789-can-t-see-Chinese-app-server-sends-.patch
>
>
> Jetty is incorrectly setting a non-UTF-8 character set for Struts/JSP pages. 
> I'm using Google Chrome's developer tools to view the response headers, but 
> other software (ie: firefox plugins) can also be used to view response 
> headers.
> h1. Expected
> {noformat}Content-Type:text/html;charset=UTF-8{noformat}
> SpringMVC/ftl pages work. For example: http://ci.mifos.org:8118/mifos/
> h1. Actual
> {noformat}Content-Type:text/html;charset=ISO-8859-1{noformat}
> For example: 
> http://ci.mifos.org:8118/mifos/custSearchAction.do?method=getHomePage
> h1. Workaround
> Manually set encoding to UTF-8 in browser.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to