Hi Konstantin, that is fine that you have a little time ;-) 1) I have a whish: Could we introduce a new cocoon.xconf parameter for i18n called empty-translation, e.g. empty-translation="."? At this time it is not possible to have an empty translation. I need this for generic formular creation and I only commented out line 357 in XMLResourceBundle.java: itemValue = itemValue.trim(); and put a space in the dictionary. But I think a more common solution would be fine also for others. 2) I prepared 2 new attributes: currency-no-unit and int-currency-no-unit This prevents the "$" or "DM" (now "Euro") from printing. I append the diff -u 3) Since the last update (?) of XMLResourceBundleFactory.java I get this note at compile time: Note: .../i18n/XMLResourceBundleFactory.java uses or overrides a deprecated API. Recompile with "-deprecation" for details. If you could have a look at this ...
Thanks, Michael "Piroumian, Konstantin" wrote: > > Hi, C2ers! > > As I have a little free time, I'm going to make some code clean up in i18n > transformer and LocaleAction. I've already added JavaDoc comments to all > public members and polished a little class comments. > > Next I am going to create an I18nUtils class that will contain all general > purpose i18n routines, such as locale string parsing, date/number formatting > and parsing, etc. Currently, it will be placed in org.apache.cocoon.i18n > package. > > Also, I'm going to add a new <i18n:get-locale> element that will use > LocaleAction.getLocale() to return the current selected Locale (it can be > different from request.getLocale()). (It'd be good also to move getLocale() > to the new I18nUtils, but now getLocale() has a lot of dependencies from > Cocoon, but I want to keep I18nUtils as much general as possible). > > Are there any other wishes/suggestions/comments regarding i18n? > > Best regards, > > Konstantin Piroumian > Leading Software Developer > > Protek Flagship LLC > Phone: + 7 095 795 0520 (add. 1288) > Fax: + 7 095 795 0525 > E-mail: [EMAIL PROTECTED] > http://www.protek.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED]
--- I18nTransformer.java.orig Thu Jan 24 12:53:01 2002 +++ I18nTransformer.java Thu Jan 24 12:53:04 2002 @@ -1110,6 +1110,19 @@ int_currency = 1; for ( int i = 0; i < to_fmt.getMaximumFractionDigits(); i++ ) int_currency *= 10; + } else if ( subType.equals( "currency-no-unit" ) ) { + DecimalFormat tmp = (DecimalFormat) NumberFormat.getCurrencyInstance( loc +); + to_fmt = (DecimalFormat) NumberFormat.getInstance( loc ); + to_fmt.setMinimumFractionDigits(tmp.getMinimumFractionDigits()); + to_fmt.setMaximumFractionDigits(tmp.getMaximumFractionDigits()); + } else if ( subType.equals( "int-currency-no-unit" ) ) { + DecimalFormat tmp = (DecimalFormat) NumberFormat.getCurrencyInstance( loc +); + int_currency = 1; + for ( int i = 0; i < tmp.getMaximumFractionDigits(); i++ ) + int_currency *= 10; + to_fmt = (DecimalFormat) NumberFormat.getInstance( loc ); + to_fmt.setMinimumFractionDigits(tmp.getMinimumFractionDigits()); + to_fmt.setMaximumFractionDigits(tmp.getMaximumFractionDigits()); } else if ( subType.equals( "percent" ) ) { to_fmt = (DecimalFormat) NumberFormat.getPercentInstance( loc ); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]