hello,
we want to implement multilingual <drop-down><entity-options> in the widget form files. but it has a bug, Code: ModelFormField.EntityOptions.addOptionValues() MapStack localContext = null; if (context instanceof MapStack) { localContext = ((MapStack) context).standAloneStack(); localContext.push(value); } else { localContext = MapStack.create(context); localContext.push(value); } String optionDesc = this.description.expandString(value, UtilMisc.ensureLocale(context.get("locale"))); There localContext not implement localizedMap interface, so it not passable invoke get multilingual method name get(name,locale); code: FlexibleMapAccessor.getByLocale(String name,Map base,Map sub,Locale locale){ if (sub instanceof LocalizedMap) { LocalizedMap locMap = (LocalizedMap) sub; if (locale != null) { return locMap.get(name, locale); } else if (base.containsKey("locale")) { return locMap.get(name, UtilMisc.ensureLocale(base.get("locale"))); } else { return locMap.get(name, Locale.getDefault()); } } else { Object getReturn = sub.get(name); return getReturn; } } YJBO [hidden email] 2005-09-13 _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev |
This doesn't make any sense, could you describe what you are trying to do and how you expect it to work (ie in terms of the code you write, not the underlying Java code). The context itself isn't localized, I'm not sure what that would even mean. Things like properties files and items from the database are handled differently, you might want to look at the Wiki entry about this and now dozens of practically identical discussions on the topic in the mailing lists... ;) -David On Sep 16, 2005, at 1:46 AM, YJBO wrote: > hello, > > we want to implement multilingual <drop-down><entity-options> > in the widget form files. but it has a bug, > > Code: > ModelFormField.EntityOptions.addOptionValues() > > MapStack localContext = null; > if (context instanceof MapStack) { > localContext = ((MapStack) context).standAloneStack(); > localContext.push(value); > } else { > localContext = MapStack.create(context); > localContext.push(value); > } > > String optionDesc = this.description.expandString(value, > UtilMisc.ensureLocale(context.get("locale"))); > > > There localContext not implement localizedMap interface, so > it not passable invoke get multilingual method name get(name,locale); > > code: > > FlexibleMapAccessor.getByLocale(String name,Map base,Map > sub,Locale locale){ > if (sub instanceof LocalizedMap) { > LocalizedMap locMap = (LocalizedMap) sub; > if (locale != null) { > return locMap.get(name, locale); > } else if (base.containsKey("locale")) { > return locMap.get(name, UtilMisc.ensureLocale > (base.get("locale"))); > } else { > return locMap.get(name, Locale.getDefault()); > } > } else { > Object getReturn = sub.get(name); > return getReturn; > } > } > > > > YJBO > [hidden email] > 2005-09-13 > > _______________________________________________ > Dev mailing list > [hidden email] > http://lists.ofbiz.org/mailman/listinfo/dev > _______________________________________________ Dev mailing list [hidden email] http://lists.ofbiz.org/mailman/listinfo/dev smime.p7s (3K) Download Attachment |
Free forum by Nabble | Edit this page |