geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Jiang (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (GERONIMO-4763) i18n properties files should be converted to ascii at build time.
Date Sun, 26 Jul 2009 03:11:16 GMT

    [ https://issues.apache.org/jira/browse/GERONIMO-4763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735344#action_12735344
] 

Shawn Jiang edited comment on GERONIMO-4763 at 7/25/09 8:10 PM:
----------------------------------------------------------------

{noformat}
- everything is in ascii unicode escape sequences all the time (is this what we have now?)
{noformat}
yes, this is what we have. use \uXXXX ascii as the i18n resource storage format.

{noformat}
- everything is in utf-8 all the time (svn, checked out source code, any compiled property
files
{noformat}

not exactly, we can't use utf-8(except 8859-1 char) in compiled properties because resource
bundle only happy with \uXXXX escaped format with 8859-1 charset.
 {noformat}
- utf-8 in svn and checkout and unicode escape after compilation
{noformat}
This is what I'm going to do.EOL of svn does not have any relationship with this i18n content
encoding. I've tested Eclipse, notepad, gedit, vim.  They are all happy with UTF-8 i18n properties.
 I think if the editor support utf-8, there's no reason it can't read UTF-8 i18n native language
properties.

As for the question "why would we change to ascii during compilation?"

The problem is with resource bundles. For resouce bundle, Properties files are always read
as ISO-8859-1. As a result, To include Unicode characters in i18n properties file, we must
use \uXXXX escapes(with native2ascii tool). 

      was (Author: genspring):
    {noformat}
- everything is in ascii unicode escape sequences all the time (is this what we have now?)
{noformat}
                yes, this is what we have. use \uXXXX ascii as the i18n resource storage format.

{noformat}
- everything is in utf-8 all the time (svn, checked out source code, any compiled property
files
{noformat}
not exactly, we can make it because resource bundle only happy with \uXXXX escaped format.
 
- utf-8 in svn and checkout and unicode escape after compilation
{noformat}
This is what I'm going to do.

EOL of svn does not have any relationship with this i18n content encoding.

I've tested Eclipse, notepad, gedit, vim.  They are all happy with UTF-8 i18n properties.
 I think if the editor support utf-8, there's no reason it can't read UTF-8 i18n native language
properties.

As for the question why would we change to ascii during compilation?

The problem is with resource bundles. For resouce bundle, Properties files are always read
as ISO-8859-1. As a result, To include Unicode characters in i18n properties file, we must
use \uXXXX escapes(with native2ascii tool). 
  
> i18n properties files should be converted  to ascii at build time.
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-4763
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4763
>             Project: Geronimo
>          Issue Type: Improvement
>      Security Level: public(Regular issues) 
>          Components: usability
>    Affects Versions: 2.1.5, 2.2
>            Reporter: Shawn Jiang
>            Assignee: Shawn Jiang
>            Priority: Minor
>
> Current i18n properties files are stored in source code repo after they are converted
to ascii from native offline.  It's very hard to contribute new translations.
> We should keep native characters in source code while convert them to ascii at build
time. maven plugin native2ascii-maven-plugin could be used here:
> {code}
> <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>native2ascii-maven-plugin</artifactId>
>                 <version>1.0-alpha-1</version>
>                 <configuration>
>                     <dest>target/classes</dest>
>                     <src>src/main/resources</src>
>                 </configuration>
>                 <executions>
>                     <execution>
>                         <id>native2ascii-utf8</id>
>                         <goals>
>                             <goal>native2ascii</goal>
>                         </goals>
>                         <configuration>
>                             <encoding>UTF8</encoding>
>                             <includes>
>                                 ConsoleResources_jp.properties,
>                                 ConsoleResources_zh*.properties
>                             </includes>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
> {code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message