You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2003/07/15 02:45:14 UTC

DO NOT REPLY [Bug 21596] New: - Simplifications to Language Resource Files

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21596>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21596

Simplifications to Language Resource Files

           Summary: Simplifications to Language Resource Files
           Product: XalanJ2
           Version: CurrentCVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: org.apache.xalan.res
        AssignedTo: xalan-dev@xml.apache.org
        ReportedBy: glenmazza@yahoo.com


In the org.apache.xalan.res.XSLTErrorResources_xx language resource files, I 
was able to simplify each of the language resource files (about 400-450 lines 
saved each) by making the following changes:

a) As is currently done with the Swedish (http://cvs.apache.org/viewcvs.cgi/xml-
xalan/java/src/org/apache/xalan/res/XSLTErrorResources_sv.java?rev=1.6&content-
type=text/vnd.viewcvs-markup), by subclassing the language files to 
XSLTErrorResources instead of ListResourceBundle, the string constants defining 
all of the language strings do not need to be redefined in each file.

b) The MAX_CODE, MAX_WARNING, MAX_OTHERS, and MAX_MESSAGES constants can also 
be kept exclusively in the XSLTErrorResources base class.  However, these 
constants are not being maintained/used due to the change from using int's to 
string constants, so I removed them from the base directory as well.

c) The loadResourceBundle() and getResourceSuffix() functions defined in each 
class--base and subclass--are never being referenced in the application.  (Only 
one loadResourceBundle() function is being called throughout the app, the one 
in xml.res.XMLMessages.)  So to reduce confusion, I also removed these 
functions.

[The dormant loadResourceBundle() functions also had a few bugs in them-- (1) 
the "fall back" to en_US clause is still requesting the foreign language for 
most of the languages, (2) it is returning an XSLTErrorResources even though 
the bundle is currently not castable to that type, (3) also a suffix is 
incorrectly being added to the class name.  These bugs all disappear of course 
with the removal of these functions.]

This patch fixes all instances in org.apache.xalan.res.*--and has been tested 
with English, German, and Italian.  If this patch is accepted and if desired, I 
can also make similar patches for the XML and XPATH resource directories.

Thanks,
Glen